Use lowercase true, false and null constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
3cf321fdfc
commit
23eb0462e5
|
@ -53,7 +53,7 @@ class AnonymousOptionsPlugin extends ServerPlugin {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isRequestInRoot($path) {
|
public function isRequestInRoot($path) {
|
||||||
return $path === '' || (is_string($path) && strpos($path, '/') === FALSE);
|
return $path === '' || (is_string($path) && strpos($path, '/') === false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -397,7 +397,7 @@ class FilesPlugin extends ServerPlugin {
|
||||||
|
|
||||||
$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function() use ($node) {
|
$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function() use ($node) {
|
||||||
$checksum = $node->getChecksum();
|
$checksum = $node->getChecksum();
|
||||||
if ($checksum === NULL || $checksum === '') {
|
if ($checksum === null || $checksum === '') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -327,14 +327,14 @@ trait Sharing {
|
||||||
return $this->isExpectedUrl((string)$element->$field, "index.php/s/");
|
return $this->isExpectedUrl((string)$element->$field, "index.php/s/");
|
||||||
}
|
}
|
||||||
elseif ((string)$element->$field == $contentExpected){
|
elseif ((string)$element->$field == $contentExpected){
|
||||||
return True;
|
return true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
print($element->$field);
|
print($element->$field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return False;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if ($contentExpected == "A_TOKEN"){
|
if ($contentExpected == "A_TOKEN"){
|
||||||
return (strlen((string)$data->$field) == 15);
|
return (strlen((string)$data->$field) == 15);
|
||||||
|
@ -346,9 +346,9 @@ trait Sharing {
|
||||||
return $this->isExpectedUrl((string)$data->$field, "index.php/s/");
|
return $this->isExpectedUrl((string)$data->$field, "index.php/s/");
|
||||||
}
|
}
|
||||||
elseif ($data->$field == $contentExpected){
|
elseif ($data->$field == $contentExpected){
|
||||||
return True;
|
return true;
|
||||||
}
|
}
|
||||||
return False;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ trait Sharing {
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
*/
|
*/
|
||||||
public function checkSharedFileInResponse($filename){
|
public function checkSharedFileInResponse($filename){
|
||||||
Assert::assertEquals(True, $this->isFieldInResponse('file_target', "/$filename"));
|
Assert::assertEquals(true, $this->isFieldInResponse('file_target', "/$filename"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -367,7 +367,7 @@ trait Sharing {
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
*/
|
*/
|
||||||
public function checkSharedFileNotInResponse($filename){
|
public function checkSharedFileNotInResponse($filename){
|
||||||
Assert::assertEquals(False, $this->isFieldInResponse('file_target', "/$filename"));
|
Assert::assertEquals(false, $this->isFieldInResponse('file_target', "/$filename"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -376,7 +376,7 @@ trait Sharing {
|
||||||
* @param string $user
|
* @param string $user
|
||||||
*/
|
*/
|
||||||
public function checkSharedUserInResponse($user){
|
public function checkSharedUserInResponse($user){
|
||||||
Assert::assertEquals(True, $this->isFieldInResponse('share_with', "$user"));
|
Assert::assertEquals(true, $this->isFieldInResponse('share_with', "$user"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -385,17 +385,17 @@ trait Sharing {
|
||||||
* @param string $user
|
* @param string $user
|
||||||
*/
|
*/
|
||||||
public function checkSharedUserNotInResponse($user){
|
public function checkSharedUserNotInResponse($user){
|
||||||
Assert::assertEquals(False, $this->isFieldInResponse('share_with', "$user"));
|
Assert::assertEquals(false, $this->isFieldInResponse('share_with', "$user"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isUserOrGroupInSharedData($userOrGroup, $permissions = null){
|
public function isUserOrGroupInSharedData($userOrGroup, $permissions = null){
|
||||||
$data = simplexml_load_string($this->response->getBody())->data[0];
|
$data = simplexml_load_string($this->response->getBody())->data[0];
|
||||||
foreach($data as $element) {
|
foreach($data as $element) {
|
||||||
if ($element->share_with == $userOrGroup && ($permissions === null || $permissions == $element->permissions)){
|
if ($element->share_with == $userOrGroup && ($permissions === null || $permissions == $element->permissions)){
|
||||||
return True;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return False;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -424,7 +424,7 @@ trait Sharing {
|
||||||
$this->createShare($user1, $filepath, 0, $user2, null, null, $permissions);
|
$this->createShare($user1, $filepath, 0, $user2, null, null, $permissions);
|
||||||
}
|
}
|
||||||
$this->response = $client->get($fullUrl, $options);
|
$this->response = $client->get($fullUrl, $options);
|
||||||
Assert::assertEquals(True, $this->isUserOrGroupInSharedData($user2, $permissions));
|
Assert::assertEquals(true, $this->isUserOrGroupInSharedData($user2, $permissions));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -453,7 +453,7 @@ trait Sharing {
|
||||||
$this->createShare($user, $filepath, 1, $group, null, null, $permissions);
|
$this->createShare($user, $filepath, 1, $group, null, null, $permissions);
|
||||||
}
|
}
|
||||||
$this->response = $client->get($fullUrl, $options);
|
$this->response = $client->get($fullUrl, $options);
|
||||||
Assert::assertEquals(True, $this->isUserOrGroupInSharedData($group, $permissions));
|
Assert::assertEquals(true, $this->isUserOrGroupInSharedData($group, $permissions));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -159,7 +159,7 @@ class ContactsStore implements IContactsStore {
|
||||||
if ($ownGroupsOnly && $entry->getProperty('isLocalSystemBook') === true) {
|
if ($ownGroupsOnly && $entry->getProperty('isLocalSystemBook') === true) {
|
||||||
$uid = $this->userManager->get($entry->getProperty('UID'));
|
$uid = $this->userManager->get($entry->getProperty('UID'));
|
||||||
|
|
||||||
if ($uid === NULL) {
|
if ($uid === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ class CacheJail extends CacheWrapper {
|
||||||
$results = $this->getCache()->searchQuery($simpleQuery);
|
$results = $this->getCache()->searchQuery($simpleQuery);
|
||||||
$results = $this->formatSearchResults($results);
|
$results = $this->formatSearchResults($results);
|
||||||
|
|
||||||
$limit = $query->getLimit() === 0 ? NULL : $query->getLimit();
|
$limit = $query->getLimit() === 0 ? null : $query->getLimit();
|
||||||
$results = array_slice($results, $query->getOffset(), $limit);
|
$results = array_slice($results, $query->getOffset(), $limit);
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
|
@ -133,7 +133,7 @@ class JSCombiner {
|
||||||
|
|
||||||
$deps = json_decode($deps, true);
|
$deps = json_decode($deps, true);
|
||||||
|
|
||||||
if ($deps === NULL) {
|
if ($deps === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -795,7 +795,7 @@ class OC_Util {
|
||||||
// is_writable doesn't work for NFS mounts, so try to write a file and check if it exists.
|
// is_writable doesn't work for NFS mounts, so try to write a file and check if it exists.
|
||||||
$testFile = sprintf('%s/%s.tmp', $CONFIG_DATADIRECTORY, uniqid('data_dir_writability_test_'));
|
$testFile = sprintf('%s/%s.tmp', $CONFIG_DATADIRECTORY, uniqid('data_dir_writability_test_'));
|
||||||
$handle = fopen($testFile, 'w');
|
$handle = fopen($testFile, 'w');
|
||||||
if (!$handle || fwrite($handle, 'Test write operation') === FALSE) {
|
if (!$handle || fwrite($handle, 'Test write operation') === false) {
|
||||||
$permissionsHint = $l->t('Permissions can usually be fixed by giving the webserver write access to the root directory. See %s.',
|
$permissionsHint = $l->t('Permissions can usually be fixed by giving the webserver write access to the root directory. See %s.',
|
||||||
[$urlGenerator->linkToDocs('admin-dir_permissions')]);
|
[$urlGenerator->linkToDocs('admin-dir_permissions')]);
|
||||||
$errors[] = [
|
$errors[] = [
|
||||||
|
|
|
@ -260,7 +260,7 @@ class Util {
|
||||||
$host_name = \OC::$server->getRequest()->getServerHost();
|
$host_name = \OC::$server->getRequest()->getServerHost();
|
||||||
// strip away port number (if existing)
|
// strip away port number (if existing)
|
||||||
$colon_pos = strpos($host_name, ':');
|
$colon_pos = strpos($host_name, ':');
|
||||||
if ($colon_pos != FALSE) {
|
if ($colon_pos != false) {
|
||||||
$host_name = substr($host_name, 0, $colon_pos);
|
$host_name = substr($host_name, 0, $colon_pos);
|
||||||
}
|
}
|
||||||
return $host_name;
|
return $host_name;
|
||||||
|
|
|
@ -70,7 +70,7 @@ class UserAvatarTest extends \Test\TestCase {
|
||||||
return false;
|
return false;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$data = NULL;
|
$data = null;
|
||||||
$file->method('putContent')
|
$file->method('putContent')
|
||||||
->with($this->callback(function ($d) use (&$data) {
|
->with($this->callback(function ($d) use (&$data) {
|
||||||
$data = $d;
|
$data = $d;
|
||||||
|
|
|
@ -16,7 +16,7 @@ use OC_DB;
|
||||||
* @group DB
|
* @group DB
|
||||||
*/
|
*/
|
||||||
class LegacyDBTest extends \Test\TestCase {
|
class LegacyDBTest extends \Test\TestCase {
|
||||||
protected $backupGlobals = FALSE;
|
protected $backupGlobals = false;
|
||||||
|
|
||||||
protected static $schema_file;
|
protected static $schema_file;
|
||||||
protected $test_prefix;
|
protected $test_prefix;
|
||||||
|
|
|
@ -205,9 +205,9 @@ class EncryptionTest extends \Test\TestCase {
|
||||||
$fileName = tempnam("/tmp", "FOO");
|
$fileName = tempnam("/tmp", "FOO");
|
||||||
$stream = $this->getStream($fileName, 'w+', 0);
|
$stream = $this->getStream($fileName, 'w+', 0);
|
||||||
$this->assertEquals(6, fwrite($stream, 'foobar'));
|
$this->assertEquals(6, fwrite($stream, 'foobar'));
|
||||||
$this->assertEquals(TRUE, rewind($stream));
|
$this->assertEquals(true, rewind($stream));
|
||||||
$this->assertEquals('foobar', fread($stream, 100));
|
$this->assertEquals('foobar', fread($stream, 100));
|
||||||
$this->assertEquals(TRUE, rewind($stream));
|
$this->assertEquals(true, rewind($stream));
|
||||||
$this->assertEquals(3, fwrite($stream, 'bar'));
|
$this->assertEquals(3, fwrite($stream, 'bar'));
|
||||||
fclose($stream);
|
fclose($stream);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class MessageTest extends TestCase {
|
||||||
*/
|
*/
|
||||||
public function getMailAddressProvider() {
|
public function getMailAddressProvider() {
|
||||||
return array(
|
return array(
|
||||||
array(NULL, array()),
|
array(null, array()),
|
||||||
array(array('lukas@owncloud.com' => 'Lukas Reschke'), array('lukas@owncloud.com' => 'Lukas Reschke')),
|
array(array('lukas@owncloud.com' => 'Lukas Reschke'), array('lukas@owncloud.com' => 'Lukas Reschke')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class TagsTest extends \Test\TestCase {
|
||||||
protected $user;
|
protected $user;
|
||||||
/** @var \OCP\IUserSession */
|
/** @var \OCP\IUserSession */
|
||||||
protected $userSession;
|
protected $userSession;
|
||||||
protected $backupGlobals = FALSE;
|
protected $backupGlobals = false;
|
||||||
/** @var \OC\Tagging\TagMapper */
|
/** @var \OC\Tagging\TagMapper */
|
||||||
protected $tagMapper;
|
protected $tagMapper;
|
||||||
/** @var \OCP\ITagManager */
|
/** @var \OCP\ITagManager */
|
||||||
|
|
Loading…
Reference in New Issue