Skip to content

Commit

Permalink
Use lowercase true, false and null constants
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Mar 25, 2020
1 parent 3cf321f commit 23eb046
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function initialize(\Sabre\DAV\Server $server) {
* @return bool
*/
public function isRequestInRoot($path) {
return $path === '' || (is_string($path) && strpos($path, '/') === FALSE);
return $path === '' || (is_string($path) && strpos($path, '/') === false);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)

$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function() use ($node) {
$checksum = $node->getChecksum();
if ($checksum === NULL || $checksum === '') {
if ($checksum === null || $checksum === '') {
return null;
}

Expand Down
24 changes: 12 additions & 12 deletions build/integration/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,14 @@ public function isFieldInResponse($field, $contentExpected){
return $this->isExpectedUrl((string)$element->$field, "index.php/s/");
}
elseif ((string)$element->$field == $contentExpected){
return True;
return true;
}
else{
print($element->$field);
}
}

return False;
return false;
} else {
if ($contentExpected == "A_TOKEN"){
return (strlen((string)$data->$field) == 15);
Expand All @@ -346,9 +346,9 @@ public function isFieldInResponse($field, $contentExpected){
return $this->isExpectedUrl((string)$data->$field, "index.php/s/");
}
elseif ($data->$field == $contentExpected){
return True;
return true;
}
return False;
return false;
}
}

Expand All @@ -358,7 +358,7 @@ public function isFieldInResponse($field, $contentExpected){
* @param string $filename
*/
public function checkSharedFileInResponse($filename){
Assert::assertEquals(True, $this->isFieldInResponse('file_target', "/$filename"));
Assert::assertEquals(true, $this->isFieldInResponse('file_target', "/$filename"));
}

/**
Expand All @@ -367,7 +367,7 @@ public function checkSharedFileInResponse($filename){
* @param string $filename
*/
public function checkSharedFileNotInResponse($filename){
Assert::assertEquals(False, $this->isFieldInResponse('file_target', "/$filename"));
Assert::assertEquals(false, $this->isFieldInResponse('file_target', "/$filename"));
}

/**
Expand All @@ -376,7 +376,7 @@ public function checkSharedFileNotInResponse($filename){
* @param string $user
*/
public function checkSharedUserInResponse($user){
Assert::assertEquals(True, $this->isFieldInResponse('share_with', "$user"));
Assert::assertEquals(true, $this->isFieldInResponse('share_with', "$user"));
}

/**
Expand All @@ -385,17 +385,17 @@ public function checkSharedUserInResponse($user){
* @param string $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){
$data = simplexml_load_string($this->response->getBody())->data[0];
foreach($data as $element) {
if ($element->share_with == $userOrGroup && ($permissions === null || $permissions == $element->permissions)){
return True;
return true;
}
}
return False;
return false;
}

/**
Expand Down Expand Up @@ -424,7 +424,7 @@ public function assureFileIsShared($entry, $filepath, $user1, $user2, $withPerms
$this->createShare($user1, $filepath, 0, $user2, null, null, $permissions);
}
$this->response = $client->get($fullUrl, $options);
Assert::assertEquals(True, $this->isUserOrGroupInSharedData($user2, $permissions));
Assert::assertEquals(true, $this->isUserOrGroupInSharedData($user2, $permissions));
}

/**
Expand Down Expand Up @@ -453,7 +453,7 @@ public function assureFileIsSharedWithGroup($entry, $filepath, $user, $group, $w
$this->createShare($user, $filepath, 1, $group, null, null, $permissions);
}
$this->response = $client->get($fullUrl, $options);
Assert::assertEquals(True, $this->isUserOrGroupInSharedData($group, $permissions));
Assert::assertEquals(true, $this->isUserOrGroupInSharedData($group, $permissions));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Contacts/ContactsMenu/ContactsStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private function filterContacts(IUser $self,
if ($ownGroupsOnly && $entry->getProperty('isLocalSystemBook') === true) {
$uid = $this->userManager->get($entry->getProperty('UID'));

if ($uid === NULL) {
if ($uid === null) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Cache/Wrapper/CacheJail.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function searchQuery(ISearchQuery $query) {
$results = $this->getCache()->searchQuery($simpleQuery);
$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);

return $results;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Template/JSCombiner.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected function isCached($fileName, ISimpleFolder $folder) {

$deps = json_decode($deps, true);

if ($deps === NULL) {
if ($deps === null) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public static function checkServer(\OC\SystemConfig $config) {
// 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_'));
$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.',
[$urlGenerator->linkToDocs('admin-dir_permissions')]);
$errors[] = [
Expand Down
2 changes: 1 addition & 1 deletion lib/public/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static function getServerHostName() {
$host_name = \OC::$server->getRequest()->getServerHost();
// strip away port number (if existing)
$colon_pos = strpos($host_name, ':');
if ($colon_pos != FALSE) {
if ($colon_pos != false) {
$host_name = substr($host_name, 0, $colon_pos);
}
return $host_name;
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Avatar/UserAvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testGetNoAvatar() {
return false;
}));

$data = NULL;
$data = null;
$file->method('putContent')
->with($this->callback(function ($d) use (&$data) {
$data = $d;
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/DB/LegacyDBTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @group DB
*/
class LegacyDBTest extends \Test\TestCase {
protected $backupGlobals = FALSE;
protected $backupGlobals = false;

protected static $schema_file;
protected $test_prefix;
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Files/Stream/EncryptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ public function testRewind() {
$fileName = tempnam("/tmp", "FOO");
$stream = $this->getStream($fileName, 'w+', 0);
$this->assertEquals(6, fwrite($stream, 'foobar'));
$this->assertEquals(TRUE, rewind($stream));
$this->assertEquals(true, rewind($stream));
$this->assertEquals('foobar', fread($stream, 100));
$this->assertEquals(TRUE, rewind($stream));
$this->assertEquals(true, rewind($stream));
$this->assertEquals(3, fwrite($stream, 'bar'));
fclose($stream);

Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Mail/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function mailAddressProvider() {
*/
public function getMailAddressProvider() {
return array(
array(NULL, array()),
array(null, array()),
array(array('[email protected]' => 'Lukas Reschke'), array('[email protected]' => 'Lukas Reschke')),
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/TagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TagsTest extends \Test\TestCase {
protected $user;
/** @var \OCP\IUserSession */
protected $userSession;
protected $backupGlobals = FALSE;
protected $backupGlobals = false;
/** @var \OC\Tagging\TagMapper */
protected $tagMapper;
/** @var \OCP\ITagManager */
Expand Down

0 comments on commit 23eb046

Please sign in to comment.