diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-09 09:22:29 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-09 10:16:08 +0200 |
commit | 2fbad1ed72bc9ef591a6f35558eb02e7b76ffd1b (patch) | |
tree | a3da09ffec08d6c8abc3bf0fabb7f8c8a1c830f6 /apps | |
parent | 1575bd838f2e938b18b04bcdcc28e2fc24d95c45 (diff) | |
download | nextcloud-server-2fbad1ed72bc9ef591a6f35558eb02e7b76ffd1b.tar.gz nextcloud-server-2fbad1ed72bc9ef591a6f35558eb02e7b76ffd1b.zip |
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps')
76 files changed, 617 insertions, 617 deletions
diff --git a/apps/accessibility/appinfo/routes.php b/apps/accessibility/appinfo/routes.php index ed8b0f57f08..a5e75fcdcee 100644 --- a/apps/accessibility/appinfo/routes.php +++ b/apps/accessibility/appinfo/routes.php @@ -27,13 +27,13 @@ return [ 'routes' => [ ['name' => 'accessibility#getCss', 'url' => '/css/user-{md5}', 'verb' => 'GET'], ['name' => 'accessibility#getJavascript', 'url' => '/js/accessibility', 'verb' => 'GET'], - ], - 'ocs' => [ + ], + 'ocs' => [ [ 'name' => 'Config#getConfig', 'url' => '/api/v1/config', 'verb' => 'GET', - ], + ], [ 'name' => 'Config#setConfig', 'url' => '/api/v1/config/{key}', @@ -44,5 +44,5 @@ return [ 'url' => '/api/v1/config/{key}', 'verb' => 'DELETE', ], - ] + ] ]; diff --git a/apps/accessibility/lib/AccessibilityProvider.php b/apps/accessibility/lib/AccessibilityProvider.php index 159cde37e3a..ef8571528bb 100644 --- a/apps/accessibility/lib/AccessibilityProvider.php +++ b/apps/accessibility/lib/AccessibilityProvider.php @@ -72,12 +72,12 @@ class AccessibilityProvider { public function getHighContrast() { return [ - 'id' => 'highcontrast', - 'img' => $this->urlGenerator->imagePath($this->appName, 'mode-highcontrast.jpg'), - 'title' => $this->l->t('High contrast mode'), - 'enableLabel' => $this->l->t('Enable high contrast mode'), - 'text' => $this->l->t('A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased.') - ]; + 'id' => 'highcontrast', + 'img' => $this->urlGenerator->imagePath($this->appName, 'mode-highcontrast.jpg'), + 'title' => $this->l->t('High contrast mode'), + 'enableLabel' => $this->l->t('Enable high contrast mode'), + 'text' => $this->l->t('A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased.') + ]; } public function getFonts() { diff --git a/apps/comments/lib/Activity/Provider.php b/apps/comments/lib/Activity/Provider.php index 763e2d036d4..a637d4ca6b3 100644 --- a/apps/comments/lib/Activity/Provider.php +++ b/apps/comments/lib/Activity/Provider.php @@ -146,17 +146,17 @@ class Provider implements IProvider { if ($event->getSubject() === 'add_comment_subject') { if ($subjectParameters['actor'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('You commented on %1$s', [ - $subjectParameters['filePath'], - ])) + $subjectParameters['filePath'], + ])) ->setRichSubject($this->l->t('You commented on {file}'), [ 'file' => $this->generateFileParameter($subjectParameters['fileId'], $subjectParameters['filePath']), ]); } else { $author = $this->generateUserParameter($subjectParameters['actor']); $event->setParsedSubject($this->l->t('%1$s commented on %2$s', [ - $author['name'], - $subjectParameters['filePath'], - ])) + $author['name'], + $subjectParameters['filePath'], + ])) ->setRichSubject($this->l->t('{author} commented on {file}'), [ 'author' => $author, 'file' => $this->generateFileParameter($subjectParameters['fileId'], $subjectParameters['filePath']), diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index bef0a9e7194..cf06cb5ab25 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -772,7 +772,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription [ 'calendarId' => $calendarId, 'calendarData' => $this->getCalendarById($calendarId), - ])); + ])); return $calendarId; } @@ -833,7 +833,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'calendarData' => $this->getCalendarById($calendarId), 'shares' => $this->getShares($calendarId), 'propertyMutations' => $mutations, - ])); + ])); return true; }); @@ -852,7 +852,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription 'calendarId' => $calendarId, 'calendarData' => $this->getCalendarById($calendarId), 'shares' => $this->getShares($calendarId), - ])); + ])); $stmt = $this->db->prepare('DELETE FROM `*PREFIX*calendarobjects` WHERE `calendarid` = ? AND `calendartype` = ?'); $stmt->execute([$calendarId, self::CALENDAR_TYPE_CALENDAR]); @@ -2095,11 +2095,11 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription } return [ - 'uri' => $row['uri'], - 'calendardata' => $row['calendardata'], - 'lastmodified' => $row['lastmodified'], - 'etag' => '"' . $row['etag'] . '"', - 'size' => (int)$row['size'], + 'uri' => $row['uri'], + 'calendardata' => $row['calendardata'], + 'lastmodified' => $row['lastmodified'], + 'etag' => '"' . $row['etag'] . '"', + 'size' => (int)$row['size'], ]; } @@ -2124,11 +2124,11 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $result = []; foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { $result[] = [ - 'calendardata' => $row['calendardata'], - 'uri' => $row['uri'], - 'lastmodified' => $row['lastmodified'], - 'etag' => '"' . $row['etag'] . '"', - 'size' => (int)$row['size'], + 'calendardata' => $row['calendardata'], + 'uri' => $row['uri'], + 'lastmodified' => $row['lastmodified'], + 'etag' => '"' . $row['etag'] . '"', + 'size' => (int)$row['size'], ]; } diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index ca8534a76b8..38598e30ce3 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -191,10 +191,10 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if ($this->getOwner() !== parent::getOwner()) { $acl[] = [ - 'privilege' => '{DAV:}read', - 'principal' => parent::getOwner(), - 'protected' => true, - ]; + 'privilege' => '{DAV:}read', + 'principal' => parent::getOwner(), + 'protected' => true, + ]; if ($this->canWrite()) { $acl[] = [ 'privilege' => '{DAV:}write', diff --git a/apps/dav/lib/CardDAV/AddressBook.php b/apps/dav/lib/CardDAV/AddressBook.php index 56aa328be3e..4fc97ac401f 100644 --- a/apps/dav/lib/CardDAV/AddressBook.php +++ b/apps/dav/lib/CardDAV/AddressBook.php @@ -130,10 +130,10 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable { if ($this->getOwner() !== parent::getOwner()) { $acl[] = [ - 'privilege' => '{DAV:}read', - 'principal' => parent::getOwner(), - 'protected' => true, - ]; + 'privilege' => '{DAV:}read', + 'principal' => parent::getOwner(), + 'protected' => true, + ]; if ($this->canWrite()) { $acl[] = [ 'privilege' => '{DAV:}write', diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index 7ced2e90561..fd1cd8827aa 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -284,7 +284,7 @@ class AddressBookImpl implements IAddressBook { $result[$property->name][] = [ 'type' => $type, 'value' => $property->getValue() - ]; + ]; } else { $result[$property->name][] = $property->getValue(); } diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 8925fcdbd0c..ee9f723be6b 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -76,8 +76,8 @@ class CardDavBackend implements BackendInterface, SyncSupport { /** @var array properties to index */ public static $indexProperties = [ - 'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME', - 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD']; + 'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME', + 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD']; /** * @var string[] Map of uid => display name diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index 53067978749..2180911b55c 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -202,7 +202,7 @@ class SyncService { $body = $this->buildSyncCollectionRequestBody($syncToken); $response = $client->request('REPORT', $addressBookUrl, $body, [ - 'Content-Type' => 'application/xml' + 'Content-Type' => 'application/xml' ]); return $this->parseMultiStatus($response['body']); diff --git a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php index 2812eba9797..7f1a735c7a4 100644 --- a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php @@ -134,8 +134,8 @@ class FakeLockerPlugin extends ServerPlugin { $lockInfo->timeout = 1800; $body = $this->server->xml->write('{DAV:}prop', [ - '{DAV:}lockdiscovery' => - new LockDiscovery([$lockInfo]) + '{DAV:}lockdiscovery' => + new LockDiscovery([$lockInfo]) ]); $response->setStatus(200); diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 82f3c3b6ccd..8f94ea9a52e 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -209,7 +209,7 @@ class FilesPlugin extends ServerPlugin { $sourceNodeFileInfo = $sourceNode->getFileInfo(); if ($sourceNodeFileInfo === null) { throw new NotFound($source . ' does not exist'); - } + } if (!$sourceNodeFileInfo->isDeletable()) { throw new Forbidden($source . " cannot be deleted"); diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 4b068dafda2..2fa01c0315d 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -446,9 +446,9 @@ class Principal implements BackendInterface { $userId = $user->getUID(); $displayName = $user->getDisplayName(); $principal = [ - 'uri' => $this->principalPrefix . '/' . $userId, - '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, - '{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL', + 'uri' => $this->principalPrefix . '/' . $userId, + '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, + '{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL', ]; $email = $user->getEMailAddress(); diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php index 7f5bc6baea7..f740284f271 100644 --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php @@ -129,9 +129,9 @@ class ServerFactory { // Some WebDAV clients do require Class 2 WebDAV support (locking), since // we do not provide locking we emulate it using a fake locking plugin. if($this->request->isUserAgent([ - '/WebDAVFS/', - '/OneNote/', - '/Microsoft-WebDAV-MiniRedir/', + '/WebDAVFS/', + '/OneNote/', + '/Microsoft-WebDAV-MiniRedir/', ])) { $server->addPlugin(new \OCA\DAV\Connector\Sabre\FakeLockerPlugin()); } diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php index c1a4337b36b..b95c978cf1a 100644 --- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php +++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php @@ -29,59 +29,59 @@ use Sabre\Xml\XmlDeserializable; class ShareRequest implements XmlDeserializable { - public $set = []; + public $set = []; - public $remove = []; + public $remove = []; - /** - * Constructor - * - * @param array $set - * @param array $remove - */ - function __construct(array $set, array $remove) { + /** + * Constructor + * + * @param array $set + * @param array $remove + */ + function __construct(array $set, array $remove) { - $this->set = $set; - $this->remove = $remove; + $this->set = $set; + $this->remove = $remove; - } + } - static function xmlDeserialize(Reader $reader) { + static function xmlDeserialize(Reader $reader) { - $elements = $reader->parseInnerTree([ - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', - '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', - ]); + $elements = $reader->parseInnerTree([ + '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', + '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', + ]); - $set = []; - $remove = []; + $set = []; + $remove = []; - foreach ($elements as $elem) { - switch ($elem['name']) { + foreach ($elements as $elem) { + switch ($elem['name']) { - case '{' . Plugin::NS_OWNCLOUD . '}set' : - $sharee = $elem['value']; + case '{' . Plugin::NS_OWNCLOUD . '}set' : + $sharee = $elem['value']; - $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; - $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; + $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; + $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; - $set[] = [ - 'href' => $sharee['{DAV:}href'], - 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, - 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, - 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), - ]; - break; + $set[] = [ + 'href' => $sharee['{DAV:}href'], + 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, + 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, + 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), + ]; + break; - case '{' . Plugin::NS_OWNCLOUD . '}remove' : - $remove[] = $elem['value']['{DAV:}href']; - break; + case '{' . Plugin::NS_OWNCLOUD . '}remove' : + $remove[] = $elem['value']['{DAV:}href']; + break; - } - } + } + } - return new self($set, $remove); + return new self($set, $remove); - } + } } diff --git a/apps/dav/lib/RootCollection.php b/apps/dav/lib/RootCollection.php index 271b7f6c866..e50c2a882ca 100644 --- a/apps/dav/lib/RootCollection.php +++ b/apps/dav/lib/RootCollection.php @@ -148,30 +148,30 @@ class RootCollection extends SimpleCollection { \OC::$server->query(ITimeFactory::class)); $children = [ - new SimpleCollection('principals', [ - $userPrincipals, - $groupPrincipals, - $systemPrincipals, - $calendarResourcePrincipals, - $calendarRoomPrincipals]), - $filesCollection, - $userCalendarRoot, - new SimpleCollection('system-calendars', [ - $resourceCalendarRoot, - $roomCalendarRoot, - ]), - $publicCalendarRoot, - new SimpleCollection('addressbooks', [ - $usersAddressBookRoot, - $systemAddressBookRoot]), - $systemTagCollection, - $systemTagRelationsCollection, - $commentsCollection, - $uploadCollection, - $avatarCollection, - new SimpleCollection('provisioning', [ - $appleProvisioning - ]) + new SimpleCollection('principals', [ + $userPrincipals, + $groupPrincipals, + $systemPrincipals, + $calendarResourcePrincipals, + $calendarRoomPrincipals]), + $filesCollection, + $userCalendarRoot, + new SimpleCollection('system-calendars', [ + $resourceCalendarRoot, + $roomCalendarRoot, + ]), + $publicCalendarRoot, + new SimpleCollection('addressbooks', [ + $usersAddressBookRoot, + $systemAddressBookRoot]), + $systemTagCollection, + $systemTagRelationsCollection, + $commentsCollection, + $uploadCollection, + $avatarCollection, + new SimpleCollection('provisioning', [ + $appleProvisioning + ]) ]; parent::__construct('root', $children); diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index fb48e5fac4b..761ed734906 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -548,8 +548,8 @@ EOD; $this->assertEquals($id, $subscriptions[0]['id']); $patch = new PropPatch([ - '{DAV:}displayname' => 'Unit test', - '{http://apple.com/ns/ical/}calendar-color' => '#ac0606', + '{DAV:}displayname' => 'Unit test', + '{http://apple.com/ns/ical/}calendar-color' => '#ac0606', ]); $this->backend->updateSubscription($id, $patch); $patch->commit(); diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php index 76a8b5befdf..9257fe56e63 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php @@ -42,46 +42,46 @@ use OCP\Notification\INotification; class PushProviderTest extends AbstractNotificationProviderTest { - /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */ - protected $logger; + /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */ + protected $logger; - /** @var L10NFactory|\PHPUnit\Framework\MockObject\MockObject */ - protected $l10nFactory; + /** @var L10NFactory|\PHPUnit\Framework\MockObject\MockObject */ + protected $l10nFactory; - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - protected $l10n; + /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ + protected $l10n; - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - protected $urlGenerator; + /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ + protected $urlGenerator; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - protected $config; + /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ + protected $config; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - private $manager; + /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ + private $manager; - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ - private $timeFactory; + /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ + private $timeFactory; - protected function setUp(): void { - parent::setUp(); + protected function setUp(): void { + parent::setUp(); - $this->config = $this->createMock(IConfig::class); - $this->manager = $this->createMock(IManager::class); - $this->timeFactory = $this->createMock(ITimeFactory::class); + $this->config = $this->createMock(IConfig::class); + $this->manager = $this->createMock(IManager::class); + $this->timeFactory = $this->createMock(ITimeFactory::class); - $this->provider = new PushProvider( - $this->config, - $this->manager, - $this->logger, - $this->l10nFactory, - $this->urlGenerator, - $this->timeFactory - ); - } + $this->provider = new PushProvider( + $this->config, + $this->manager, + $this->logger, + $this->l10nFactory, + $this->urlGenerator, + $this->timeFactory + ); + } - public function testNotificationType():void { - $this->assertEquals(PushProvider::NOTIFICATION_TYPE, 'DISPLAY'); + public function testNotificationType():void { + $this->assertEquals(PushProvider::NOTIFICATION_TYPE, 'DISPLAY'); } public function testNotSend(): void { @@ -110,19 +110,19 @@ class PushProviderTest extends AbstractNotificationProviderTest { $this->provider->send($this->vcalendar->VEVENT, $this->calendarDisplayName, $users); } - public function testSend(): void { - $this->config->expects($this->once()) + public function testSend(): void { + $this->config->expects($this->once()) ->method('getAppValue') ->with('dav', 'sendEventRemindersPush', 'no') ->willReturn('yes'); - $user1 = $this->createMock(IUser::class); - $user1->method('getUID') + $user1 = $this->createMock(IUser::class); + $user1->method('getUID') ->willReturn('uid1'); - $user2 = $this->createMock(IUser::class); + $user2 = $this->createMock(IUser::class); $user2->method('getUID') ->willReturn('uid2'); - $user3 = $this->createMock(IUser::class); + $user3 = $this->createMock(IUser::class); $user3->method('getUID') ->willReturn('uid3'); @@ -161,13 +161,13 @@ class PushProviderTest extends AbstractNotificationProviderTest { ->with($notification3); $this->provider->send($this->vcalendar->VEVENT, $this->calendarDisplayName, $users); - } + } /** * @param string $uid * @param \DateTime $dt */ - private function createNotificationMock(string $uid, \DateTime $dt):INotification { + private function createNotificationMock(string $uid, \DateTime $dt):INotification { $notification = $this->createMock(INotification::class); $notification ->expects($this->once()) diff --git a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php index 76ff0a6a330..11ecdbc354b 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php @@ -42,11 +42,11 @@ use Test\TestCase; class ReminderServiceTest extends TestCase { - /** @var Backend|\PHPUnit\Framework\MockObject\MockObject */ - private $backend; + /** @var Backend|\PHPUnit\Framework\MockObject\MockObject */ + private $backend; - /** @var NotificationProviderManager|\PHPUnit\Framework\MockObject\MockObject */ - private $notificationProviderManager; + /** @var NotificationProviderManager|\PHPUnit\Framework\MockObject\MockObject */ + private $notificationProviderManager; /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ private $userManager; @@ -185,12 +185,12 @@ END:VEVENT END:VCALENDAR EOD; - protected function setUp(): void { + protected function setUp(): void { parent::setUp(); - $this->backend = $this->createMock(Backend::class); - $this->notificationProviderManager = $this->createMock(NotificationProviderManager::class); - $this->userManager = $this->createMock(IUserManager::class); + $this->backend = $this->createMock(Backend::class); + $this->notificationProviderManager = $this->createMock(NotificationProviderManager::class); + $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->caldavBackend = $this->createMock(CalDavBackend::class); $this->timeFactory = $this->createMock(ITimeFactory::class); @@ -203,14 +203,14 @@ EOD; $this->groupManager, $this->caldavBackend, $this->timeFactory); - } + } public function testOnCalendarObjectDelete():void { - $this->backend->expects($this->once()) + $this->backend->expects($this->once()) ->method('cleanRemindersForEvent') ->with(44); - $action = '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject'; + $action = '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject'; $objectData = [ 'id' => '44', 'component' => 'vevent', @@ -221,14 +221,14 @@ EOD; public function testOnCalendarObjectCreateSingleEntry():void { $action = '\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject'; - $objectData = [ - 'calendardata' => self::CALENDAR_DATA, + $objectData = [ + 'calendardata' => self::CALENDAR_DATA, 'id' => '42', 'calendarid' => '1337', 'component' => 'vevent', ]; - $this->backend->expects($this->exactly(2)) + $this->backend->expects($this->exactly(2)) ->method('insertReminder') ->withConsecutive( [1337, 42, 'wej2z68l9h', false, 1465430400, false, '5c70531aab15c92b52518ae10a2f78a4', 'de919af7429d3b5c11e8b9d289b411a6', 'EMAIL', true, 1465429500, false], @@ -236,12 +236,12 @@ EOD; ) ->willReturn(1); - $this->timeFactory->expects($this->once()) + $this->timeFactory->expects($this->once()) ->method('getDateTime') ->with() ->willReturn(\DateTime::createFromFormat(\DateTime::ATOM, '2016-06-08T00:00:00+00:00')); - $this->reminderService->onTouchCalendarObject($action, $objectData); + $this->reminderService->onTouchCalendarObject($action, $objectData); } public function testOnCalendarObjectCreateSingleEntryWithRepeat(): void { diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index 3d36b76e6ee..e132f082556 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -157,14 +157,14 @@ class BirthdayServiceTest extends TestCase { $this->cardDav->expects($this->once())->method('getAddressBookById') ->with(666) ->willReturn([ - 'principaluri' => 'principals/users/user01', - 'uri' => 'default' - ]); + 'principaluri' => 'principals/users/user01', + 'uri' => 'default' + ]); $this->calDav->expects($this->once())->method('getCalendarByUri') ->with('principals/users/user01', 'contact_birthdays') ->willReturn([ - 'id' => 1234 - ]); + 'id' => 1234 + ]); $this->calDav->expects($this->at(1))->method('deleteCalendarObject')->with(1234, 'default-gump.vcf.ics'); $this->calDav->expects($this->at(2))->method('deleteCalendarObject')->with(1234, 'default-gump.vcf-death.ics'); $this->calDav->expects($this->at(3))->method('deleteCalendarObject')->with(1234, 'default-gump.vcf-anniversary.ics'); diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 9298edb53ad..5efce1c23be 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -135,7 +135,7 @@ class CardDavBackendTest extends TestCase { $this->createMock(IAppManager::class), $this->createMock(ProxyMapper::class), $this->createMock(IConfig::class), - ]) + ]) ->setMethods(['getPrincipalByPath', 'getGroupMembership']) ->getMock(); $this->principal->method('getPrincipalByPath') @@ -668,12 +668,12 @@ class CardDavBackendTest extends TestCase { $query->insert($this->dbCardsTable) ->values( [ - 'addressbookid' => $query->createNamedParameter(0), - 'carddata' => $query->createNamedParameter($vCards[$i]->serialize(), IQueryBuilder::PARAM_LOB), - 'uri' => $query->createNamedParameter('uri' . $i), - 'lastmodified' => $query->createNamedParameter(time()), - 'etag' => $query->createNamedParameter('etag' . $i), - 'size' => $query->createNamedParameter(120), + 'addressbookid' => $query->createNamedParameter(0), + 'carddata' => $query->createNamedParameter($vCards[$i]->serialize(), IQueryBuilder::PARAM_LOB), + 'uri' => $query->createNamedParameter('uri' . $i), + 'lastmodified' => $query->createNamedParameter(time()), + 'etag' => $query->createNamedParameter('etag' . $i), + 'size' => $query->createNamedParameter(120), ] ); $query->execute(); @@ -694,11 +694,11 @@ class CardDavBackendTest extends TestCase { $query->insert($this->dbCardsPropertiesTable) ->values( [ - 'addressbookid' => $query->createNamedParameter(0), - 'cardid' => $query->createNamedParameter($vCardIds[0]), - 'name' => $query->createNamedParameter('CLOUD'), - 'value' => $query->createNamedParameter('John@nextcloud.com'), - 'preferred' => $query->createNamedParameter(0) + 'addressbookid' => $query->createNamedParameter(0), + 'cardid' => $query->createNamedParameter($vCardIds[0]), + 'name' => $query->createNamedParameter('CLOUD'), + 'value' => $query->createNamedParameter('John@nextcloud.com'), + 'preferred' => $query->createNamedParameter(0) ] ); $query->execute(); @@ -755,13 +755,13 @@ class CardDavBackendTest extends TestCase { public function dataTestSearch() { return [ - ['John', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], - ['M. Doe', ['FN'], [], [['uri1', 'John M. Doe']]], - ['Do', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], - 'check if duplicates are handled correctly' => ['John', ['FN', 'CLOUD'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], - 'case insensitive' => ['john', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], - 'find "_" escaped' => ['_', ['CLOUD'], [], [['uri2', 'find without options']]], - 'find not empty ClOUD' => ['%_%', ['CLOUD'], ['escape_like_param'=>false], [['uri0', 'John Doe'], ['uri2', 'find without options']]], + ['John', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + ['M. Doe', ['FN'], [], [['uri1', 'John M. Doe']]], + ['Do', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + 'check if duplicates are handled correctly' => ['John', ['FN', 'CLOUD'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + 'case insensitive' => ['john', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], + 'find "_" escaped' => ['_', ['CLOUD'], [], [['uri2', 'find without options']]], + 'find not empty ClOUD' => ['%_%', ['CLOUD'], ['escape_like_param'=>false], [['uri0', 'John Doe'], ['uri2', 'find without options']]], ]; } @@ -770,12 +770,12 @@ class CardDavBackendTest extends TestCase { $query->insert($this->dbCardsTable) ->values( [ - 'addressbookid' => $query->createNamedParameter(1), - 'carddata' => $query->createNamedParameter('carddata', IQueryBuilder::PARAM_LOB), - 'uri' => $query->createNamedParameter('uri'), - 'lastmodified' => $query->createNamedParameter(5489543), - 'etag' => $query->createNamedParameter('etag'), - 'size' => $query->createNamedParameter(120), + 'addressbookid' => $query->createNamedParameter(1), + 'carddata' => $query->createNamedParameter('carddata', IQueryBuilder::PARAM_LOB), + 'uri' => $query->createNamedParameter('uri'), + 'lastmodified' => $query->createNamedParameter(5489543), + 'etag' => $query->createNamedParameter('etag'), + 'size' => $query->createNamedParameter(120), ] ); $query->execute(); @@ -798,12 +798,12 @@ class CardDavBackendTest extends TestCase { $query->insert($this->dbCardsTable) ->values( [ - 'addressbookid' => $query->createNamedParameter($i), - 'carddata' => $query->createNamedParameter('carddata' . $i, IQueryBuilder::PARAM_LOB), - 'uri' => $query->createNamedParameter('uri' . $i), - 'lastmodified' => $query->createNamedParameter(5489543), - 'etag' => $query->createNamedParameter('etag' . $i), - 'size' => $query->createNamedParameter(120), + 'addressbookid' => $query->createNamedParameter($i), + 'carddata' => $query->createNamedParameter('carddata' . $i, IQueryBuilder::PARAM_LOB), + 'uri' => $query->createNamedParameter('uri' . $i), + 'lastmodified' => $query->createNamedParameter(5489543), + 'etag' => $query->createNamedParameter('etag' . $i), + 'size' => $query->createNamedParameter(120), ] ); $query->execute(); diff --git a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php index 1f9a6c50844..12ce1bca5c3 100644 --- a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php +++ b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php @@ -41,8 +41,8 @@ class ContactsManagerTest extends TestCase { /** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject $backEnd */ $backEnd = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); $backEnd->method('getAddressBooksForUser')->willReturn([ - ['{DAV:}displayname' => 'Test address book', 'uri' => 'default'], - ]); + ['{DAV:}displayname' => 'Test address book', 'uri' => 'default'], + ]); $l = $this->createMock(IL10N::class); $app = new ContactsManager($backEnd, $l); diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php index 0c129b0de7d..7e93c05a3fc 100644 --- a/apps/dav/tests/unit/CardDAV/ConverterTest.php +++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php @@ -192,9 +192,9 @@ class ConverterTest extends TestCase { public function providesNames() { return [ - ['Sauron;;;;', 'Sauron'], - ['Baggins;Bilbo;;;', 'Bilbo Baggins'], - ['Tolkien;John;Ronald Reuel;;', 'John Ronald Reuel Tolkien'], + ['Sauron;;;;', 'Sauron'], + ['Baggins;Bilbo;;;', 'Bilbo Baggins'], + ['Tolkien;John;Ronald Reuel;;', 'John Ronald Reuel Tolkien'], ]; } diff --git a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php index d5ad784d70d..7de2ea2f56a 100644 --- a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php @@ -69,10 +69,10 @@ class PluginTest extends TestCase { public function testSharing() { $this->book->expects($this->once())->method('updateShares')->with([[ - 'href' => 'principal:principals/admin', - 'commonName' => null, - 'summary' => null, - 'readOnly' => false + 'href' => 'principal:principals/admin', + 'commonName' => null, + 'summary' => null, + 'readOnly' => false ]], ['mailto:wilfredo@example.com']); // setup request diff --git a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php index 40243020e9b..9015528763f 100644 --- a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php @@ -131,41 +131,41 @@ class SyncServiceTest extends TestCase { $accountManager = $this->getMockBuilder(AccountManager::class)->disableOriginalConstructor()->getMock(); $accountManager->expects($this->any())->method('getUser') ->willReturn([ - AccountManager::PROPERTY_DISPLAYNAME => - [ - 'value' => $user->getDisplayName(), - 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, - ], - AccountManager::PROPERTY_ADDRESS => - [ - 'value' => '', - 'scope' => AccountManager::VISIBILITY_PRIVATE, - ], - AccountManager::PROPERTY_WEBSITE => - [ - 'value' => '', - 'scope' => AccountManager::VISIBILITY_PRIVATE, - ], - AccountManager::PROPERTY_EMAIL => - [ - 'value' => $user->getEMailAddress(), - 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, - ], - AccountManager::PROPERTY_AVATAR => - [ - 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY - ], - AccountManager::PROPERTY_PHONE => - [ - 'value' => '', - 'scope' => AccountManager::VISIBILITY_PRIVATE, - ], - AccountManager::PROPERTY_TWITTER => - [ - 'value' => '', - 'scope' => AccountManager::VISIBILITY_PRIVATE, - ], - ] + AccountManager::PROPERTY_DISPLAYNAME => + [ + 'value' => $user->getDisplayName(), + 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, + ], + AccountManager::PROPERTY_ADDRESS => + [ + 'value' => '', + 'scope' => AccountManager::VISIBILITY_PRIVATE, + ], + AccountManager::PROPERTY_WEBSITE => + [ + 'value' => '', + 'scope' => AccountManager::VISIBILITY_PRIVATE, + ], + AccountManager::PROPERTY_EMAIL => + [ + 'value' => $user->getEMailAddress(), + 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, + ], + AccountManager::PROPERTY_AVATAR => + [ + 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY + ], + AccountManager::PROPERTY_PHONE => + [ + 'value' => '', + 'scope' => AccountManager::VISIBILITY_PRIVATE, + ], + AccountManager::PROPERTY_TWITTER => + [ + 'value' => '', + 'scope' => AccountManager::VISIBILITY_PRIVATE, + ], + ] ); $ss = new SyncService($backend, $userManager, $logger, $accountManager); diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php index ff6cdbd0335..36553ff65a2 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -262,7 +262,7 @@ class MoveCalendarTest extends TestCase { ->with(1234) ->willReturn([ ['href' => 'principal:principals/groups/nextclouders'] - ]); + ]); if ($shareWithGroupMembersOnly === true) { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage("User <user2> is not part of the group <nextclouders> with whom the calendar <personal> was shared. You may use -f to move the calendar while deleting this share."); @@ -412,7 +412,7 @@ class MoveCalendarTest extends TestCase { 'href' => 'principal:principals/users/user2', '{DAV:}displayname' => 'Personal' ] - ]); + ]); if ($force === false) { $this->expectException(InvalidArgumentException::class); diff --git a/apps/dav/tests/unit/Comments/CommentsPluginTest.php b/apps/dav/tests/unit/Comments/CommentsPluginTest.php index 4844aab6b1b..7210e96b122 100644 --- a/apps/dav/tests/unit/Comments/CommentsPluginTest.php +++ b/apps/dav/tests/unit/Comments/CommentsPluginTest.php @@ -182,11 +182,11 @@ class CommentsPluginTest extends \Test\TestCase { ]; $comment = new Comment([ - 'objectType' => 'files', - 'objectId' => '666', - 'actorType' => 'users', - 'actorId' => 'alice' - ] + $commentData); + 'objectType' => 'files', + 'objectId' => '666', + 'actorType' => 'users', + 'actorId' => 'alice' + ] + $commentData); $comment->setId('23'); $path = 'comments/files/666'; @@ -264,11 +264,11 @@ class CommentsPluginTest extends \Test\TestCase { ]; $comment = new Comment([ - 'objectType' => 'files', - 'objectId' => '42', - 'actorType' => 'users', - 'actorId' => 'alice' - ] + $commentData); + 'objectType' => 'files', + 'objectId' => '42', + 'actorType' => 'users', + 'actorId' => 'alice' + ] + $commentData); $comment->setId('23'); $path = 'comments/files/42'; @@ -352,11 +352,11 @@ class CommentsPluginTest extends \Test\TestCase { ]; $comment = new Comment([ - 'objectType' => 'files', - 'objectId' => '42', - 'actorType' => 'users', - 'actorId' => 'alice' - ] + $commentData); + 'objectType' => 'files', + 'objectId' => '42', + 'actorType' => 'users', + 'actorId' => 'alice' + ] + $commentData); $comment->setId('23'); $path = 'comments/files/42'; @@ -440,13 +440,13 @@ class CommentsPluginTest extends \Test\TestCase { ]; $comment = new Comment([ - 'objectType' => 'files', - 'objectId' => '42', - 'actorType' => 'users', - 'actorId' => 'alice', - 'message' => 'dummy', - 'verb' => 'dummy' - ]); + 'objectType' => 'files', + 'objectId' => '42', + 'actorType' => 'users', + 'actorId' => 'alice', + 'message' => 'dummy', + 'verb' => 'dummy' + ]); $comment->setId('23'); $path = 'comments/files/42'; @@ -535,12 +535,12 @@ class CommentsPluginTest extends \Test\TestCase { ]; $comment = new Comment([ - 'objectType' => 'files', - 'objectId' => '42', - 'actorType' => 'users', - 'actorId' => 'alice', - 'verb' => 'comment', - ]); + 'objectType' => 'files', + 'objectId' => '42', + 'actorType' => 'users', + 'actorId' => 'alice', + 'verb' => 'comment', + ]); $comment->setId('23'); $path = 'comments/files/42'; diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 4c87351116c..d366726e919 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -350,52 +350,52 @@ class FileTest extends TestCase { public function legalMtimeProvider() { return [ "string" => [ - 'HTTP_X_OC_MTIME' => "string", - 'expected result' => null + 'HTTP_X_OC_MTIME' => "string", + 'expected result' => null ], "castable string (int)" => [ - 'HTTP_X_OC_MTIME' => "34", - 'expected result' => 34 + 'HTTP_X_OC_MTIME' => "34", + 'expected result' => 34 ], "castable string (float)" => [ - 'HTTP_X_OC_MTIME' => "34.56", - 'expected result' => 34 + 'HTTP_X_OC_MTIME' => "34.56", + 'expected result' => 34 ], "float" => [ - 'HTTP_X_OC_MTIME' => 34.56, - 'expected result' => 34 + 'HTTP_X_OC_MTIME' => 34.56, + 'expected result' => 34 ], "zero" => [ - 'HTTP_X_OC_MTIME' => 0, - 'expected result' => 0 + 'HTTP_X_OC_MTIME' => 0, + 'expected result' => 0 ], "zero string" => [ - 'HTTP_X_OC_MTIME' => "0", - 'expected result' => 0 + 'HTTP_X_OC_MTIME' => "0", + 'expected result' => 0 ], "negative zero string" => [ - 'HTTP_X_OC_MTIME' => "-0", - 'expected result' => 0 + 'HTTP_X_OC_MTIME' => "-0", + 'expected result' => 0 ], "string starting with number following by char" => [ - 'HTTP_X_OC_MTIME' => "2345asdf", - 'expected result' => null + 'HTTP_X_OC_MTIME' => "2345asdf", + 'expected result' => null ], "string castable hex int" => [ - 'HTTP_X_OC_MTIME' => "0x45adf", - 'expected result' => null + 'HTTP_X_OC_MTIME' => "0x45adf", + 'expected result' => null ], "string that looks like invalid hex int" => [ - 'HTTP_X_OC_MTIME' => "0x123g", - 'expected result' => null + 'HTTP_X_OC_MTIME' => "0x123g", + 'expected result' => null ], "negative int" => [ - 'HTTP_X_OC_MTIME' => -34, - 'expected result' => -34 + 'HTTP_X_OC_MTIME' => -34, + 'expected result' => -34 ], "negative float" => [ - 'HTTP_X_OC_MTIME' => -34.43, - 'expected result' => -34 + 'HTTP_X_OC_MTIME' => -34.43, + 'expected result' => -34 ], ]; } @@ -406,9 +406,9 @@ class FileTest extends TestCase { */ public function testPutSingleFileLegalMtime($requestMtime, $resultMtime) { $request = new \OC\AppFramework\Http\Request([ - 'server' => [ - 'HTTP_X_OC_MTIME' => $requestMtime, - ] + 'server' => [ + 'HTTP_X_OC_MTIME' => $requestMtime, + ] ], null, $this->config, null); $file = 'foo.txt'; @@ -430,9 +430,9 @@ class FileTest extends TestCase { */ public function testChunkedPutLegalMtime($requestMtime, $resultMtime) { $request = new \OC\AppFramework\Http\Request([ - 'server' => [ - 'HTTP_X_OC_MTIME' => $requestMtime, - ] + 'server' => [ + 'HTTP_X_OC_MTIME' => $requestMtime, + ] ], null, $this->config, null); $_SERVER['HTTP_OC_CHUNKED'] = true; @@ -1105,10 +1105,10 @@ class FileTest extends TestCase { $userView = Filesystem::getView(); } return [ - "filesize" => $userView->filesize($path), - "mtime" => $userView->filemtime($path), - "filetype" => $userView->filetype($path), - "mimetype" => $userView->getMimeType($path) + "filesize" => $userView->filesize($path), + "mtime" => $userView->filemtime($path), + "filetype" => $userView->filetype($path), + "mimetype" => $userView->getMimeType($path) ]; } diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index 8f2ee2b6643..cb4104044b7 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -335,7 +335,7 @@ class PrincipalTest extends TestCase { 'principals/groups/group1', 'principals/groups/foo%2Fbar', 'proxyId1/calendar-proxy-read', - 'proxyId2/calendar-proxy-write', + 'proxyId2/calendar-proxy-write', ]; $response = $this->connector->getGroupMembership('principals/users/foo'); $this->assertSame($expectedResponse, $response); @@ -545,9 +545,9 @@ class PrincipalTest extends TestCase { ->willReturn([$user2, $user3]); $this->assertEquals([ - 'principals/users/user2', - 'principals/users/user3', - ], $this->connector->searchPrincipals('principals/users', + 'principals/users/user2', + 'principals/users/user3', + ], $this->connector->searchPrincipals('principals/users', ['{urn:ietf:params:xml:ns:caldav}calendar-user-address-set' => 'user@example.com'])); } diff --git a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php index 4063aac5f0d..9d8d2d925f7 100644 --- a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php @@ -71,10 +71,10 @@ class PluginTest extends TestCase { public function testSharing() { $this->book->expects($this->once())->method('updateShares')->with([[ - 'href' => 'principal:principals/admin', - 'commonName' => null, - 'summary' => null, - 'readOnly' => false + 'href' => 'principal:principals/admin', + 'commonName' => null, + 'summary' => null, + 'readOnly' => false ]], ['mailto:wilfredo@example.com']); // setup request diff --git a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php index eec2558ee9d..698e39a5218 100644 --- a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php +++ b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php @@ -48,10 +48,10 @@ class SystemPrincipalBackendTest extends TestCase { 'uri' => 'principals/system/system', '{DAV:}displayname' => 'system', ], - [ - 'uri' => 'principals/system/public', - '{DAV:}displayname' => 'public', - ] + [ + 'uri' => 'principals/system/public', + '{DAV:}displayname' => 'public', + ] ], 'principals/system'], ]; } @@ -125,7 +125,7 @@ class SystemPrincipalBackendTest extends TestCase { public function providesPrincipalForGetGroupMembership() { return [ - ['principals/system/a'], + ['principals/system/a'], ]; } diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php index f513a68f068..2a4c832c71c 100644 --- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php +++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php @@ -87,41 +87,41 @@ class AssemblyStreamTest extends \Test\TestCase { return[ 'one node zero bytes' => [ '', [ - $this->buildNode('0', '') - ]], + $this->buildNode('0', '') + ]], 'one node only' => [ '1234567890', [ - $this->buildNode('0', '1234567890') - ]], + $this->buildNode('0', '1234567890') + ]], 'one node buffer boundary' => [ $data8k, [ - $this->buildNode('0', $data8k) - ]], + $this->buildNode('0', $data8k) + ]], 'two nodes' => [ '1234567890', [ - $this->buildNode('1', '67890'), - $this->buildNode('0', '12345') - ]], + $this->buildNode('1', '67890'), + $this->buildNode('0', '12345') + ]], 'two nodes end on buffer boundary' => [ $data8k . $data8k, [ - $this->buildNode('1', $data8k), - $this->buildNode('0', $data8k) - ]], + $this->buildNode('1', $data8k), + $this->buildNode('0', $data8k) + ]], 'two nodes with one on buffer boundary' => [ $data8k . $dataLess8k, [ - $this->buildNode('1', $dataLess8k), - $this->buildNode('0', $data8k) - ]], + $this->buildNode('1', $dataLess8k), + $this->buildNode('0', $data8k) + ]], 'two nodes on buffer boundary plus one byte' => [ $data8k . 'X' . $data8k, [ - $this->buildNode('1', $data8k), - $this->buildNode('0', $data8k . 'X') - ]], + $this->buildNode('1', $data8k), + $this->buildNode('0', $data8k . 'X') + ]], 'two nodes on buffer boundary plus one byte at the end' => [ $data8k . $data8k . 'X', [ - $this->buildNode('1', $data8k . 'X'), - $this->buildNode('0', $data8k) - ]], + $this->buildNode('1', $data8k . 'X'), + $this->buildNode('0', $data8k) + ]], 'a ton of nodes' => [ $tonofdata, $tonofnodes ] diff --git a/apps/encryption/lib/Users/Setup.php b/apps/encryption/lib/Users/Setup.php index 0ff488ae582..b9fc7aea4d9 100644 --- a/apps/encryption/lib/Users/Setup.php +++ b/apps/encryption/lib/Users/Setup.php @@ -64,7 +64,7 @@ class Setup { $this->user = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false; $this->crypt = $crypt; $this->keyManager = $keyManager; - } + } /** * @param string $uid user id diff --git a/apps/encryption/tests/RecoveryTest.php b/apps/encryption/tests/RecoveryTest.php index a41c2ff9fea..ce5c1f006a6 100644 --- a/apps/encryption/tests/RecoveryTest.php +++ b/apps/encryption/tests/RecoveryTest.php @@ -110,8 +110,8 @@ class RecoveryTest extends TestCase { $this->cryptMock->expects($this->once()) ->method('createKeyPair') ->willReturn([ - 'publicKey' => 'privateKey', - 'privateKey' => 'publicKey', + 'publicKey' => 'privateKey', + 'privateKey' => 'publicKey', ]); $this->keyManagerMock->expects($this->once()) diff --git a/apps/federatedfilesharing/lib/Notifications.php b/apps/federatedfilesharing/lib/Notifications.php index ae0c2d524a1..a70e947e3c1 100644 --- a/apps/federatedfilesharing/lib/Notifications.php +++ b/apps/federatedfilesharing/lib/Notifications.php @@ -255,7 +255,7 @@ class Notifications { $fields = [ 'token' => $token, 'remoteId' => $remoteId - ]; + ]; foreach ($data as $key => $value) { $fields[$key] = $value; } diff --git a/apps/federation/lib/SyncFederationAddressBooks.php b/apps/federation/lib/SyncFederationAddressBooks.php index 094d2c0cb0b..f0e3d2ba38b 100644 --- a/apps/federation/lib/SyncFederationAddressBooks.php +++ b/apps/federation/lib/SyncFederationAddressBooks.php @@ -78,7 +78,7 @@ class SyncFederationAddressBooks { $targetBookId = $trustedServer['url_hash']; $targetPrincipal = "principals/system/system"; $targetBookProperties = [ - '{DAV:}displayname' => $url + '{DAV:}displayname' => $url ]; try { $newToken = $this->syncService->syncRemoteAddressBook($url, $cardDavUser, $addressBookUrl, $sharedSecret, $syncToken, $targetBookId, $targetPrincipal, $targetBookProperties); diff --git a/apps/federation/tests/DbHandlerTest.php b/apps/federation/tests/DbHandlerTest.php index 121e6b3cce6..d68173cb451 100644 --- a/apps/federation/tests/DbHandlerTest.php +++ b/apps/federation/tests/DbHandlerTest.php @@ -92,9 +92,9 @@ class DbHandlerTest extends TestCase { public function dataTestAddServer() { return [ - ['http://owncloud.org', 'http://owncloud.org', sha1('owncloud.org')], - ['https://owncloud.org', 'https://owncloud.org', sha1('owncloud.org')], - ['http://owncloud.org/', 'http://owncloud.org', sha1('owncloud.org')], + ['http://owncloud.org', 'http://owncloud.org', sha1('owncloud.org')], + ['https://owncloud.org', 'https://owncloud.org', sha1('owncloud.org')], + ['http://owncloud.org/', 'http://owncloud.org', sha1('owncloud.org')], ]; } diff --git a/apps/federation/tests/SyncFederationAddressbooksTest.php b/apps/federation/tests/SyncFederationAddressbooksTest.php index 8cf02fce7d8..ac0650c664a 100644 --- a/apps/federation/tests/SyncFederationAddressbooksTest.php +++ b/apps/federation/tests/SyncFederationAddressbooksTest.php @@ -54,13 +54,13 @@ class SyncFederationAddressbooksTest extends \Test\TestCase { getMock(); $dbHandler->method('getAllServer')-> willReturn([ - [ - 'url' => 'https://cloud.drop.box', - 'url_hash' => 'sha1', - 'shared_secret' => 'iloveowncloud', - 'sync_token' => '0' - ] - ]); + [ + 'url' => 'https://cloud.drop.box', + 'url_hash' => 'sha1', + 'shared_secret' => 'iloveowncloud', + 'sync_token' => '0' + ] + ]); $dbHandler->expects($this->once())->method('setServerStatus')-> with('https://cloud.drop.box', 1, '1'); $syncService = $this->getMockBuilder('OCA\DAV\CardDAV\SyncService') diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php index f2220e6276d..b236f753adb 100644 --- a/apps/files/tests/BackgroundJob/ScanFilesTest.php +++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php @@ -52,8 +52,8 @@ class ScanFilesTest extends TestCase { $this->scanFiles = $this->getMockBuilder('\OCA\Files\BackgroundJob\ScanFiles') ->setConstructorArgs([ - $this->config, - $this->userManager, + $this->config, + $this->userManager, ]) ->setMethods(['runScanner']) ->getMock(); @@ -105,7 +105,7 @@ class ScanFilesTest extends TestCase { ->method('search') ->with('', 500, 50) ->willReturn([ - $fakeUser + $fakeUser ]); $this->config ->expects($this->at(2)) diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index 8f2f8fe9ec1..c00f30c890a 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -99,17 +99,17 @@ class ViewControllerTest extends TestCase { $this->activityHelper = $this->createMock(Helper::class); $this->viewController = $this->getMockBuilder('\OCA\Files\Controller\ViewController') ->setConstructorArgs([ - 'files', - $this->request, - $this->urlGenerator, - $this->l10n, - $this->config, - $this->eventDispatcher, - $this->userSession, - $this->appManager, - $this->rootFolder, - $this->activityHelper, - ]) + 'files', + $this->request, + $this->urlGenerator, + $this->l10n, + $this->config, + $this->eventDispatcher, + $this->userSession, + $this->appManager, + $this->rootFolder, + $this->activityHelper, + ]) ->setMethods([ 'getStorageInfo', 'renderScript' @@ -262,14 +262,14 @@ class ViewControllerTest extends TestCase { 'classes' => 'collapsible', 'sublist' => [ [ - 'id' => 'sharingout', + 'id' => 'sharingout', 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 16, 'name' => \OC::$server->getL10N('files_sharing')->t('Shared with others'), ], [ - 'id' => 'sharingin', + 'id' => 'sharingin', 'appname' => 'files_sharing', 'script' => 'list.php', 'order' => 15, diff --git a/apps/files_external/lib/Command/Config.php b/apps/files_external/lib/Command/Config.php index c7fd63c5e43..f58b1561e68 100644 --- a/apps/files_external/lib/Command/Config.php +++ b/apps/files_external/lib/Command/Config.php @@ -93,8 +93,8 @@ class Config extends Base { $value = $mount->getBackendOption($key); } if (!is_string($value) && json_decode(json_encode($value)) === $value) { // show bools and objects correctly - $value = json_encode($value); - } + $value = json_encode($value); + } $output->writeln($value); } @@ -106,9 +106,9 @@ class Config extends Base { */ protected function setOption(StorageConfig $mount, $key, $value, OutputInterface $output) { $decoded = json_decode($value, true); - if (!is_null($decoded) && json_encode($decoded) === $value) { - $value = $decoded; - } + if (!is_null($decoded) && json_encode($decoded) === $value) { + $value = $decoded; + } if ($key === 'mountpoint' || $key === 'mount_point') { $mount->setMountPoint($value); } else { diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php index b864ff451b6..a200b581c39 100644 --- a/apps/files_external/lib/Controller/AjaxController.php +++ b/apps/files_external/lib/Controller/AjaxController.php @@ -93,8 +93,8 @@ class AjaxController extends Controller { 'private_key' => $key['privatekey'], 'public_key' => $key['publickey'] ], - 'status' => 'success' - ]); + 'status' => 'success' + ]); } /** diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index 9fb7b2a62a9..633399197f2 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -227,7 +227,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { public function testDeleteUnexistingStorage() { $this->expectException(\DomainException::class); - $this->actualDeletedUnexistingStorageTest(); + $this->actualDeletedUnexistingStorageTest(); } public function getUniqueStoragesProvider() { diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php index db57b5e6bf3..db2fd00341f 100644 --- a/apps/files_external/tests/Storage/FtpTest.php +++ b/apps/files_external/tests/Storage/FtpTest.php @@ -65,10 +65,10 @@ class FtpTest extends \Test\Files\Storage\Storage { public function testConstructUrl(){ $config = [ 'host' => 'localhost', - 'user' => 'ftp', - 'password' => 'ftp', - 'root' => '/', - 'secure' => false ]; + 'user' => 'ftp', + 'password' => 'ftp', + 'root' => '/', + 'secure' => false ]; $instance = new FTP($config); $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl('')); diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php index fbf4304d826..21e6536acd5 100644 --- a/apps/files_external/tests/config.php +++ b/apps/files_external/tests/config.php @@ -100,11 +100,11 @@ return [ 'root'=>'/test' ], 'sftp_key' => [ - 'run'=>false, - 'host'=>'localhost', - 'user'=>'test', - 'public_key'=>'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJPTvz3OLonF2KSGEKP/nd4CPmRYvemG2T4rIiNYjDj0U5y+2sKEWbjiUlQl2bsqYuVoJ+/UNJlGQbbZ08kQirFeo1GoWBzqioaTjUJfbLN6TzVVKXxR9YIVmH7Ajg2iEeGCndGgbmnPfj+kF9TR9IH8vMVvtubQwf7uEwB0ALhw== phpseclib-generated-key', + 'run'=>false, + 'host'=>'localhost', + 'user'=>'test', + 'public_key'=>'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJPTvz3OLonF2KSGEKP/nd4CPmRYvemG2T4rIiNYjDj0U5y+2sKEWbjiUlQl2bsqYuVoJ+/UNJlGQbbZ08kQirFeo1GoWBzqioaTjUJfbLN6TzVVKXxR9YIVmH7Ajg2iEeGCndGgbmnPfj+kF9TR9IH8vMVvtubQwf7uEwB0ALhw== phpseclib-generated-key', 'private_key'=>'test', - 'root'=>'/test' - ], + 'root'=>'/test' + ], ]; diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php index 4f0b547e433..63a67bb5b48 100644 --- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php +++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php @@ -136,7 +136,7 @@ class SharingCheckMiddleware extends Middleware { } if (!$this->reflector->hasAnnotation('NoOutgoingFederatedSharingRequired') && - $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') !== 'yes') { + $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') !== 'yes') { return false; } diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 6e9bad0a9d2..5c462b51aa6 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -112,7 +112,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); <div> <?php echo $l->t('By uploading files, you agree to the %1$sterms of service%2$s.', [ - '<span id="show-terms-dialog">', '</span>' + '<span id="show-terms-dialog">', '</span>' ]); ?> </div> diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index c5ce0107f80..94e5504aece 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -227,19 +227,19 @@ class CacheTest extends TestCase { function testSearchByMime() { $results = $this->sharedStorage->getCache()->searchByMime('text'); $check = [ - [ - 'name' => 'bar.txt', - 'path' => 'bar.txt' - ], - [ - 'name' => 'another too.txt', - 'path' => 'subdir/another too.txt' - ], - [ - 'name' => 'another.txt', - 'path' => 'subdir/another.txt' - ], - ]; + [ + 'name' => 'bar.txt', + 'path' => 'bar.txt' + ], + [ + 'name' => 'another too.txt', + 'path' => 'subdir/another too.txt' + ], + [ + 'name' => 'another.txt', + 'path' => 'subdir/another.txt' + ], + ]; $this->verifyFiles($check, $results); } diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index c2d4c7641e4..3f82675fedf 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -4085,7 +4085,7 @@ class ShareAPIControllerTest extends TestCase { $recipientGroup = $this->createMock('\OCP\IGroup'); $recipientGroup->method('getDisplayName')->willReturn('recipientGroupDisplayName'); $this->groupManager->method('get')->willReturnMap([ - ['recipientGroup', $recipientGroup], + ['recipientGroup', $recipientGroup], ]); $this->urlGenerator->method('linkToRouteAbsolute') diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index 2bc81e9dcf9..3579202b36f 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -155,7 +155,7 @@ abstract class AUserData extends OCSController { ]; return $data; - } + } /** * Get the groups a user is a subadmin of diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 8905f1348a8..6ed5a1217c5 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -105,7 +105,7 @@ class UsersController extends AUserData { NewUserMailHelper $newUserMailHelper, FederatedFileSharingFactory $federatedFileSharingFactory, ISecureRandom $secureRandom, - RemoteWipe $remoteWipe) { + RemoteWipe $remoteWipe) { parent::__construct($appName, $request, $userManager, diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index f512502df48..f5969c01526 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php @@ -258,7 +258,7 @@ class GroupsControllerTest extends \Test\TestCase { 'canAdd' => true, 'canRemove' => true - ] + ] ]], $result->getData()); } diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index 0a02378cba0..a5a79c23ebd 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -157,10 +157,10 @@ class UsersControllerTest extends TestCase { ->willReturn(['Admin' => [], 'Foo' => [], 'Bar' => []]); $expected = ['users' => [ - 'Admin', - 'Foo', - 'Bar', - ], + 'Admin', + 'Foo', + 'Bar', + ], ]; $this->assertEquals($expected, $this->api->getUsers('MyCustomSearch')->getData()); } diff --git a/apps/settings/lib/Activity/SecurityProvider.php b/apps/settings/lib/Activity/SecurityProvider.php index 962fa63d792..568006d03cc 100644 --- a/apps/settings/lib/Activity/SecurityProvider.php +++ b/apps/settings/lib/Activity/SecurityProvider.php @@ -63,8 +63,8 @@ class SecurityProvider implements IProvider { case 'twofactor_success': $params = $event->getSubjectParameters(); $event->setParsedSubject($l->t('You successfully logged in using two-factor authentication (%1$s)', [ - $params['provider'], - ])); + $params['provider'], + ])); if ($this->activityManager->getRequirePNG()) { $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png'))); } else { @@ -74,8 +74,8 @@ class SecurityProvider implements IProvider { case 'twofactor_failed': $params = $event->getSubjectParameters(); $event->setParsedSubject($l->t('A login attempt using two-factor authentication failed (%1$s)', [ - $params['provider'], - ])); + $params['provider'], + ])); if ($this->activityManager->getRequirePNG()) { $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png'))); } else { diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php index c15f3b8f23a..db4e4580693 100644 --- a/apps/settings/tests/Controller/CheckSetupControllerTest.php +++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php @@ -148,7 +148,7 @@ class CheckSetupControllerTest extends TestCase { $this->dateTimeFormatter, $this->memoryInfo, $this->secureRandom, - ]) + ]) ->setMethods([ 'isReadOnlyConfig', 'hasValidTransactionIsolationLevel', @@ -203,7 +203,7 @@ class CheckSetupControllerTest extends TestCase { $this->config->expects($this->at(0)) ->method('getSystemValue') ->with('has_internet_connection', true) - ->willReturn(true); + ->willReturn(true); $this->config->expects($this->at(1)) ->method('getSystemValue') @@ -232,7 +232,7 @@ class CheckSetupControllerTest extends TestCase { $this->config->expects($this->at(0)) ->method('getSystemValue') ->with('has_internet_connection', true) - ->willReturn(true); + ->willReturn(true); $this->config->expects($this->at(1)) ->method('getSystemValue') @@ -956,7 +956,7 @@ class CheckSetupControllerTest extends TestCase { 'No errors have been found.', Http::STATUS_OK, [ - 'Content-Type' => 'text/plain', + 'Content-Type' => 'text/plain', ] ); $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles()); @@ -1367,7 +1367,7 @@ Array ', Http::STATUS_OK, [ - 'Content-Type' => 'text/plain', + 'Content-Type' => 'text/plain', ] ); $this->assertEquals($expected, $this->checkSetupController->getFailedIntegrityCheckFiles()); diff --git a/apps/sharebymail/lib/Activity.php b/apps/sharebymail/lib/Activity.php index c1c6ac629f9..a588ee3b6ca 100644 --- a/apps/sharebymail/lib/Activity.php +++ b/apps/sharebymail/lib/Activity.php @@ -119,8 +119,8 @@ class Activity implements IProvider { if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_SELF) { $event->setParsedSubject($this->l->t('Shared with %1$s', [ - $parsedParameters['email']['name'], - ])) + $parsedParameters['email']['name'], + ])) ->setRichSubject($this->l->t('Shared with {email}'), [ 'email' => $parsedParameters['email'], ]); @@ -145,8 +145,8 @@ class Activity implements IProvider { } } else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) { $event->setParsedSubject($this->l->t('Unshared from %1$s', [ - $parsedParameters['email']['name'], - ])) + $parsedParameters['email']['name'], + ])) ->setRichSubject($this->l->t('Unshared from {email}'), [ 'email' => $parsedParameters['email'], ]); @@ -207,9 +207,9 @@ class Activity implements IProvider { if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_SELF) { $event->setParsedSubject($this->l->t('You shared %1$s with %2$s by mail', [ - $parsedParameters['file']['path'], - $parsedParameters['email']['name'], - ])) + $parsedParameters['file']['path'], + $parsedParameters['email']['name'], + ])) ->setRichSubject($this->l->t('You shared {file} with {email} by mail'), $parsedParameters); if ($this->activityManager->getRequirePNG()) { $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png'))); @@ -230,9 +230,9 @@ class Activity implements IProvider { } } else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) { $event->setParsedSubject($this->l->t('You unshared %1$s from %2$s by mail', [ - $parsedParameters['file']['path'], - $parsedParameters['email']['name'], - ])) + $parsedParameters['file']['path'], + $parsedParameters['email']['name'], + ])) ->setRichSubject($this->l->t('You unshared {file} from {email} by mail'), $parsedParameters); if ($this->activityManager->getRequirePNG()) { $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.png'))); diff --git a/apps/sharebymail/tests/SettingsTest.php b/apps/sharebymail/tests/SettingsTest.php index 91457dd7153..d3d1eab7655 100644 --- a/apps/sharebymail/tests/SettingsTest.php +++ b/apps/sharebymail/tests/SettingsTest.php @@ -56,13 +56,13 @@ class SettingsTest extends TestCase { ]; $after = [ - 'oc_appconfig' => - json_encode([ - 'key1' => 'value1', - 'key2' => 'value2', - 'shareByMailEnabled' => true - ]), - 'oc_foo' => 'oc_bar' + 'oc_appconfig' => + json_encode([ + 'key1' => 'value1', + 'key2' => 'value2', + 'shareByMailEnabled' => true + ]), + 'oc_foo' => 'oc_bar' ]; $this->instance->announceShareProvider(['array' => &$before]); diff --git a/apps/systemtags/lib/Activity/Provider.php b/apps/systemtags/lib/Activity/Provider.php index fcf37d93d6b..862846a712a 100644 --- a/apps/systemtags/lib/Activity/Provider.php +++ b/apps/systemtags/lib/Activity/Provider.php @@ -116,23 +116,23 @@ class Provider implements IProvider { if ($event->getSubject() === self::ASSIGN_TAG) { if ($parsedParameters['actor']['id'] === '') { $event->setParsedSubject($this->l->t('System tag %1$s added by the system', [ - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('Added system tag {systemtag}'), [ 'systemtag' => $parsedParameters['systemtag'], ]); } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('Added system tag %1$s', [ - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('Added system tag {systemtag}'), [ 'systemtag' => $parsedParameters['systemtag'], ]); } else { $event->setParsedSubject($this->l->t('%1$s added system tag %2$s', [ - $parsedParameters['actor']['name'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['actor']['name'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('{actor} added system tag {systemtag}'), [ 'actor' => $parsedParameters['actor'], 'systemtag' => $parsedParameters['systemtag'], @@ -141,23 +141,23 @@ class Provider implements IProvider { } else if ($event->getSubject() === self::UNASSIGN_TAG) { if ($parsedParameters['actor']['id'] === '') { $event->setParsedSubject($this->l->t('System tag %1$s removed by the system', [ - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('Removed system tag {systemtag}'), [ 'systemtag' => $parsedParameters['systemtag'], ]); } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('Removed system tag %1$s', [ - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('Removed system tag {systemtag}'), [ 'systemtag' => $parsedParameters['systemtag'], ]); } else { $event->setParsedSubject($this->l->t('%1$s removed system tag %2$s', [ - $parsedParameters['actor']['name'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['actor']['name'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('{actor} removed system tag {systemtag}'), [ 'actor' => $parsedParameters['actor'], 'systemtag' => $parsedParameters['systemtag'], @@ -188,86 +188,86 @@ class Provider implements IProvider { if ($event->getSubject() === self::CREATE_TAG) { if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('You created system tag %1$s', [ - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('You created system tag {systemtag}'), $parsedParameters); } else { $event->setParsedSubject($this->l->t('%1$s created system tag %2$s', [ - $parsedParameters['actor']['name'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['actor']['name'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('{actor} created system tag {systemtag}'), $parsedParameters); } } else if ($event->getSubject() === self::DELETE_TAG) { if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('You deleted system tag %1$s', [ - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('You deleted system tag {systemtag}'), $parsedParameters); } else { $event->setParsedSubject($this->l->t('%1$s deleted system tag %2$s', [ - $parsedParameters['actor']['name'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['actor']['name'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('{actor} deleted system tag {systemtag}'), $parsedParameters); } } else if ($event->getSubject() === self::UPDATE_TAG) { if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('You updated system tag %2$s to %1$s', [ - $this->generatePlainSystemTag($parsedParameters['newsystemtag']), - $this->generatePlainSystemTag($parsedParameters['oldsystemtag']), - ])) + $this->generatePlainSystemTag($parsedParameters['newsystemtag']), + $this->generatePlainSystemTag($parsedParameters['oldsystemtag']), + ])) ->setRichSubject($this->l->t('You updated system tag {oldsystemtag} to {newsystemtag}'), $parsedParameters); } else { $event->setParsedSubject($this->l->t('%1$s updated system tag %3$s to %2$s', [ - $parsedParameters['actor']['name'], - $this->generatePlainSystemTag($parsedParameters['newsystemtag']), - $this->generatePlainSystemTag($parsedParameters['oldsystemtag']), - ])) + $parsedParameters['actor']['name'], + $this->generatePlainSystemTag($parsedParameters['newsystemtag']), + $this->generatePlainSystemTag($parsedParameters['oldsystemtag']), + ])) ->setRichSubject($this->l->t('{actor} updated system tag {oldsystemtag} to {newsystemtag}'), $parsedParameters); } } else if ($event->getSubject() === self::ASSIGN_TAG) { if ($parsedParameters['actor']['id'] === '') { unset($parsedParameters['actor']); $event->setParsedSubject($this->l->t('System tag %2$s was added to %1$s by the system', [ - $parsedParameters['file']['path'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['file']['path'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('System tag {systemtag} was added to {file} by the system'), $parsedParameters); } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('You added system tag %2$s to %1$s', [ - $parsedParameters['file']['path'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['file']['path'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('You added system tag {systemtag} to {file}'), $parsedParameters); } else { $event->setParsedSubject($this->l->t('%1$s added system tag %3$s to %2$s', [ - $parsedParameters['actor']['name'], - $parsedParameters['file']['path'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['actor']['name'], + $parsedParameters['file']['path'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('{actor} added system tag {systemtag} to {file}'), $parsedParameters); } } else if ($event->getSubject() === self::UNASSIGN_TAG) { if ($parsedParameters['actor']['id'] === '') { unset($parsedParameters['actor']); $event->setParsedSubject($this->l->t('System tag %2$s was removed from %1$s by the system', [ - $parsedParameters['file']['path'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['file']['path'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('System tag {systemtag} was removed from {file} by the system'), $parsedParameters); } else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) { $event->setParsedSubject($this->l->t('You removed system tag %2$s from %1$s', [ - $parsedParameters['file']['path'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['file']['path'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('You removed system tag {systemtag} from {file}'), $parsedParameters); } else { $event->setParsedSubject($this->l->t('%1$s removed system tag %3$s from %2$s', [ - $parsedParameters['actor']['name'], - $parsedParameters['file']['path'], - $this->generatePlainSystemTag($parsedParameters['systemtag']), - ])) + $parsedParameters['actor']['name'], + $parsedParameters['file']['path'], + $this->generatePlainSystemTag($parsedParameters['systemtag']), + ])) ->setRichSubject($this->l->t('{actor} removed system tag {systemtag} from {file}'), $parsedParameters); } } else { diff --git a/apps/systemtags/tests/Activity/SettingTest.php b/apps/systemtags/tests/Activity/SettingTest.php index 73d75a3d632..170695a0661 100644 --- a/apps/systemtags/tests/Activity/SettingTest.php +++ b/apps/systemtags/tests/Activity/SettingTest.php @@ -61,17 +61,17 @@ class SettingTest extends TestCase { public function testCanChangeStream() { $this->assertSame(true, $this->setting->canChangeStream()); - } - - public function testIsDefaultEnabledStream() { + } + + public function testIsDefaultEnabledStream() { $this->assertSame(true, $this->setting->isDefaultEnabledStream()); - } - - public function testCanChangeMail() { + } + + public function testCanChangeMail() { $this->assertSame(true, $this->setting->canChangeMail()); - } - - public function testIsDefaultEnabledMail() { + } + + public function testIsDefaultEnabledMail() { $this->assertSame(false, $this->setting->isDefaultEnabledMail()); } } diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php index fbdadf697e1..19896be21a2 100644 --- a/apps/theming/tests/ImageManagerTest.php +++ b/apps/theming/tests/ImageManagerTest.php @@ -304,7 +304,7 @@ class ImageManagerTest extends TestCase { $this->createMock(ISimpleFolder::class), $this->createMock(ISimpleFolder::class), $this->createMock(ISimpleFolder::class) - ]; + ]; foreach ($folders as $index=>$folder) { $folder->expects($this->any()) ->method('getName') diff --git a/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php index 2ade2046e75..69df82a43fd 100644 --- a/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/Provider/BackupCodesProviderTest.php @@ -125,13 +125,13 @@ class BackupCodesProviderTest extends TestCase { ->willReturn([ 'twofactor_backupcodes', 'mail', - ]); + ]); $this->appManager->expects($this->once()) ->method('getAppInfo') ->with('mail') ->willReturn([ 'two-factor-providers' => [], - ]); + ]); $this->assertFalse($this->provider->isActive($user)); } @@ -145,7 +145,7 @@ class BackupCodesProviderTest extends TestCase { ->willReturn([ 'twofactor_backupcodes', 'twofactor_u2f', - ]); + ]); $this->appManager->expects($this->once()) ->method('getAppInfo') ->with('twofactor_u2f') @@ -153,7 +153,7 @@ class BackupCodesProviderTest extends TestCase { 'two-factor-providers' => [ 'OCA\TwoFactorU2F\Provider\U2FProvider', ], - ]); + ]); $this->assertTrue($this->provider->isActive($user)); } diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index f696c107a49..2f6c318fa25 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -36,7 +36,7 @@ $prefix = (string)$_POST['ldap_serverconfig_chooser']; // only legacy checkboxes (Advanced and Expert tab) need to be handled here, // the Wizard-like tabs handle it on their own $chkboxes = ['ldap_configuration_active', 'ldap_override_main_server', - 'ldap_turn_off_cert_check']; + 'ldap_turn_off_cert_check']; foreach($chkboxes as $boxid) { if(!isset($_POST[$boxid])) { $_POST[$boxid] = 0; diff --git a/apps/user_ldap/lib/Command/CheckUser.php b/apps/user_ldap/lib/Command/CheckUser.php index 5ec7c15e76a..5b837e47b8e 100644 --- a/apps/user_ldap/lib/Command/CheckUser.php +++ b/apps/user_ldap/lib/Command/CheckUser.php @@ -70,13 +70,13 @@ class CheckUser extends Command { 'ocName', InputArgument::REQUIRED, 'the user name as used in Nextcloud' - ) + ) ->addOption( 'force', null, InputOption::VALUE_NONE, 'ignores disabled LDAP configuration' - ) + ) ->addOption( 'update', null, diff --git a/apps/user_ldap/lib/Command/DeleteConfig.php b/apps/user_ldap/lib/Command/DeleteConfig.php index d53435ce7c5..7739580740f 100644 --- a/apps/user_ldap/lib/Command/DeleteConfig.php +++ b/apps/user_ldap/lib/Command/DeleteConfig.php @@ -52,7 +52,7 @@ class DeleteConfig extends Command { 'configID', InputArgument::REQUIRED, 'the configuration ID' - ) + ) ; } diff --git a/apps/user_ldap/lib/Command/Search.php b/apps/user_ldap/lib/Command/Search.php index c061948fedd..edd4fa71ba0 100644 --- a/apps/user_ldap/lib/Command/Search.php +++ b/apps/user_ldap/lib/Command/Search.php @@ -59,27 +59,27 @@ class Search extends Command { 'search', InputArgument::REQUIRED, 'the search string (can be empty)' - ) + ) ->addOption( 'group', null, InputOption::VALUE_NONE, 'searches groups instead of users' - ) + ) ->addOption( 'offset', null, InputOption::VALUE_REQUIRED, 'The offset of the result set. Needs to be a multiple of limit. defaults to 0.', 0 - ) + ) ->addOption( 'limit', null, InputOption::VALUE_REQUIRED, 'limit the results. 0 means no limit, defaults to 15', 15 - ) + ) ; } diff --git a/apps/user_ldap/lib/Command/SetConfig.php b/apps/user_ldap/lib/Command/SetConfig.php index e74e9e33c18..a1ddf3a591a 100644 --- a/apps/user_ldap/lib/Command/SetConfig.php +++ b/apps/user_ldap/lib/Command/SetConfig.php @@ -45,17 +45,17 @@ class SetConfig extends Command { 'configID', InputArgument::REQUIRED, 'the configuration ID' - ) + ) ->addArgument( 'configKey', InputArgument::REQUIRED, 'the configuration key' - ) + ) ->addArgument( 'configValue', InputArgument::REQUIRED, 'the new configuration value' - ) + ) ; } diff --git a/apps/user_ldap/lib/Command/ShowConfig.php b/apps/user_ldap/lib/Command/ShowConfig.php index 005798c7a05..f4af798d433 100644 --- a/apps/user_ldap/lib/Command/ShowConfig.php +++ b/apps/user_ldap/lib/Command/ShowConfig.php @@ -56,13 +56,13 @@ class ShowConfig extends Command { 'configID', InputArgument::OPTIONAL, 'will show the configuration of the specified id' - ) + ) ->addOption( 'show-password', null, InputOption::VALUE_NONE, 'show ldap bind password' - ) + ) ; } diff --git a/apps/user_ldap/lib/Command/TestConfig.php b/apps/user_ldap/lib/Command/TestConfig.php index 98dd25a1087..abab07d92f1 100644 --- a/apps/user_ldap/lib/Command/TestConfig.php +++ b/apps/user_ldap/lib/Command/TestConfig.php @@ -44,7 +44,7 @@ class TestConfig extends Command { 'configID', InputArgument::REQUIRED, 'the configuration ID' - ) + ) ; } diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index 58afcf96726..14a0e19989a 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -365,7 +365,7 @@ class Connection extends LDAPUtility { } foreach(['ldapExpertUUIDUserAttr' => 'ldapUuidUserAttribute', - 'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute'] + 'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute'] as $expertSetting => $effectiveSetting) { $uuidOverride = $this->configuration->$expertSetting; if(!empty($uuidOverride)) { @@ -394,7 +394,7 @@ class Connection extends LDAPUtility { //make sure empty search attributes are saved as simple, empty array $saKeys = ['ldapAttributesForUserSearch', - 'ldapAttributesForGroupSearch']; + 'ldapAttributesForGroupSearch']; foreach($saKeys as $key) { $val = $this->configuration->$key; if(is_array($val) && count($val) === 1 && empty($val[0])) { @@ -423,7 +423,7 @@ class Connection extends LDAPUtility { //options that shall not be empty $options = ['ldapHost', 'ldapPort', 'ldapUserDisplayName', - 'ldapGroupDisplayName', 'ldapLoginFilter']; + 'ldapGroupDisplayName', 'ldapLoginFilter']; foreach($options as $key) { $val = $this->configuration->$key; if(empty($val)) { diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 11fd0b462d9..a55a285dde3 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -707,8 +707,8 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD // memberof doesn't support memberuid, so skip it here. if((int)$this->access->connection->hasMemberOfFilterSupport === 1 && (int)$this->access->connection->useMemberOfToDetectMembership === 1 - && strtolower($this->access->connection->ldapGroupMemberAssocAttr) !== 'memberuid' - ) { + && strtolower($this->access->connection->ldapGroupMemberAssocAttr) !== 'memberuid' + ) { $groupDNs = $this->_getGroupDNsFromMemberOf($userDN); if (is_array($groupDNs)) { foreach ($groupDNs as $dn) { diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 0547ffcffb6..31bf2531a96 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -65,7 +65,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { $userBackendFound = true; break; } - } + } foreach ($serverContainer->getGroupManager()->getBackends() as $backend){ $this->logger->debug('instance '.get_class($backend).' group backend.', ['app' => 'user_ldap']); if ($backend instanceof IGroupLDAP) { @@ -75,7 +75,7 @@ class LDAPProvider implements ILDAPProvider, IDeletionFlagSupport { } } - if (!$userBackendFound or !$groupBackendFound) { + if (!$userBackendFound or !$groupBackendFound) { throw new \Exception('To use the LDAPProvider, user_ldap app must be enabled'); } } diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index f092f44e041..ccd40621704 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -329,7 +329,7 @@ class User { //check for / at the beginning or pattern c:\ resp. c:/ if( '/' !== $path[0] && !(3 < strlen($path) && ctype_alpha($path[0]) - && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) + && $path[1] === ':' && ('\\' === $path[2] || '/' === $path[2])) ) { $path = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data' ) . '/' . $path; diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 181a58c11bf..71000cf88c5 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -201,10 +201,10 @@ class Wizard extends LDAPUtility { */ public function countUsersWithAttribute($attr, $existsCheck = false) { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - 'ldapUserFilter', - ])) { + 'ldapPort', + 'ldapBase', + 'ldapUserFilter', + ])) { return false; } @@ -226,10 +226,10 @@ class Wizard extends LDAPUtility { */ public function detectUserDisplayNameAttribute() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - 'ldapUserFilter', - ])) { + 'ldapPort', + 'ldapBase', + 'ldapUserFilter', + ])) { return false; } @@ -268,10 +268,10 @@ class Wizard extends LDAPUtility { */ public function detectEmailAttribute() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - 'ldapUserFilter', - ])) { + 'ldapPort', + 'ldapBase', + 'ldapUserFilter', + ])) { return false; } @@ -315,10 +315,10 @@ class Wizard extends LDAPUtility { */ public function determineAttributes() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - 'ldapUserFilter', - ])) { + 'ldapPort', + 'ldapBase', + 'ldapUserFilter', + ])) { return false; } @@ -344,10 +344,10 @@ class Wizard extends LDAPUtility { */ private function getUserAttributes() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - 'ldapUserFilter', - ])) { + 'ldapPort', + 'ldapBase', + 'ldapUserFilter', + ])) { return false; } $cr = $this->getConnection(); @@ -400,9 +400,9 @@ class Wizard extends LDAPUtility { */ private function determineGroups($dbKey, $confKey, $testMemberOf = true) { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - ])) { + 'ldapPort', + 'ldapBase', + ])) { return false; } $cr = $this->getConnection(); @@ -480,9 +480,9 @@ class Wizard extends LDAPUtility { public function determineGroupMemberAssoc() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapGroupFilter', - ])) { + 'ldapPort', + 'ldapGroupFilter', + ])) { return false; } $attribute = $this->detectGroupMemberAssoc(); @@ -502,9 +502,9 @@ class Wizard extends LDAPUtility { */ public function determineGroupObjectClasses() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - ])) { + 'ldapPort', + 'ldapBase', + ])) { return false; } $cr = $this->getConnection(); @@ -529,9 +529,9 @@ class Wizard extends LDAPUtility { */ public function determineUserObjectClasses() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - ])) { + 'ldapPort', + 'ldapBase', + ])) { return false; } $cr = $this->getConnection(); @@ -540,7 +540,7 @@ class Wizard extends LDAPUtility { } $obclasses = ['inetOrgPerson', 'person', 'organizationalPerson', - 'user', 'posixAccount', '*']; + 'user', 'posixAccount', '*']; $filter = $this->configuration->ldapUserFilter; //if filter is empty, it is probably the first time the wizard is called //then, apply suggestions. @@ -559,9 +559,9 @@ class Wizard extends LDAPUtility { */ public function getGroupFilter() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - ])) { + 'ldapPort', + 'ldapBase', + ])) { return false; } //make sure the use display name is set @@ -583,9 +583,9 @@ class Wizard extends LDAPUtility { */ public function getUserListFilter() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - ])) { + 'ldapPort', + 'ldapBase', + ])) { return false; } //make sure the use display name is set @@ -609,10 +609,10 @@ class Wizard extends LDAPUtility { */ public function getUserLoginFilter() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - 'ldapBase', - 'ldapUserFilter', - ])) { + 'ldapPort', + 'ldapBase', + 'ldapUserFilter', + ])) { return false; } @@ -666,7 +666,7 @@ class Wizard extends LDAPUtility { */ public function guessPortAndTLS() { if(!$this->checkRequirements(['ldapHost', - ])) { + ])) { return false; } $this->checkHost(); @@ -719,8 +719,8 @@ class Wizard extends LDAPUtility { */ public function guessBaseDN() { if(!$this->checkRequirements(['ldapHost', - 'ldapPort', - ])) { + 'ldapPort', + ])) { return false; } @@ -1318,13 +1318,13 @@ class Wizard extends LDAPUtility { */ private function getDefaultLdapPortSettings() { static $settings = [ - ['port' => 7636, 'tls' => false], - ['port' => 636, 'tls' => false], - ['port' => 7389, 'tls' => true], - ['port' => 389, 'tls' => true], - ['port' => 7389, 'tls' => false], - ['port' => 389, 'tls' => false], - ]; + ['port' => 7636, 'tls' => false], + ['port' => 636, 'tls' => false], + ['port' => 7389, 'tls' => true], + ['port' => 389, 'tls' => true], + ['port' => 7389, 'tls' => false], + ['port' => 389, 'tls' => false], + ]; return $settings; } @@ -1352,7 +1352,7 @@ class Wizard extends LDAPUtility { //default ports $portSettings = array_merge($portSettings, - $this->getDefaultLdapPortSettings()); + $this->getDefaultLdapPortSettings()); return $portSettings; } diff --git a/apps/user_ldap/tests/ConfigurationTest.php b/apps/user_ldap/tests/ConfigurationTest.php index 45c01e4b0f0..fee92a523c9 100644 --- a/apps/user_ldap/tests/ConfigurationTest.php +++ b/apps/user_ldap/tests/ConfigurationTest.php @@ -53,7 +53,7 @@ class ConfigurationTest extends \Test\TestCase { ' ', '', ' whats my name', - ' ' + ' ' ]; $expectedNames = ['uid', 'cn', 'whats my name']; diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php index 7c62a20165e..385d2c29610 100644 --- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php +++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php @@ -175,8 +175,8 @@ class ExceptionOnLostConnection { curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_HTTPHEADER, [ - 'Content-Type: application/json', - 'Content-Length: ' . strlen($postData)] + 'Content-Type: application/json', + 'Content-Length: ' . strlen($postData)] ); $recvd = curl_exec($ch); $this->checkCurlResult($ch, $recvd); diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php index 71e08654893..4433ed08baa 100644 --- a/apps/user_ldap/tests/LDAPProviderTest.php +++ b/apps/user_ldap/tests/LDAPProviderTest.php @@ -58,8 +58,8 @@ class LDAPProviderTest extends \Test\TestCase { ->setConstructorArgs(['', new \OC\Config(\OC::$configDir)]) ->getMock(); $server->expects($this->at(1)) - ->method('getBackends') - ->willReturn([$userBackend]); + ->method('getBackends') + ->willReturn([$userBackend]); $server->expects($this->any()) ->method('getUserManager') ->willReturn($this->getUserManagerMock($userBackend)); @@ -67,8 +67,8 @@ class LDAPProviderTest extends \Test\TestCase { ->method('getGroupManager') ->willReturn($this->getGroupManagerMock($groupBackend)); $server->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method($this->anything()) + ->willReturnSelf(); return $server; } @@ -135,14 +135,14 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->at(0)) - ->method('userExists') - ->willReturn(true); + ->method('userExists') + ->willReturn(true); $userBackend->expects($this->at(2)) - ->method('username2dn') - ->willReturn('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'); + ->method('username2dn') + ->willReturn('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'); $userBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method($this->anything()) + ->willReturnSelf(); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -207,8 +207,8 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) - ->method('dn2UserName') - ->willReturn('existing_user'); + ->method('dn2UserName') + ->willReturn('existing_user'); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -272,11 +272,11 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) - ->method('userExists') - ->willReturn(true); + ->method('userExists') + ->willReturn(true); $userBackend->expects($this->any()) - ->method('getNewLDAPConnection') - ->willReturn(true); + ->method('getNewLDAPConnection') + ->willReturn(true); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -381,8 +381,8 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->atLeastOnce()) - ->method('userExists') - ->willReturn(true); + ->method('userExists') + ->willReturn(true); $userBackend->expects($this->any()) ->method('getLDAPAccess') ->willReturn($access); @@ -437,8 +437,8 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) - ->method('userExists') - ->willReturn(true); + ->method('userExists') + ->willReturn(true); $userBackend->expects($this->any()) ->method('getLDAPAccess') ->willReturn($access); @@ -472,14 +472,14 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->at(0)) - ->method('userExists') - ->willReturn(true); + ->method('userExists') + ->willReturn(true); $userBackend->expects($this->at(3)) - ->method('clearCache') - ->willReturn(true); + ->method('clearCache') + ->willReturn(true); $userBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method($this->anything()) + ->willReturnSelf(); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -539,8 +539,8 @@ class LDAPProviderTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) - ->method('dn2UserName') - ->willReturn('existing_user'); + ->method('dn2UserName') + ->willReturn('existing_user'); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php index 4a7fbb6bbaf..d3a988a06b7 100644 --- a/apps/user_ldap/tests/WizardTest.php +++ b/apps/user_ldap/tests/WizardTest.php @@ -49,7 +49,7 @@ class WizardTest extends TestCase { //we need to make sure the consts are defined, otherwise tests will fail //on systems without php5_ldap $ldapConsts = ['LDAP_OPT_PROTOCOL_VERSION', - 'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT']; + 'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT']; foreach($ldapConsts as $const) { if(!defined($const)) { define($const, 42); |