]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use the short array syntax, everywhere 20168/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 26 Mar 2020 08:30:18 +0000 (09:30 +0100)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 26 Mar 2020 15:34:56 +0000 (16:34 +0100)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
454 files changed:
apps/accessibility/lib/AccessibilityProvider.php
apps/accessibility/lib/Controller/ConfigController.php
apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
apps/comments/lib/AppInfo/Application.php
apps/dav/appinfo/v1/caldav.php
apps/dav/appinfo/v1/carddav.php
apps/dav/appinfo/v1/publicwebdav.php
apps/dav/lib/CalDAV/CalDavBackend.php
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
apps/dav/lib/CardDAV/CardDavBackend.php
apps/dav/lib/Connector/Sabre/AppEnabledPlugin.php
apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php
apps/dav/lib/Connector/Sabre/Directory.php
apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
apps/dav/lib/Connector/Sabre/File.php
apps/dav/lib/Connector/Sabre/FilesPlugin.php
apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
apps/dav/lib/Connector/Sabre/Node.php
apps/dav/lib/Connector/Sabre/SharesPlugin.php
apps/dav/lib/Connector/Sabre/TagsPlugin.php
apps/dav/lib/Files/BrowserErrorPagePlugin.php
apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
apps/dav/lib/SystemTag/SystemTagPlugin.php
apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
apps/dav/tests/unit/CalDAV/CalendarTest.php
apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
apps/dav/tests/unit/Connector/Sabre/FileTest.php
apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
apps/dav/tests/unit/Connector/Sabre/NodeTest.php
apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php
apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php
apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
apps/dav/tests/unit/DAV/GroupPrincipalTest.php
apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php
apps/encryption/lib/AppInfo/Application.php
apps/encryption/lib/Crypto/EncryptAll.php
apps/encryption/lib/Crypto/Encryption.php
apps/encryption/lib/Recovery.php
apps/encryption/templates/altmail.php
apps/encryption/templates/mail.php
apps/encryption/tests/Crypto/CryptTest.php
apps/encryption/tests/Crypto/EncryptionTest.php
apps/encryption/tests/KeyManagerTest.php
apps/federatedfilesharing/lib/AddressHandler.php
apps/federatedfilesharing/lib/FederatedShareProvider.php
apps/federatedfilesharing/lib/Notifications.php
apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php
apps/federatedfilesharing/tests/AddressHandlerTest.php
apps/files/ajax/download.php
apps/files/ajax/list.php
apps/files/appinfo/app.php
apps/files/lib/AppInfo/Application.php
apps/files/lib/Command/Scan.php
apps/files/lib/Controller/ViewController.php
apps/files/lib/Helper.php
apps/files/lib/Service/TagService.php
apps/files/templates/appnavigation.php
apps/files/tests/HelperTest.php
apps/files/tests/Service/TagServiceTest.php
apps/files_external/ajax/applicable.php
apps/files_external/lib/Controller/AjaxController.php
apps/files_external/lib/Controller/ApiController.php
apps/files_external/lib/Controller/GlobalStoragesController.php
apps/files_external/lib/Controller/UserGlobalStoragesController.php
apps/files_external/lib/Controller/UserStoragesController.php
apps/files_external/lib/Lib/Storage/AmazonS3.php
apps/files_external/lib/Lib/Storage/FTP.php
apps/files_external/lib/Lib/Storage/SFTP.php
apps/files_external/lib/Lib/Storage/SMB.php
apps/files_external/lib/Lib/Storage/Swift.php
apps/files_external/lib/config.php
apps/files_external/tests/Controller/StoragesControllerTest.php
apps/files_external/tests/Controller/UserStoragesControllerTest.php
apps/files_external/tests/OwnCloudFunctionsTest.php
apps/files_external/tests/Service/StoragesServiceTest.php
apps/files_external/tests/Storage/FtpTest.php
apps/files_external/tests/Storage/SmbTest.php
apps/files_external/tests/config.php
apps/files_sharing/lib/Controller/ShareController.php
apps/files_sharing/lib/External/Manager.php
apps/files_sharing/lib/External/Storage.php
apps/files_sharing/lib/ShareBackend/File.php
apps/files_sharing/lib/ShareBackend/Folder.php
apps/files_sharing/lib/SharedStorage.php
apps/files_sharing/public.php
apps/files_sharing/templates/public.php
apps/files_sharing/tests/ApiTest.php
apps/files_sharing/tests/CacheTest.php
apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
apps/files_sharing/tests/Controller/ShareControllerTest.php
apps/files_sharing/tests/External/CacheTest.php
apps/files_sharing/tests/ExternalStorageTest.php
apps/files_sharing/tests/ShareTest.php
apps/files_sharing/tests/SharedMountTest.php
apps/files_sharing/tests/SharedStorageTest.php
apps/files_sharing/tests/WatcherTest.php
apps/files_trashbin/lib/Helper.php
apps/files_trashbin/lib/Trashbin.php
apps/files_trashbin/tests/Command/CleanUpTest.php
apps/files_trashbin/tests/StorageTest.php
apps/files_trashbin/tests/TrashbinTest.php
apps/files_versions/lib/Storage.php
apps/files_versions/tests/Command/CleanupTest.php
apps/files_versions/tests/VersioningTest.php
apps/provisioning_api/lib/AppInfo/Application.php
apps/provisioning_api/tests/Controller/AppsControllerTest.php
apps/provisioning_api/tests/Controller/GroupsControllerTest.php
apps/provisioning_api/tests/TestCase.php
apps/settings/lib/Controller/AdminSettingsController.php
apps/settings/lib/Controller/AppSettingsController.php
apps/settings/lib/Controller/PersonalSettingsController.php
apps/settings/lib/Controller/UsersController.php
apps/settings/lib/Middleware/SubadminMiddleware.php
apps/settings/lib/Settings/Personal/PersonalInfo.php
apps/settings/tests/Controller/CheckSetupControllerTest.php
apps/settings/tests/Middleware/SubadminMiddlewareTest.php
apps/sharebymail/lib/AppInfo/Application.php
apps/sharebymail/lib/ShareByMailProvider.php
apps/testing/lib/AppInfo/Application.php
apps/theming/appinfo/routes.php
apps/theming/lib/Util.php
apps/user_ldap/ajax/clearMappings.php
apps/user_ldap/ajax/deleteConfiguration.php
apps/user_ldap/ajax/getConfiguration.php
apps/user_ldap/ajax/getNewServerConfigPrefix.php
apps/user_ldap/ajax/setConfiguration.php
apps/user_ldap/ajax/testConfiguration.php
apps/user_ldap/ajax/wizard.php
apps/user_ldap/lib/Access.php
apps/user_ldap/lib/Command/ShowConfig.php
apps/user_ldap/lib/Command/TestConfig.php
apps/user_ldap/lib/Configuration.php
apps/user_ldap/lib/Connection.php
apps/user_ldap/lib/GroupPluginManager.php
apps/user_ldap/lib/Group_LDAP.php
apps/user_ldap/lib/Group_Proxy.php
apps/user_ldap/lib/Helper.php
apps/user_ldap/lib/Jobs/Sync.php
apps/user_ldap/lib/Jobs/UpdateGroups.php
apps/user_ldap/lib/LDAP.php
apps/user_ldap/lib/Mapping/AbstractMapping.php
apps/user_ldap/lib/Proxy.php
apps/user_ldap/lib/User/OfflineUser.php
apps/user_ldap/lib/User/User.php
apps/user_ldap/lib/UserPluginManager.php
apps/user_ldap/lib/User_LDAP.php
apps/user_ldap/lib/User_Proxy.php
apps/user_ldap/lib/Wizard.php
apps/user_ldap/lib/WizardResult.php
apps/user_ldap/templates/part.wizard-server.php
apps/user_ldap/tests/AccessTest.php
apps/user_ldap/tests/ConfigurationTest.php
apps/user_ldap/tests/ConnectionTest.php
apps/user_ldap/tests/Group_LDAPTest.php
apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
apps/user_ldap/tests/Jobs/CleanUpTest.php
apps/user_ldap/tests/LDAPProviderTest.php
apps/user_ldap/tests/LDAPTest.php
apps/user_ldap/tests/Mapping/AbstractMappingTest.php
apps/user_ldap/tests/User/UserTest.php
apps/user_ldap/tests/User_LDAPTest.php
apps/user_ldap/tests/WizardTest.php
build/integration/features/bootstrap/CommentsContext.php
build/integration/features/bootstrap/Provisioning.php
build/integration/features/bootstrap/TagsContext.php
config/config.sample.php
core/Command/App/Update.php
core/Command/Encryption/ListModules.php
core/Command/L10n/CreateJs.php
core/Command/Status.php
core/Command/Upgrade.php
core/Command/User/Report.php
core/Controller/LostController.php
core/Controller/OCSController.php
core/Controller/SetupController.php
core/Controller/UserController.php
core/ajax/update.php
core/templates/404.php
core/templates/installation.php
core/templates/update.admin.php
core/templates/update.user.php
cron.php
index.php
lib/autoloader.php
lib/base.php
lib/private/Activity/Manager.php
lib/private/AllConfig.php
lib/private/App/AppManager.php
lib/private/App/DependencyAnalyzer.php
lib/private/App/PlatformRepository.php
lib/private/AppFramework/DependencyInjection/DIContainer.php
lib/private/AppFramework/Http.php
lib/private/Archive/TAR.php
lib/private/Archive/ZIP.php
lib/private/Avatar/Avatar.php
lib/private/BackgroundJob/Legacy/QueuedJob.php
lib/private/Cache/File.php
lib/private/CapabilitiesManager.php
lib/private/Config.php
lib/private/ContactsManager.php
lib/private/DB/Connection.php
lib/private/DB/ConnectionFactory.php
lib/private/DB/MDB2SchemaReader.php
lib/private/DB/Migrator.php
lib/private/DB/OracleConnection.php
lib/private/DB/PgSqlTools.php
lib/private/DB/QueryBuilder/CompositeExpression.php
lib/private/DB/QueryBuilder/QueryBuilder.php
lib/private/DB/SQLiteMigrator.php
lib/private/DB/SQLiteSessionInit.php
lib/private/DateTimeFormatter.php
lib/private/Encryption/DecryptAll.php
lib/private/Encryption/File.php
lib/private/Encryption/Manager.php
lib/private/Encryption/Update.php
lib/private/Encryption/Util.php
lib/private/Files/Cache/HomeCache.php
lib/private/Files/Cache/Scanner.php
lib/private/Files/Cache/Storage.php
lib/private/Files/Cache/Updater.php
lib/private/Files/Cache/Watcher.php
lib/private/Files/Cache/Wrapper/CacheJail.php
lib/private/Files/Cache/Wrapper/CacheWrapper.php
lib/private/Files/Config/MountProviderCollection.php
lib/private/Files/Filesystem.php
lib/private/Files/Mount/MountPoint.php
lib/private/Files/Node/File.php
lib/private/Files/Node/Folder.php
lib/private/Files/Node/LazyRoot.php
lib/private/Files/Node/Node.php
lib/private/Files/Node/Root.php
lib/private/Files/ObjectStore/NoopScanner.php
lib/private/Files/ObjectStore/ObjectStoreStorage.php
lib/private/Files/ObjectStore/S3ConnectionTrait.php
lib/private/Files/Storage/Common.php
lib/private/Files/Storage/DAV.php
lib/private/Files/Storage/Local.php
lib/private/Files/Storage/Temporary.php
lib/private/Files/Storage/Wrapper/Encryption.php
lib/private/Files/Storage/Wrapper/Wrapper.php
lib/private/Files/Stream/Encryption.php
lib/private/Files/Stream/Quota.php
lib/private/Files/Type/Detection.php
lib/private/Files/Type/TemplateManager.php
lib/private/Files/Utils/Scanner.php
lib/private/Files/View.php
lib/private/Group/Backend.php
lib/private/Group/Group.php
lib/private/Group/Manager.php
lib/private/Group/MetaData.php
lib/private/Hooks/EmitterTrait.php
lib/private/Hooks/ForwardingEmitter.php
lib/private/Hooks/LegacyEmitter.php
lib/private/Hooks/PublicEmitter.php
lib/private/L10N/Factory.php
lib/private/LargeFileHelper.php
lib/private/Log/ErrorHandler.php
lib/private/Log/File.php
lib/private/Memcache/ArrayCache.php
lib/private/Memcache/Memcached.php
lib/private/NaturalSort.php
lib/private/NavigationManager.php
lib/private/OCS/Result.php
lib/private/Repair.php
lib/private/Repair/CleanTags.php
lib/private/Repair/Collation.php
lib/private/Repair/RepairMimeTypes.php
lib/private/Route/CachingRouter.php
lib/private/Route/Route.php
lib/private/Search.php
lib/private/Search/Provider/File.php
lib/private/Security/CertificateManager.php
lib/private/Server.php
lib/private/Setup.php
lib/private/Setup/AbstractDatabase.php
lib/private/Setup/OCI.php
lib/private/Setup/Sqlite.php
lib/private/Share/Constants.php
lib/private/Share/Helper.php
lib/private/Share/SearchResultSorter.php
lib/private/Share/Share.php
lib/private/Share20/DefaultShareProvider.php
lib/private/Share20/Manager.php
lib/private/SubAdmin.php
lib/private/TagManager.php
lib/private/Tagging/TagMapper.php
lib/private/Tags.php
lib/private/Template/Base.php
lib/private/Template/CSSResourceLocator.php
lib/private/Template/JSCombiner.php
lib/private/Template/JSConfigHelper.php
lib/private/Template/ResourceLocator.php
lib/private/TemplateLayout.php
lib/private/URLGenerator.php
lib/private/Updater.php
lib/private/User/Backend.php
lib/private/User/Manager.php
lib/private/User/Session.php
lib/private/User/User.php
lib/private/legacy/api.php
lib/private/legacy/app.php
lib/private/legacy/db.php
lib/private/legacy/db/statementwrapper.php
lib/private/legacy/files.php
lib/private/legacy/helper.php
lib/private/legacy/hook.php
lib/private/legacy/image.php
lib/private/legacy/json.php
lib/private/legacy/template.php
lib/private/legacy/template/functions.php
lib/private/legacy/user.php
lib/private/legacy/util.php
lib/public/AppFramework/Controller.php
lib/public/AppFramework/Db/Entity.php
lib/public/AppFramework/Http/DataResponse.php
lib/public/AppFramework/Http/JSONResponse.php
lib/public/AppFramework/Http/Response.php
lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
lib/public/AppFramework/Http/TemplateResponse.php
lib/public/Contacts/IManager.php
lib/public/DB/QueryBuilder/ICompositeExpression.php
lib/public/DB/QueryBuilder/IQueryBuilder.php
lib/public/Files/LockNotAcquiredException.php
lib/public/IDBConnection.php
lib/public/ISearch.php
lib/public/ITagManager.php
lib/public/IURLGenerator.php
lib/public/Route/IRouter.php
lib/public/Search/Provider.php
lib/public/Template.php
lib/public/Util.php
public.php
remote.php
tests/Core/Controller/ClientFlowLoginControllerTest.php
tests/Core/Controller/LostControllerTest.php
tests/Core/Controller/OCSControllerTest.php
tests/acceptance/features/bootstrap/FileListContext.php
tests/acceptance/features/core/ActorContext.php
tests/acceptance/features/core/Locator.php
tests/acceptance/features/core/NextcloudTestServerContext.php
tests/apps.php
tests/docker/mysqlmb4.config.php
tests/lib/AllConfigTest.php
tests/lib/App/AppManagerTest.php
tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
tests/lib/App/DependencyAnalyzerTest.php
tests/lib/App/PlatformRepositoryTest.php
tests/lib/AppFramework/AppTest.php
tests/lib/AppFramework/Controller/ControllerTest.php
tests/lib/AppFramework/Db/EntityTest.php
tests/lib/AppFramework/Db/MapperTest.php
tests/lib/AppFramework/Db/MapperTestUtility.php
tests/lib/AppFramework/Http/DataResponseTest.php
tests/lib/AppFramework/Http/DispatcherTest.php
tests/lib/AppFramework/Http/HttpTest.php
tests/lib/AppFramework/Http/JSONResponseTest.php
tests/lib/AppFramework/Http/RequestStream.php
tests/lib/AppFramework/Http/RequestTest.php
tests/lib/AppFramework/Http/ResponseTest.php
tests/lib/AppFramework/Http/TemplateResponseTest.php
tests/lib/AppFramework/Routing/RoutingTest.php
tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php
tests/lib/AppTest.php
tests/lib/Archive/TestBase.php
tests/lib/BackgroundJob/DummyJobList.php
tests/lib/BackgroundJob/JobListTest.php
tests/lib/Cache/FileCacheTest.php
tests/lib/Collaboration/Collaborators/RemotePluginTest.php
tests/lib/ConfigTest.php
tests/lib/ContactsManagerTest.php
tests/lib/DB/LegacyDBTest.php
tests/lib/DB/MDB2SchemaManagerTest.php
tests/lib/DB/MDB2SchemaReaderTest.php
tests/lib/DB/MigratorTest.php
tests/lib/DateTimeFormatterTest.php
tests/lib/Encryption/Keys/StorageTest.php
tests/lib/Encryption/UpdateTest.php
tests/lib/Encryption/UtilTest.php
tests/lib/ErrorHandlerTest.php
tests/lib/Files/Cache/CacheTest.php
tests/lib/Files/Cache/HomeCacheTest.php
tests/lib/Files/Cache/MoveFromCacheTraitTest.php
tests/lib/Files/Cache/ScannerTest.php
tests/lib/Files/Cache/UpdaterLegacyTest.php
tests/lib/Files/Cache/UpdaterTest.php
tests/lib/Files/Cache/WatcherTest.php
tests/lib/Files/Cache/Wrapper/CacheJailTest.php
tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
tests/lib/Files/EtagTest.php
tests/lib/Files/FilesystemTest.php
tests/lib/Files/Mount/ManagerTest.php
tests/lib/Files/Mount/MountTest.php
tests/lib/Files/Node/FileTest.php
tests/lib/Files/Node/FolderTest.php
tests/lib/Files/Node/IntegrationTest.php
tests/lib/Files/Node/NodeTest.php
tests/lib/Files/Node/RootTest.php
tests/lib/Files/ObjectStore/NoopScannerTest.php
tests/lib/Files/ObjectStore/S3Test.php
tests/lib/Files/Storage/HomeTest.php
tests/lib/Files/Storage/LocalTest.php
tests/lib/Files/Storage/Storage.php
tests/lib/Files/Storage/Wrapper/EncryptionTest.php
tests/lib/Files/Storage/Wrapper/JailTest.php
tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php
tests/lib/Files/Storage/Wrapper/QuotaTest.php
tests/lib/Files/Storage/Wrapper/WrapperTest.php
tests/lib/Files/Stream/EncryptionTest.php
tests/lib/Files/Utils/ScannerTest.php
tests/lib/Group/Backend.php
tests/lib/Group/DatabaseTest.php
tests/lib/Group/GroupTest.php
tests/lib/Group/ManagerTest.php
tests/lib/HelperStorageTest.php
tests/lib/HookHelper.php
tests/lib/Hooks/BasicEmitterTest.php
tests/lib/Hooks/ForwardingEmitterTest.php
tests/lib/Hooks/LegacyEmitterTest.php
tests/lib/ImageTest.php
tests/lib/IntegrityCheck/CheckerTest.php
tests/lib/L10N/L10nTest.php
tests/lib/LegacyHelperTest.php
tests/lib/LoggerTest.php
tests/lib/Mail/MessageTest.php
tests/lib/NaturalSortTest.php
tests/lib/Repair/RepairSqliteAutoincrementTest.php
tests/lib/RepairStepTest.php
tests/lib/Security/CertificateManagerTest.php
tests/lib/Security/CryptoTest.php
tests/lib/Security/SecureRandomTest.php
tests/lib/Share/Backend.php
tests/lib/Share/HelperTest.php
tests/lib/Share/SearchResultSorterTest.php
tests/lib/Share/ShareTest.php
tests/lib/TagsTest.php
tests/lib/TempManagerTest.php
tests/lib/Template/CSSResourceLocatorTest.php
tests/lib/Template/IconsCacherTest.php
tests/lib/Template/JSResourceLocatorTest.php
tests/lib/Template/ResourceLocatorTest.php
tests/lib/Template/SCSSCacherTest.php
tests/lib/TestCase.php
tests/lib/Traits/EncryptionTrait.php
tests/lib/User/ManagerTest.php
tests/lib/User/SessionTest.php
tests/lib/Util/Group/Dummy.php
tests/lib/Util/User/Dummy.php
tests/lib/UtilCheckServerTest.php
tests/lib/UtilTest.php
tests/preseed-config.php
version.php

index ce9489df5f263de9eaa9db31f09209e0c3de0004..c922c7e28508500667f8fbbfe2f50d51973b15bd 100644 (file)
@@ -57,7 +57,7 @@ class AccessibilityProvider {
        }
 
        public function getThemes() {
-               return array(
+               return [
                        [
                                'id'    => 'dark',
                                'img'   => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'),
@@ -65,7 +65,7 @@ class AccessibilityProvider {
                                'enableLabel' => $this->l->t('Enable dark theme'),
                                'text'  => $this->l->t('A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find.')
                        ]
-               );
+               ];
        }
 
        public function getHighContrast() {
@@ -79,7 +79,7 @@ class AccessibilityProvider {
        }
 
        public function getFonts() {
-               return array(
+               return [
                        [
                                'id'    => 'fontdyslexic',
                                'img'   => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'),
@@ -87,7 +87,7 @@ class AccessibilityProvider {
                                'enableLabel' => $this->l->t('Enable dyslexia font'),
                                'text'  => $this->l->t('OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia.')
                        ]
-               );
+               ];
        }
 
 }
index a84281501cad59b67d38c99a33829a20042c78ca..d089feda3001db95e58313d90b07181ec21b84e3 100644 (file)
@@ -113,7 +113,7 @@ class ConfigController extends OCSController {
                        }
 
                        $themes = $this->accessibilityProvider->getThemes();
-                       $highcontrast = array($this->accessibilityProvider->getHighContrast());
+                       $highcontrast = [$this->accessibilityProvider->getHighContrast()];
                        $fonts  = $this->accessibilityProvider->getFonts();
 
                        $availableOptions = array_map(function($option) {
index c31ff10e1d733401ce19121321b6fa7c7d2664d0..db5f48adf239a89a4ce516216084149763d86d88 100644 (file)
@@ -290,7 +290,7 @@ class RequestHandlerController extends Controller {
                \OCP\Util::emitHook(
                        '\OCA\Files_Sharing\API\Server2Server',
                        'preLoginNameUsedAsUserName',
-                       array('uid' => &$uid)
+                       ['uid' => &$uid]
                );
                $this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]);
 
index bd883071adce3bb5046068a685e5b4c52a3b66b9..9a9df25edfdad7ea1c1c5d7402e26d3669bbdad4 100644 (file)
@@ -44,7 +44,7 @@ class Application extends App {
 
        const APP_ID = 'comments';
 
-       public function __construct (array $urlParams = array()) {
+       public function __construct (array $urlParams = []) {
                parent::__construct(self::APP_ID, $urlParams);
                $container = $this->getContainer();
 
index 529fa576b4ad0474ccd79e63b7f32cf102beebbd..82fddd152e64927649763a9497cedbde14df10b6 100644 (file)
@@ -69,10 +69,10 @@ $principalCollection->disableListing = !$debugging; // Disable listing
 $addressBookRoot = new CalendarRoot($principalBackend, $calDavBackend);
 $addressBookRoot->disableListing = !$debugging; // Disable listing
 
-$nodes = array(
+$nodes = [
        $principalCollection,
        $addressBookRoot,
-);
+];
 
 // Fire up server
 $server = new \Sabre\DAV\Server($nodes);
index b8886c0d15268bc4d676facd591103017f91f221..b2e812c2c184ae53e8ebfeabb89c7fda94ec1253 100644 (file)
@@ -69,10 +69,10 @@ $pluginManager = new PluginManager(\OC::$server, \OC::$server->query(IAppManager
 $addressBookRoot = new AddressBookRoot($principalBackend, $cardDavBackend, $pluginManager);
 $addressBookRoot->disableListing = !$debugging; // Disable listing
 
-$nodes = array(
+$nodes = [
        $principalCollection,
        $addressBookRoot,
-);
+];
 
 // Fire up server
 $server = new \Sabre\DAV\Server($nodes);
index f0e3cc6438dd416edf277cd06044f2dc9002e5d1..53f1b0d62b4580f12b312be79d584057cbe4adcb 100644 (file)
@@ -79,7 +79,7 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct
        // FIXME: should not add storage wrappers outside of preSetup, need to find a better way
        $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
        \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
-               return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
+               return new \OC\Files\Storage\Wrapper\PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]);
        });
 
        \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
index 96459566a5a10fa971bf723d0326b40aa6631a52..7280288c02d56cb2f51ffc014ebc0f24d0defec4 100644 (file)
@@ -1944,7 +1944,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
                        }
                }
 
-               $valuesToInsert = array();
+               $valuesToInsert = [];
 
                $query = $this->db->getQueryBuilder();
 
index 982c579d3bb96d6561302be23be1d86127071e86..3b66e84fc2bcba090b4a89c1a9a11912c9840b2b 100644 (file)
@@ -237,13 +237,13 @@ class IMipPlugin extends SabreIMipPlugin {
                                break;
                }
 
-               $data = array(
+               $data = [
                        'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
                        'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
                        'meeting_title' => (string)$meetingTitle ?: $defaultVal,
                        'meeting_description' => (string)$meetingDescription ?: $defaultVal,
                        'meeting_url' => (string)$meetingUrl ?: $defaultVal,
-               );
+               ];
 
                $fromEMail = \OCP\Util::getDefaultEmailAddress('invitations-noreply');
                $fromName = $l10n->t('%1$s via %2$s', [$senderName, $this->defaults->getName()]);
index 24b91f7cec365b796363b33d929cf65f5f29d3c0..bd89b233aeedd95455d477a11b4612e3102a840c 100644 (file)
@@ -74,9 +74,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
        private $sharingBackend;
 
        /** @var array properties to index */
-       public static $indexProperties = array(
+       public static $indexProperties = [
                        'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
-                       'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
+                       'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD'];
 
        /**
         * @var string[] Map of uid => display name
@@ -909,7 +909,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
         *      - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
         * @return array an array of contacts which are arrays of key-value-pairs
         */
-       public function search($addressBookId, $pattern, $searchProperties, $options = array()) {
+       public function search($addressBookId, $pattern, $searchProperties, $options = []) {
                $query = $this->db->getQueryBuilder();
                $query2 = $this->db->getQueryBuilder();
 
index 139044f9535af75c0aeab5e09f786c0823c0c802..947b2960eab5059f0599d17370afb365e2a4777d 100644 (file)
@@ -74,7 +74,7 @@ class AppEnabledPlugin extends ServerPlugin {
        public function initialize(\Sabre\DAV\Server $server) {
 
                $this->server = $server;
-               $this->server->on('beforeMethod', array($this, 'checkAppEnabled'), 30);
+               $this->server->on('beforeMethod', [$this, 'checkAppEnabled'], 30);
        }
 
        /**
index 1a069e548b4e16aa2edfa05ede896922242e218c..22f0104940df85d571a9a7a1bc6387393c3c5e52 100644 (file)
@@ -67,7 +67,7 @@ class CommentPropertiesPlugin extends ServerPlugin {
         */
        function initialize(\Sabre\DAV\Server $server) {
                $this->server = $server;
-               $this->server->on('propFind', array($this, 'handleGetProperties'));
+               $this->server->on('propFind', [$this, 'handleGetProperties']);
        }
 
        /**
index d17cfb8177731dc504353e59118d93810bbf65f6..9b44997fb601f79d83fcf0695cc0da5165f604d4 100644 (file)
@@ -267,7 +267,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
                        throw new Locked();
                }
 
-               $nodes = array();
+               $nodes = [];
                foreach ($folderContent as $info) {
                        $node = $this->getChild($info->getName(), $info);
                        $nodes[] = $node;
@@ -336,13 +336,13 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
                        } else {
                                $free = $storageInfo['free'];
                        }
-                       $this->quotaInfo = array(
+                       $this->quotaInfo = [
                                $storageInfo['used'],
                                $free
-                       );
+                       ];
                        return $this->quotaInfo;
                } catch (\OCP\Files\StorageNotAvailableException $e) {
-                       return array(0, 0);
+                       return [0, 0];
                }
        }
 
index dc595197965a3e53dc637475fdb857c7f9778d1c..cf617152eb84d6bb674ffdfd5bfa46edc38d64ca 100644 (file)
@@ -103,7 +103,7 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin {
         */
        public function initialize(\Sabre\DAV\Server $server) {
 
-               $server->on('exception', array($this, 'logException'), 10);
+               $server->on('exception', [$this, 'logException'], 10);
        }
 
        /**
index 098961ce1309c49a80c2d68ca935f9a51fc18180..0bd01de408b2c93dc0de566fa8f0aeee0656af67 100644 (file)
@@ -359,20 +359,20 @@ class File extends Node implements IFile {
                $run = true;
 
                if (!$exists) {
-                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, array(
+                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, [
                                \OC\Files\Filesystem::signal_param_path => $hookPath,
                                \OC\Files\Filesystem::signal_param_run => &$run,
-                       ));
+                       ]);
                } else {
-                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, array(
+                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, [
                                \OC\Files\Filesystem::signal_param_path => $hookPath,
                                \OC\Files\Filesystem::signal_param_run => &$run,
-                       ));
+                       ]);
                }
-               \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, array(
+               \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, [
                        \OC\Files\Filesystem::signal_param_path => $hookPath,
                        \OC\Files\Filesystem::signal_param_run => &$run,
-               ));
+               ]);
                return $run;
        }
 
@@ -385,17 +385,17 @@ class File extends Node implements IFile {
                }
                $hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path));
                if (!$exists) {
-                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, array(
+                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, [
                                \OC\Files\Filesystem::signal_param_path => $hookPath
-                       ));
+                       ]);
                } else {
-                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, array(
+                       \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, [
                                \OC\Files\Filesystem::signal_param_path => $hookPath
-                       ));
+                       ]);
                }
-               \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, array(
+               \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, [
                        \OC\Files\Filesystem::signal_param_path => $hookPath
-               ));
+               ]);
        }
 
        /**
index 498058f7c037580f8129ef746436dd9f300d5610..a35db1e77e4525f8330d3763f1d901156803c37c 100644 (file)
@@ -173,12 +173,12 @@ class FilesPlugin extends ServerPlugin {
                $server->protectedProperties = array_diff($server->protectedProperties, $allowedProperties);
 
                $this->server = $server;
-               $this->server->on('propFind', array($this, 'handleGetProperties'));
-               $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
-               $this->server->on('afterBind', array($this, 'sendFileIdHeader'));
-               $this->server->on('afterWriteContent', array($this, 'sendFileIdHeader'));
+               $this->server->on('propFind', [$this, 'handleGetProperties']);
+               $this->server->on('propPatch', [$this, 'handleUpdateProperties']);
+               $this->server->on('afterBind', [$this, 'sendFileIdHeader']);
+               $this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']);
                $this->server->on('afterMethod:GET', [$this,'httpGet']);
-               $this->server->on('afterMethod:GET', array($this, 'handleDownloadToken'));
+               $this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']);
                $this->server->on('afterResponse', function($request, ResponseInterface $response) {
                        $body = $response->getBody();
                        if (is_resource($body)) {
index 41de6ea4ed8f8e4045c37f9aeffb0d1c862c85fe..a2de82fa9c54105527b9beffca333c19530f36c1 100644 (file)
@@ -154,7 +154,7 @@ class FilesReportPlugin extends ServerPlugin {
                $server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
 
                $this->server = $server;
-               $this->server->on('report', array($this, 'onReport'));
+               $this->server->on('report', [$this, 'onReport']);
        }
 
        /**
index d015bcbc21cdc6cde972d4d7c6a3c2a093554644..4076abe59feb379ceb82e523fc2d4221e0beb527 100644 (file)
@@ -67,7 +67,7 @@ class MaintenancePlugin extends ServerPlugin {
         */
        public function initialize(\Sabre\DAV\Server $server) {
                $this->server = $server;
-               $this->server->on('beforeMethod', array($this, 'checkMaintenanceMode'), 1);
+               $this->server->on('beforeMethod', [$this, 'checkMaintenanceMode'], 1);
        }
 
        /**
index f178b2fbfbdfe7742682550100537e69a5b89859..5f9ecf8814259e0ba2be8146cf8cf4b74d24a543 100644 (file)
@@ -200,15 +200,15 @@ abstract class Node implements \Sabre\DAV\INode {
         * @return int file id of updated file or -1 on failure
         */
        public function setETag($etag) {
-               return $this->fileView->putFileInfo($this->path, array('etag' => $etag));
+               return $this->fileView->putFileInfo($this->path, ['etag' => $etag]);
        }
 
        public function setCreationTime(int $time) {
-               return $this->fileView->putFileInfo($this->path, array('creation_time' => $time));
+               return $this->fileView->putFileInfo($this->path, ['creation_time' => $time]);
        }
 
        public function setUploadTime(int $time) {
-               return $this->fileView->putFileInfo($this->path, array('upload_time' => $time));
+               return $this->fileView->putFileInfo($this->path, ['upload_time' => $time]);
        }
 
        /**
index a4baa65948e1b6b6681f6d6e8085d32d9e4ca1d9..9d543e55a4b655195893d688f052617122394920 100644 (file)
@@ -107,7 +107,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin {
                $server->protectedProperties[] = self::SHAREES_PROPERTYNAME;
 
                $this->server = $server;
-               $this->server->on('propFind', array($this, 'handleGetProperties'));
+               $this->server->on('propFind', [$this, 'handleGetProperties']);
        }
 
        private function getShare(\OCP\Files\Node $node): array {
index fe19b434648e86e5fd2bd3d00a01c902b120f8ac..2ac7c01f4267859bb5f258a75cfbe6789cb2455e 100644 (file)
@@ -98,7 +98,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
                $this->tree = $tree;
                $this->tagManager = $tagManager;
                $this->tagger = null;
-               $this->cachedTags = array();
+               $this->cachedTags = [];
        }
 
        /**
@@ -118,8 +118,8 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
                $server->xml->elementMap[self::TAGS_PROPERTYNAME] = TagList::class;
 
                $this->server = $server;
-               $this->server->on('propFind', array($this, 'handleGetProperties'));
-               $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
+               $this->server->on('propFind', [$this, 'handleGetProperties']);
+               $this->server->on('propPatch', [$this, 'handleUpdateProperties']);
        }
 
        /**
@@ -151,7 +151,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
                                unset($tags[$favPos]);
                        }
                }
-               return array($tags, $isFav);
+               return [$tags, $isFav];
        }
 
        /**
@@ -164,10 +164,10 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
                if (isset($this->cachedTags[$fileId])) {
                        return $this->cachedTags[$fileId];
                } else {
-                       $tags = $this->getTagger()->getTagsForObjects(array($fileId));
+                       $tags = $this->getTagger()->getTagsForObjects([$fileId]);
                        if ($tags !== false) {
                                if (empty($tags)) {
-                                       return array();
+                                       return [];
                                }
                                return current($tags);
                        }
@@ -232,7 +232,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin
                        $tags = $this->getTagger()->getTagsForObjects($fileIds);
                        if ($tags === false) {
                                // the tags API returns false on error...
-                               $tags = array();
+                               $tags = [];
                        }
 
                        $this->cachedTags = $this->cachedTags + $tags;
index 9bc169601afdf8fc3b1d15a7ea014a281bf6046e..7b0d39f2fbbd527342bc835a9bc1f06a1a1ce934 100644 (file)
@@ -48,7 +48,7 @@ class BrowserErrorPagePlugin extends ServerPlugin {
         */
        function initialize(Server $server) {
                $this->server = $server;
-               $server->on('exception', array($this, 'logException'), 1000);
+               $server->on('exception', [$this, 'logException'], 1000);
        }
 
        /**
index b940fa55b5b8d58b635181a6ec17669c707a7f75..f580b7fe47acb3d06d9a3a559dd6b568af24530f 100644 (file)
@@ -88,7 +88,7 @@ class RemoveOrphanEventsAndContacts implements IRepairStep {
 
                $result = $qb->execute();
 
-               $orphanItems = array();
+               $orphanItems = [];
                while ($row = $result->fetch()) {
                        $orphanItems[] = (int) $row['id'];
                }
index c86f621a67d8a33168096b667f27fd4bfe49d4cc..d44b21b24c9772bb78d75c12dcd238ea91cda172 100644 (file)
@@ -107,8 +107,8 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
 
                $server->protectedProperties[] = self::ID_PROPERTYNAME;
 
-               $server->on('propFind', array($this, 'handleGetProperties'));
-               $server->on('propPatch', array($this, 'handleUpdateProperties'));
+               $server->on('propFind', [$this, 'handleGetProperties']);
+               $server->on('propPatch', [$this, 'handleUpdateProperties']);
                $server->on('method:POST', [$this, 'httpPost']);
 
                $this->server = $server;
index 257c6665dfefad5ab02c15f22464dc50255ad63d..cc942b5662c5066c92d4eb63f3f4024439ba6ecd 100644 (file)
@@ -130,7 +130,7 @@ class CalDavBackendTest extends AbstractCalDavBackend {
                $l10n
                        ->expects($this->any())
                        ->method('t')
-                       ->willReturnCallback(function ($text, $parameters = array()) {
+                       ->willReturnCallback(function ($text, $parameters = []) {
                                return vsprintf($text, $parameters);
                        });
 
index 9a9f36c930922069a548900dd6233ec0a4f484e1..42cbeb1c0b971e0336a3cde810a22bee47ed6db9 100644 (file)
@@ -53,7 +53,7 @@ class CalendarTest extends TestCase {
                $this->l10n
                        ->expects($this->any())
                        ->method('t')
-                       ->willReturnCallback(function ($text, $parameters = array()) {
+                       ->willReturnCallback(function ($text, $parameters = []) {
                                return vsprintf($text, $parameters);
                        });
        }
index 5cd4e69b7f5ae90f4fa983e450230d012ec40b90..518c0b9402a89250d7dc23edff2d41be4e3fbd20 100644 (file)
@@ -97,9 +97,9 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
                        ' WHERE `userid` = ?'
                );
                $deleteStatement->execute(
-                       array(
+                       [
                                $this->user->getUID(),
-                       )
+                       ]
                );
                $deleteStatement->closeCursor();
        }
@@ -121,10 +121,10 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
 
        private function applyDefaultProps($path = '/dummypath') {
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
+               $propPatch = new \Sabre\DAV\PropPatch([
                        'customprop' => 'value1',
                        'customprop2' => 'value2',
-               ));
+               ]);
 
                $this->plugin->propPatch(
                        $path,
@@ -146,11 +146,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
        public function testPropFindMissingFileSoftFail() {
                $propFind = new \Sabre\DAV\PropFind(
                        '/dummypath',
-                       array(
+                       [
                                'customprop',
                                'customprop2',
                                'unsetprop',
-                       ),
+                       ],
                        0
                );
 
@@ -176,11 +176,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
 
                $propFind = new \Sabre\DAV\PropFind(
                        '/dummypath',
-                       array(
+                       [
                                'customprop',
                                'customprop2',
                                'unsetprop',
-                       ),
+                       ],
                        0
                );
 
@@ -191,7 +191,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
 
                $this->assertEquals('value1', $propFind->get('customprop'));
                $this->assertEquals('value2', $propFind->get('customprop2'));
-               $this->assertEquals(array('unsetprop'), $propFind->get404Properties());
+               $this->assertEquals(['unsetprop'], $propFind->get404Properties());
        }
 
        /**
@@ -201,11 +201,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
                $this->applyDefaultProps('/dummypath');
                $this->applyDefaultProps('/dummypath/test.txt');
 
-               $propNames = array(
+               $propNames = [
                        'customprop',
                        'customprop2',
                        'unsetprop',
-               );
+               ];
 
                $propFindRoot = new \Sabre\DAV\PropFind(
                        '/dummypath',
@@ -234,11 +234,11 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
 
                $this->assertEquals('value1', $propFindRoot->get('customprop'));
                $this->assertEquals('value2', $propFindRoot->get('customprop2'));
-               $this->assertEquals(array('unsetprop'), $propFindRoot->get404Properties());
+               $this->assertEquals(['unsetprop'], $propFindRoot->get404Properties());
 
                $this->assertEquals('value1', $propFindSub->get('customprop'));
                $this->assertEquals('value2', $propFindSub->get('customprop2'));
-               $this->assertEquals(array('unsetprop'), $propFindSub->get404Properties());
+               $this->assertEquals(['unsetprop'], $propFindSub->get404Properties());
        }
 
        /**
@@ -247,9 +247,9 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
        public function testDeleteProperty() {
                $this->applyDefaultProps();
 
-               $propPatch = new \Sabre\DAV\PropPatch(array(
+               $propPatch = new \Sabre\DAV\PropPatch([
                        'customprop' => null,
-               ));
+               ]);
 
                $this->plugin->propPatch(
                        '/dummypath',
index 1bf0b533966529d55de39fbae4121a35e0277d5f..9ace061fd0ede13f498ad23c43245aafd36f8d35 100644 (file)
@@ -201,7 +201,7 @@ class DirectoryTest extends \Test\TestCase {
                $this->view->expects($this->once())
                        ->method('getDirectoryContent')
                        ->with('')
-                       ->willReturn(array($info1, $info2));
+                       ->willReturn([$info1, $info2]);
 
                $this->view->expects($this->any())
                        ->method('getRelativePath')
index 96f5a2c385c95151c31fb9046402214bfed3c474..a898ba5dee7c23128cb68e539a732c834f8e349f 100644 (file)
@@ -202,9 +202,9 @@ class FileTest extends TestCase {
                        ->method('getRelativePath')
                        ->willReturnArgument(0);
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -631,10 +631,10 @@ class FileTest extends TestCase {
        }
 
        public static function cancellingHook($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_post_create,
                        'params' => $params
-               );
+               ];
        }
 
        /**
@@ -683,9 +683,9 @@ class FileTest extends TestCase {
                $_SERVER['CONTENT_LENGTH'] = 123456;
                $_SERVER['REQUEST_METHOD'] = 'PUT';
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -716,9 +716,9 @@ class FileTest extends TestCase {
                // simulate situation where the target file is locked
                $view->lockFile('/test.txt', ILockingProvider::LOCK_EXCLUSIVE);
 
-               $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -790,9 +790,9 @@ class FileTest extends TestCase {
                        ->method('getRelativePath')
                        ->willReturnArgument(0);
 
-               $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
                // action
@@ -829,9 +829,9 @@ class FileTest extends TestCase {
                        ->method('getRelativePath')
                        ->willReturnArgument(0);
 
-               $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
                $file->setName('/super*star.txt');
        }
@@ -856,9 +856,9 @@ class FileTest extends TestCase {
                $_SERVER['CONTENT_LENGTH'] = 12345;
                $_SERVER['REQUEST_METHOD'] = 'PUT';
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -890,9 +890,9 @@ class FileTest extends TestCase {
                        ->method('unlink')
                        ->willReturn(true);
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -908,9 +908,9 @@ class FileTest extends TestCase {
                $view = $this->getMockBuilder(View::class)
                        ->getMock();
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => 0
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -931,9 +931,9 @@ class FileTest extends TestCase {
                        ->method('unlink')
                        ->willReturn(false);
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -954,9 +954,9 @@ class FileTest extends TestCase {
                        ->method('unlink')
                        ->willThrowException(new ForbiddenException('', true));
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -1122,9 +1122,9 @@ class FileTest extends TestCase {
                        ->method('fopen')
                        ->willReturn(false);
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
@@ -1142,9 +1142,9 @@ class FileTest extends TestCase {
                        ->method('fopen')
                        ->willThrowException(new ForbiddenException('', true));
 
-               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+               $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
                        'permissions' => \OCP\Constants::PERMISSION_ALL
-               ), null);
+               ], null);
 
                $file = new \OCA\DAV\Connector\Sabre\File($view, $info);
 
index d1e863b18bac48ac33521f31ea2b8e0a3e8ea2dc..06495ccd5e2a3c0cda1e91c74196ddbc8bb6721d 100644 (file)
@@ -181,7 +181,7 @@ class FilesPluginTest extends TestCase {
 
                $propFind = new PropFind(
                        '/dummyPath',
-                       array(
+                       [
                                self::GETETAG_PROPERTYNAME,
                                self::FILEID_PROPERTYNAME,
                                self::INTERNAL_FILEID_PROPERTYNAME,
@@ -191,7 +191,7 @@ class FilesPluginTest extends TestCase {
                                self::OWNER_ID_PROPERTYNAME,
                                self::OWNER_DISPLAY_NAME_PROPERTYNAME,
                                self::DATA_FINGERPRINT_PROPERTYNAME,
-                       ),
+                       ],
                        0
                );
 
@@ -208,7 +208,7 @@ class FilesPluginTest extends TestCase {
 
                $node->expects($this->once())
                        ->method('getDirectDownload')
-                       ->willReturn(array('url' => 'http://example.com/'));
+                       ->willReturn(['url' => 'http://example.com/']);
                $node->expects($this->exactly(2))
                        ->method('getOwner')
                        ->willReturn($user);
@@ -236,9 +236,9 @@ class FilesPluginTest extends TestCase {
 
                $propFind = new PropFind(
                        '/dummyPath',
-                       array(
+                       [
                                self::DOWNLOADURL_PROPERTYNAME,
-                       ),
+                       ],
                        0
                );
 
@@ -293,14 +293,14 @@ class FilesPluginTest extends TestCase {
 
                $propFind = new PropFind(
                        '/dummyPath',
-                       array(
+                       [
                                self::GETETAG_PROPERTYNAME,
                                self::FILEID_PROPERTYNAME,
                                self::SIZE_PROPERTYNAME,
                                self::PERMISSIONS_PROPERTYNAME,
                                self::DOWNLOADURL_PROPERTYNAME,
                                self::DATA_FINGERPRINT_PROPERTYNAME,
-                       ),
+                       ],
                        0
                );
 
@@ -405,10 +405,10 @@ class FilesPluginTest extends TestCase {
                        ->willReturn(true);
 
                // properties to set
-               $propPatch = new PropPatch(array(
+               $propPatch = new PropPatch([
                        self::GETETAG_PROPERTYNAME => 'newetag',
                        self::LASTMODIFIED_PROPERTYNAME => $testDate
-               ));
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/dummypath',
@@ -425,14 +425,14 @@ class FilesPluginTest extends TestCase {
        }
 
        public function testUpdatePropsForbidden() {
-               $propPatch = new PropPatch(array(
+               $propPatch = new PropPatch([
                        self::OWNER_ID_PROPERTYNAME => 'user2',
                        self::OWNER_DISPLAY_NAME_PROPERTYNAME => 'User Two',
                        self::FILEID_PROPERTYNAME => 12345,
                        self::PERMISSIONS_PROPERTYNAME => 'C',
                        self::SIZE_PROPERTYNAME => 123,
                        self::DOWNLOADURL_PROPERTYNAME => 'http://example.com/',
-               ));
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/dummypath',
@@ -588,9 +588,9 @@ class FilesPluginTest extends TestCase {
 
                $propFind = new PropFind(
                        '/dummyPath',
-                       array(
+                       [
                                self::HAS_PREVIEW_PROPERTYNAME
-                       ),
+                       ],
                        0
                );
 
index 5d71a705362f6ad676d49e03a8ad922038aa1c1e..93542f803686a038e204208fc2511df9e42f55be 100644 (file)
@@ -42,19 +42,19 @@ use OCP\Share\IShare;
  */
 class NodeTest extends \Test\TestCase {
        public function davPermissionsProvider() {
-               return array(
-                       array(\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RGDNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RGDNVCK'),
-                       array(\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRGDNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMGDNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SGDNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RGD'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RGNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RGDNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'file', false, false, 'RDNVW'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RGDNV'),
-                       array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'dir', false, false, 'RDNVCK'),
-               );
+               return [
+                       [\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RGDNVW'],
+                       [\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RGDNVCK'],
+                       [\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRGDNVW'],
+                       [\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMGDNVW'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SGDNVW'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RGD'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RGNVW'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RGDNVW'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'file', false, false, 'RDNVW'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RGDNV'],
+                       [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'dir', false, false, 'RDNVCK'],
+               ];
        }
 
        /**
@@ -63,7 +63,7 @@ class NodeTest extends \Test\TestCase {
        public function testDavPermissions($permissions, $type, $shared, $mounted, $expected) {
                $info = $this->getMockBuilder(FileInfo::class)
                        ->disableOriginalConstructor()
-                       ->setMethods(array('getPermissions', 'isShared', 'isMounted', 'getType'))
+                       ->setMethods(['getPermissions', 'isShared', 'isMounted', 'getType'])
                        ->getMock();
                $info->expects($this->any())
                        ->method('getPermissions')
index 76ebbe301893bc2bec254efb2eb8921b8c73a2cb..3a2c8d8c438fcb512dfafd34fb2cbf5af7ffa879 100644 (file)
@@ -201,72 +201,72 @@ class ObjectTreeTest extends \Test\TestCase {
        }
 
        function nodeForPathProvider() {
-               return array(
+               return [
                        // regular file
-                       array(
+                       [
                                'regularfile.txt',
                                'regularfile.txt',
                                'regularfile.txt',
                                'file',
                                false
-                       ),
+                       ],
                        // regular directory
-                       array(
+                       [
                                'regulardir',
                                'regulardir',
                                'regulardir',
                                'dir',
                                false
-                       ),
+                       ],
                        // regular file with chunking
-                       array(
+                       [
                                'regularfile.txt',
                                'regularfile.txt',
                                'regularfile.txt',
                                'file',
                                true
-                       ),
+                       ],
                        // regular directory with chunking
-                       array(
+                       [
                                'regulardir',
                                'regulardir',
                                'regulardir',
                                'dir',
                                true
-                       ),
+                       ],
                        // file with chunky file name
-                       array(
+                       [
                                'regularfile.txt-chunking-123566789-10-1',
                                'regularfile.txt',
                                'regularfile.txt',
                                'file',
                                true
-                       ),
+                       ],
                        // regular file in subdir
-                       array(
+                       [
                                'subdir/regularfile.txt',
                                'subdir/regularfile.txt',
                                'regularfile.txt',
                                'file',
                                false
-                       ),
+                       ],
                        // regular directory in subdir
-                       array(
+                       [
                                'subdir/regulardir',
                                'subdir/regulardir',
                                'regulardir',
                                'dir',
                                false
-                       ),
+                       ],
                        // file with chunky file name in subdir
-                       array(
+                       [
                                'subdir/regularfile.txt-chunking-123566789-10-1',
                                'subdir/regularfile.txt',
                                'regularfile.txt',
                                'file',
                                true
-                       ),
-               );
+                       ],
+               ];
        }
 
        
index 57613c19f64667fcd0fb14485dfefceb8887c6e6..55528a0f87f19671672ffb263f9d460a84494465 100644 (file)
@@ -410,7 +410,7 @@ class PrincipalTest extends TestCase {
        }
 
        public function testUpdatePrincipal() {
-               $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch(array())));
+               $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch([])));
        }
 
        public function testSearchPrincipalsWithEmptySearchProperties() {
index 50b3ff1c394dfd00efa0361ed8999b0b877210ca..d7554741fc07628c3c547fe41911c867d5cc6828 100644 (file)
@@ -112,30 +112,30 @@ class QuotaPluginTest extends TestCase {
        }
 
        public function quotaOkayProvider() {
-               return array(
-                       array(1024, array()),
-                       array(1024, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(1024, array('CONTENT-LENGTH' => '512')),
-                       array(1024, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-
-                       array(FileInfo::SPACE_UNKNOWN, array()),
-                       array(FileInfo::SPACE_UNKNOWN, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(FileInfo::SPACE_UNKNOWN, array('CONTENT-LENGTH' => '512')),
-                       array(FileInfo::SPACE_UNKNOWN, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-
-                       array(FileInfo::SPACE_UNLIMITED, array()),
-                       array(FileInfo::SPACE_UNLIMITED, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(FileInfo::SPACE_UNLIMITED, array('CONTENT-LENGTH' => '512')),
-                       array(FileInfo::SPACE_UNLIMITED, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-               );
+               return [
+                       [1024, []],
+                       [1024, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [1024, ['CONTENT-LENGTH' => '512']],
+                       [1024, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+
+                       [FileInfo::SPACE_UNKNOWN, []],
+                       [FileInfo::SPACE_UNKNOWN, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [FileInfo::SPACE_UNKNOWN, ['CONTENT-LENGTH' => '512']],
+                       [FileInfo::SPACE_UNKNOWN, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+
+                       [FileInfo::SPACE_UNLIMITED, []],
+                       [FileInfo::SPACE_UNLIMITED, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [FileInfo::SPACE_UNLIMITED, ['CONTENT-LENGTH' => '512']],
+                       [FileInfo::SPACE_UNLIMITED, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+               ];
        }
 
        public function quotaExceededProvider() {
-               return array(
-                       array(1023, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(511, array('CONTENT-LENGTH' => '512')),
-                       array(2047, array('OC-TOTAL-LENGTH' => '2048', 'CONTENT-LENGTH' => '1024')),
-               );
+               return [
+                       [1023, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [511, ['CONTENT-LENGTH' => '512']],
+                       [2047, ['OC-TOTAL-LENGTH' => '2048', 'CONTENT-LENGTH' => '1024']],
+               ];
        }
 
        public function lengthProvider() {
@@ -155,22 +155,22 @@ class QuotaPluginTest extends TestCase {
        }
 
        public function quotaChunkedOkProvider() {
-               return array(
-                       array(1024, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(1024, 0, array('CONTENT-LENGTH' => '512')),
-                       array(1024, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
+               return [
+                       [1024, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [1024, 0, ['CONTENT-LENGTH' => '512']],
+                       [1024, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
                        // with existing chunks (allowed size = total length - chunk total size)
-                       array(400, 128, array('X-EXPECTED-ENTITY-LENGTH' => '512')),
-                       array(400, 128, array('CONTENT-LENGTH' => '512')),
-                       array(400, 128, array('OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500')),
+                       [400, 128, ['X-EXPECTED-ENTITY-LENGTH' => '512']],
+                       [400, 128, ['CONTENT-LENGTH' => '512']],
+                       [400, 128, ['OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500']],
                        // \OCP\Files\FileInfo::SPACE-UNKNOWN = -2
-                       array(-2, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(-2, 0, array('CONTENT-LENGTH' => '512')),
-                       array(-2, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-                       array(-2, 128, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(-2, 128, array('CONTENT-LENGTH' => '512')),
-                       array(-2, 128, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-               );
+                       [-2, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [-2, 0, ['CONTENT-LENGTH' => '512']],
+                       [-2, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+                       [-2, 128, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [-2, 128, ['CONTENT-LENGTH' => '512']],
+                       [-2, 128, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+               ];
        }
 
        /**
@@ -197,15 +197,15 @@ class QuotaPluginTest extends TestCase {
        }
 
        public function quotaChunkedFailProvider() {
-               return array(
-                       array(400, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
-                       array(400, 0, array('CONTENT-LENGTH' => '512')),
-                       array(400, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
+               return [
+                       [400, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+                       [400, 0, ['CONTENT-LENGTH' => '512']],
+                       [400, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
                        // with existing chunks (allowed size = total length - chunk total size)
-                       array(380, 128, array('X-EXPECTED-ENTITY-LENGTH' => '512')),
-                       array(380, 128, array('CONTENT-LENGTH' => '512')),
-                       array(380, 128, array('OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500')),
-               );
+                       [380, 128, ['X-EXPECTED-ENTITY-LENGTH' => '512']],
+                       [380, 128, ['CONTENT-LENGTH' => '512']],
+                       [380, 128, ['OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500']],
+               ];
        }
 
        /**
index c1eaaae42c3bacdc28ec76c6caf0ff6b2a1030fd..c0450d3bbb65326bd9c0b457e022d30780b679ff 100644 (file)
@@ -108,8 +108,8 @@ class TagsPluginTest extends \Test\TestCase {
 
                $this->tagger->expects($this->exactly($expectedCallCount))
                        ->method('getTagsForObjects')
-                       ->with($this->equalTo(array(123)))
-                       ->willReturn(array(123 => $tags));
+                       ->with($this->equalTo([123]))
+                       ->willReturn([123 => $tags]);
 
                $propFind = new \Sabre\DAV\PropFind(
                        '/dummyPath',
@@ -162,16 +162,16 @@ class TagsPluginTest extends \Test\TestCase {
                        ->willReturn(123);
                $node->expects($this->exactly($expectedCallCount))
                        ->method('getChildren')
-                       ->willReturn(array($node1, $node2));
+                       ->willReturn([$node1, $node2]);
 
                $this->tagger->expects($this->exactly($expectedCallCount))
                        ->method('getTagsForObjects')
-                       ->with($this->equalTo(array(123, 111, 222)))
+                       ->with($this->equalTo([123, 111, 222]))
                        ->willReturn(
-                               array(
+                               [
                                        111 => $tags,
                                        123 => $tags
-                               )
+                               ]
                        );
 
                // simulate sabre recursive PROPFIND traversal
@@ -212,58 +212,58 @@ class TagsPluginTest extends \Test\TestCase {
        }
 
        function tagsGetPropertiesDataProvider() {
-               return array(
+               return [
                        // request both, receive both
-                       array(
-                               array('tag1', 'tag2', self::TAG_FAVORITE),
-                               array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME),
-                               array(
-                                       200 => array(
-                                               self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')),
+                       [
+                               ['tag1', 'tag2', self::TAG_FAVORITE],
+                               [self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME],
+                               [
+                                       200 => [
+                                               self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2']),
                                                self::FAVORITE_PROPERTYNAME => true,
-                                       )
-                               )
-                       ),
+                                       ]
+                               ]
+                       ],
                        // request tags alone
-                       array(
-                               array('tag1', 'tag2', self::TAG_FAVORITE),
-                               array(self::TAGS_PROPERTYNAME),
-                               array(
-                                       200 => array(
-                                               self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')),
-                                       )
-                               )
-                       ),
+                       [
+                               ['tag1', 'tag2', self::TAG_FAVORITE],
+                               [self::TAGS_PROPERTYNAME],
+                               [
+                                       200 => [
+                                               self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2']),
+                                       ]
+                               ]
+                       ],
                        // request fav alone
-                       array(
-                               array('tag1', 'tag2', self::TAG_FAVORITE),
-                               array(self::FAVORITE_PROPERTYNAME),
-                               array(
-                                       200 => array(
+                       [
+                               ['tag1', 'tag2', self::TAG_FAVORITE],
+                               [self::FAVORITE_PROPERTYNAME],
+                               [
+                                       200 => [
                                                self::FAVORITE_PROPERTYNAME => true,
-                                       )
-                               )
-                       ),
+                                       ]
+                               ]
+                       ],
                        // request none
-                       array(
-                               array('tag1', 'tag2', self::TAG_FAVORITE),
-                               array(),
-                               array(
-                                       200 => array()
-                               ),
-                       ),
+                       [
+                               ['tag1', 'tag2', self::TAG_FAVORITE],
+                               [],
+                               [
+                                       200 => []
+                               ],
+                       ],
                        // request both with none set, receive both
-                       array(
-                               array(),
-                               array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME),
-                               array(
-                                       200 => array(
-                                               self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array()),
+                       [
+                               [],
+                               [self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME],
+                               [
+                                       200 => [
+                                               self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList([]),
                                                self::FAVORITE_PROPERTYNAME => false,
-                                       )
-                               )
-                       ),
-               );
+                                       ]
+                               ]
+                       ],
+               ];
        }
 
        public function testUpdateTags() {
@@ -283,8 +283,8 @@ class TagsPluginTest extends \Test\TestCase {
 
                $this->tagger->expects($this->at(0))
                        ->method('getTagsForObjects')
-                       ->with($this->equalTo(array(123)))
-                       ->willReturn(array(123 => array('tagkeep', 'tagremove', self::TAG_FAVORITE)));
+                       ->with($this->equalTo([123]))
+                       ->willReturn([123 => ['tagkeep', 'tagremove', self::TAG_FAVORITE]]);
 
                // then tag as tag1 and tag2
                $this->tagger->expects($this->at(1))
@@ -300,9 +300,9 @@ class TagsPluginTest extends \Test\TestCase {
                        ->with(123, 'tagremove');
 
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
-                       self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep'))
-               ));
+               $propPatch = new \Sabre\DAV\PropPatch([
+                       self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2', 'tagkeep'])
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/dummypath',
@@ -334,8 +334,8 @@ class TagsPluginTest extends \Test\TestCase {
 
                $this->tagger->expects($this->at(0))
                        ->method('getTagsForObjects')
-                       ->with($this->equalTo(array(123)))
-                       ->willReturn(array());
+                       ->with($this->equalTo([123]))
+                       ->willReturn([]);
 
                // then tag as tag1 and tag2
                $this->tagger->expects($this->at(1))
@@ -346,9 +346,9 @@ class TagsPluginTest extends \Test\TestCase {
                        ->with(123, 'tag2');
 
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
-                       self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep'))
-               ));
+               $propPatch = new \Sabre\DAV\PropPatch([
+                       self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2', 'tagkeep'])
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/dummypath',
@@ -386,9 +386,9 @@ class TagsPluginTest extends \Test\TestCase {
                        ->with(123, self::TAG_FAVORITE);
 
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
+               $propPatch = new \Sabre\DAV\PropPatch([
                        self::FAVORITE_PROPERTYNAME => true
-               ));
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/dummypath',
@@ -411,9 +411,9 @@ class TagsPluginTest extends \Test\TestCase {
                        ->with(123, self::TAG_FAVORITE);
 
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
+               $propPatch = new \Sabre\DAV\PropPatch([
                        self::FAVORITE_PROPERTYNAME => false
-               ));
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/dummypath',
index 08239dfd46aca25b38ca1f41b83eff5d93133390..6a78c2a0862dee7da2d2f7330f5755f8deefeace 100644 (file)
@@ -184,7 +184,7 @@ class GroupPrincipalTest extends \Test\TestCase {
        }
 
        public function testUpdatePrincipal() {
-               $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch(array())));
+               $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch([])));
        }
 
        public function testSearchPrincipalsWithEmptySearchProperties() {
index f634c717093014a1a4dc5614b0a2de4fc412c035..ecd65e7587c0dc65213fc5d7b755b99ae23a4782 100644 (file)
@@ -308,12 +308,12 @@ class SystemTagPluginTest extends \Test\TestCase {
                        ->with($systemTag, ['group1', 'group2']);
 
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
+               $propPatch = new \Sabre\DAV\PropPatch([
                        self::DISPLAYNAME_PROPERTYNAME => 'Test changed',
                        self::USERVISIBLE_PROPERTYNAME => 'false',
                        self::USERASSIGNABLE_PROPERTYNAME => 'true',
                        self::GROUPS_PROPERTYNAME => 'group1|group2',
-               ));
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/systemtag/1',
@@ -364,9 +364,9 @@ class SystemTagPluginTest extends \Test\TestCase {
                        ->method('setTagGroups');
 
                // properties to set
-               $propPatch = new \Sabre\DAV\PropPatch(array(
+               $propPatch = new \Sabre\DAV\PropPatch([
                        self::GROUPS_PROPERTYNAME => 'group1|group2',
-               ));
+               ]);
 
                $this->plugin->handleUpdateProperties(
                        '/systemtag/1',
index 6d7c00687e3033591ae7675bb8f513ceb76977bf..745dfe59aa710bc8f970dd5a9485c5e6aa7f1a28 100644 (file)
@@ -58,7 +58,7 @@ class Application extends \OCP\AppFramework\App {
        /**
         * @param array $urlParams
         */
-       public function __construct($urlParams = array()) {
+       public function __construct($urlParams = []) {
                parent::__construct('encryption', $urlParams);
                $this->encryptionManager = \OC::$server->getEncryptionManager();
                $this->config = \OC::$server->getConfig();
index 4865f06277ef0745265c7a8513288f6085cc643e..1820140337c8bd91b5762f582dca23d76495d55c 100644 (file)
@@ -120,7 +120,7 @@ class EncryptAll {
                $this->questionHelper = $questionHelper;
                $this->secureRandom = $secureRandom;
                // store one time passwords for the users
-               $this->userPasswords = array();
+               $this->userPasswords = [];
        }
 
        /**
@@ -265,7 +265,7 @@ class EncryptAll {
        protected function encryptUsersFiles($uid, ProgressBar $progress, $userCount) {
 
                $this->setupUserFS($uid);
-               $directories = array();
+               $directories = [];
                $directories[] =  '/' . $uid . '/files';
 
                while($root = array_pop($directories)) {
@@ -322,11 +322,11 @@ class EncryptAll {
         */
        protected function outputPasswords() {
                $table = new Table($this->output);
-               $table->setHeaders(array('Username', 'Private key password'));
+               $table->setHeaders(['Username', 'Private key password']);
 
                //create rows
-               $newPasswords = array();
-               $unchangedPasswords = array();
+               $newPasswords = [];
+               $unchangedPasswords = [];
                foreach ($this->userPasswords as $uid => $password) {
                        if (empty($password)) {
                                $unchangedPasswords[] = $uid;
@@ -451,7 +451,7 @@ class EncryptAll {
                        $this->output->writeln("\n\nPassword successfully send to all users");
                } else {
                        $table = new Table($this->output);
-                       $table->setHeaders(array('Username', 'Private key password'));
+                       $table->setHeaders(['Username', 'Private key password']);
                        $this->output->writeln("\n\nCould not send password to following users:\n");
                        $rows = [];
                        foreach ($noMail as $uid) {
index 8b5ec5e1e0596257cd625be2de41f26e851153f8..edeb04ce8572b345d46202886c4c028b49eb6607 100644 (file)
@@ -236,7 +236,7 @@ class Encryption implements IEncryptionModule {
                        $this->cipher = $this->crypt->getLegacyCipher();
                }
 
-               return array('cipher' => $this->cipher, 'signed' => 'true');
+               return ['cipher' => $this->cipher, 'signed' => 'true'];
        }
 
        /**
@@ -266,7 +266,7 @@ class Encryption implements IEncryptionModule {
                                $result = $this->crypt->symmetricEncryptFileContent($this->writeCache, $this->fileKey, $this->version + 1, $position);
                                $this->writeCache = '';
                        }
-                       $publicKeys = array();
+                       $publicKeys = [];
                        if ($this->useMasterPassword === true) {
                                $publicKeys[$this->keyManager->getMasterKeyId()] = $this->keyManager->getPublicMasterKey();
                        } else {
@@ -402,7 +402,7 @@ class Encryption implements IEncryptionModule {
 
                if (!empty($fileKey)) {
 
-                       $publicKeys = array();
+                       $publicKeys = [];
                        if ($this->useMasterPassword === true) {
                                $publicKeys[$this->keyManager->getMasterKeyId()] = $this->keyManager->getPublicMasterKey();
                        } else {
@@ -425,7 +425,7 @@ class Encryption implements IEncryptionModule {
 
                } else {
                        $this->logger->debug('no file key found, we assume that the file "{file}" is not encrypted',
-                               array('file' => $path, 'app' => 'encryption'));
+                               ['file' => $path, 'app' => 'encryption']);
 
                        return false;
                }
index d586d330237ee1ff033c7d6e80469fe2f08daef2..335e6c13d7371b1c37905aa6782e8c79423e1173 100644 (file)
@@ -213,7 +213,7 @@ class Recovery {
                                $fileKey = $this->keyManager->getFileKey($filePath, $this->user->getUID());
                                if (!empty($fileKey)) {
                                        $accessList = $this->file->getAccessList($filePath);
-                                       $publicKeys = array();
+                                       $publicKeys = [];
                                        foreach ($accessList['users'] as $uid) {
                                                $publicKeys[$uid] = $this->keyManager->getPublicKey($uid);
                                        }
@@ -299,7 +299,7 @@ class Recovery {
 
                if (!empty($fileKey)) {
                        $accessList = $this->file->getAccessList($path);
-                       $publicKeys = array();
+                       $publicKeys = [];
                        foreach ($accessList['users'] as $user) {
                                $publicKeys[$user] = $this->keyManager->getPublicKey($user);
                        }
index a5b1512aadacc25a5f61afdf61baa797ed2a99c1..dde85e0af14c4a32bede47cc83e37e9f143c4ddd 100644 (file)
@@ -2,9 +2,9 @@
 /** @var OC_Theme $theme */
 /** @var array $_ */
 
-print_unescaped($l->t("Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n", array($_['password'])));
+print_unescaped($l->t("Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n", [$_['password']]));
 if ( isset($_['expiration']) ) {
-       print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
+       print_unescaped($l->t("The share will expire on %s.", [$_['expiration']]));
        print_unescaped("\n\n");
 }
 // TRANSLATORS term at the end of a mail
index 6e9f9885d33e339661d64d2dee07da6d143a7c87..1241cfd9f6219d30c9cd15cdef9462ffc574a084 100644 (file)
@@ -15,7 +15,7 @@
                                        <td width="20px">&nbsp;</td>
                                        <td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
                                                <?php
-                                               print_unescaped($l->t('Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section "basic encryption module" of your personal settings and update your encryption password by entering this password into the "old log-in password" field and your current login-password.<br><br>', array($_['password'])));
+                                               print_unescaped($l->t('Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section "basic encryption module" of your personal settings and update your encryption password by entering this password into the "old log-in password" field and your current login-password.<br><br>', [$_['password']]));
                                                // TRANSLATORS term at the end of a mail
                                                p($l->t('Cheers!'));
                                                ?>
index 7428b3fe1afb70cad2324254bd029c5fa2c7d1cd..31b61ee066442ec917979534979dcc6eab06caa0 100644 (file)
@@ -80,7 +80,7 @@ class CryptTest extends TestCase {
                $this->config->expects($this->once())
                        ->method('getSystemValue')
                        ->with($this->equalTo('openssl'), $this->equalTo([]))
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $result = self::invokePrivate($this->crypt, 'getOpenSSLConfig');
                $this->assertSame(1, count($result));
@@ -96,7 +96,7 @@ class CryptTest extends TestCase {
                $this->config->expects($this->once())
                        ->method('getSystemValue')
                        ->with($this->equalTo('openssl'), $this->equalTo([]))
-                       ->willReturn(array('foo' => 'bar', 'private_key_bits' => 1028));
+                       ->willReturn(['foo' => 'bar', 'private_key_bits' => 1028]);
 
                $result = self::invokePrivate($this->crypt, 'getOpenSSLConfig');
                $this->assertSame(2, count($result));
@@ -185,14 +185,14 @@ class CryptTest extends TestCase {
         * @return array
         */
        public function dataProviderGetCipher() {
-               return array(
-                       array('AES-128-CFB', 'AES-128-CFB'),
-                       array('AES-256-CFB', 'AES-256-CFB'),
-                       array('AES-128-CTR', 'AES-128-CTR'),
-                       array('AES-256-CTR', 'AES-256-CTR'),
+               return [
+                       ['AES-128-CFB', 'AES-128-CFB'],
+                       ['AES-256-CFB', 'AES-256-CFB'],
+                       ['AES-128-CTR', 'AES-128-CTR'],
+                       ['AES-256-CTR', 'AES-256-CTR'],
 
-                       array('unknown', 'AES-256-CTR')
-               );
+                       ['unknown', 'AES-256-CTR']
+               ];
        }
 
        /**
@@ -203,7 +203,7 @@ class CryptTest extends TestCase {
                $result = self::invokePrivate(
                        $this->crypt,
                        'concatIV',
-                       array('content', 'my_iv'));
+                       ['content', 'my_iv']);
 
                $this->assertSame('content00iv00my_iv',
                        $result
@@ -214,7 +214,7 @@ class CryptTest extends TestCase {
         * @dataProvider dataTestSplitMetaData
         */
        public function testSplitMetaData($data, $expected) {
-               $result = self::invokePrivate($this->crypt, 'splitMetaData', array($data, 'AES-256-CFB'));
+               $result = self::invokePrivate($this->crypt, 'splitMetaData', [$data, 'AES-256-CFB']);
                $this->assertTrue(is_array($result));
                $this->assertSame(3, count($result));
                $this->assertArrayHasKey('encrypted', $result);
@@ -239,7 +239,7 @@ class CryptTest extends TestCase {
         */
        public function testHasSignature($data, $expected) {
                $this->assertSame($expected,
-                       $this->invokePrivate($this->crypt, 'hasSignature', array($data, 'AES-256-CFB'))
+                       $this->invokePrivate($this->crypt, 'hasSignature', [$data, 'AES-256-CFB'])
                );
        }
 
@@ -257,7 +257,7 @@ class CryptTest extends TestCase {
                $this->expectException(\OCP\Encryption\Exceptions\GenericEncryptionException::class);
 
                $data = 'encryptedContent00iv001234567890123456xx';
-               $this->invokePrivate($this->crypt, 'hasSignature', array($data, $cipher));
+               $this->invokePrivate($this->crypt, 'hasSignature', [$data, $cipher]);
        }
 
        public function dataTestHasSignatureFail() {
@@ -273,7 +273,7 @@ class CryptTest extends TestCase {
         * test addPadding()
         */
        public function testAddPadding() {
-               $result = self::invokePrivate($this->crypt, 'addPadding', array('data'));
+               $result = self::invokePrivate($this->crypt, 'addPadding', ['data']);
                $this->assertSame('dataxxx', $result);
        }
 
@@ -285,7 +285,7 @@ class CryptTest extends TestCase {
         * @param $expected
         */
        public function testRemovePadding($data, $expected) {
-               $result = self::invokePrivate($this->crypt, 'removePadding', array($data));
+               $result = self::invokePrivate($this->crypt, 'removePadding', [$data]);
                $this->assertSame($expected, $result);
        }
 
@@ -295,10 +295,10 @@ class CryptTest extends TestCase {
         * @return array
         */
        public function dataProviderRemovePadding()  {
-               return array(
-                       array('dataxx', 'data'),
-                       array('data', false)
-               );
+               return [
+                       ['dataxx', 'data'],
+                       ['data', false]
+               ];
        }
 
        /**
@@ -307,7 +307,7 @@ class CryptTest extends TestCase {
        public function testParseHeader() {
 
                $header= 'HBEGIN:foo:bar:cipher:AES-256-CFB:HEND';
-               $result = self::invokePrivate($this->crypt, 'parseHeader', array($header));
+               $result = self::invokePrivate($this->crypt, 'parseHeader', [$header]);
 
                $this->assertTrue(is_array($result));
                $this->assertSame(2, count($result));
@@ -331,15 +331,15 @@ class CryptTest extends TestCase {
                $this->assertTrue(is_string($iv));
                $this->assertSame(16, strlen($iv));
 
-               $result = self::invokePrivate($this->crypt, 'encrypt', array($decrypted, $iv, $password));
+               $result = self::invokePrivate($this->crypt, 'encrypt', [$decrypted, $iv, $password]);
 
                $this->assertTrue(is_string($result));
 
-               return array(
+               return [
                        'password' => $password,
                        'iv' => $iv,
                        'encrypted' => $result,
-                       'decrypted' => $decrypted);
+                       'decrypted' => $decrypted];
 
        }
 
@@ -353,7 +353,7 @@ class CryptTest extends TestCase {
                $result = self::invokePrivate(
                        $this->crypt,
                        'decrypt',
-                       array($data['encrypted'], $data['iv'], $data['password']));
+                       [$data['encrypted'], $data['iv'], $data['password']]);
 
                $this->assertSame($data['decrypted'], $result);
 
index 9a541880e7909d4201f14ecc97a639a6d9087687..cebb27580e2e2fe2f0e89f0fbc87d0a50582a67a 100644 (file)
@@ -124,7 +124,7 @@ class EncryptionTest extends TestCase {
         * test if public key from one of the recipients is missing
         */
        public function testEndUser1() {
-               $this->instance->begin('/foo/bar', 'user1', 'r', array(), array('users' => array('user1', 'user2', 'user3')));
+               $this->instance->begin('/foo/bar', 'user1', 'r', [], ['users' => ['user1', 'user2', 'user3']]);
                $this->endTest();
        }
 
@@ -135,7 +135,7 @@ class EncryptionTest extends TestCase {
        public function testEndUser2() {
                $this->expectException(\OCA\Encryption\Exceptions\PublicKeyMissingException::class);
 
-               $this->instance->begin('/foo/bar', 'user2', 'r', array(), array('users' => array('user1', 'user2', 'user3')));
+               $this->instance->begin('/foo/bar', 'user2', 'r', [], ['users' => ['user1', 'user2', 'user3']]);
                $this->endTest();
        }
 
@@ -182,17 +182,17 @@ class EncryptionTest extends TestCase {
         */
        public function testGetPathToRealFile($path, $expected) {
                $this->assertSame($expected,
-                       self::invokePrivate($this->instance, 'getPathToRealFile', array($path))
+                       self::invokePrivate($this->instance, 'getPathToRealFile', [$path])
                );
        }
 
        public function dataProviderForTestGetPathToRealFile() {
-               return array(
-                       array('/user/files/foo/bar.txt', '/user/files/foo/bar.txt'),
-                       array('/user/files/foo.txt', '/user/files/foo.txt'),
-                       array('/user/files_versions/foo.txt.v543534', '/user/files/foo.txt'),
-                       array('/user/files_versions/foo/bar.txt.v5454', '/user/files/foo/bar.txt'),
-               );
+               return [
+                       ['/user/files/foo/bar.txt', '/user/files/foo/bar.txt'],
+                       ['/user/files/foo.txt', '/user/files/foo.txt'],
+                       ['/user/files_versions/foo.txt.v543534', '/user/files/foo.txt'],
+                       ['/user/files_versions/foo/bar.txt.v5454', '/user/files/foo/bar.txt'],
+               ];
        }
 
        /**
@@ -241,12 +241,12 @@ class EncryptionTest extends TestCase {
        }
 
        public function dataTestBegin() {
-               return array(
-                       array('w', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'defaultCipher'),
-                       array('r', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'myCipher'),
-                       array('w', [], 'legacyCipher', 'defaultCipher', '', 'defaultCipher'),
-                       array('r', [], 'legacyCipher', 'defaultCipher', 'file_key', 'legacyCipher'),
-               );
+               return [
+                       ['w', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'defaultCipher'],
+                       ['r', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'myCipher'],
+                       ['w', [], 'legacyCipher', 'defaultCipher', '', 'defaultCipher'],
+                       ['r', [], 'legacyCipher', 'defaultCipher', 'file_key', 'legacyCipher'],
+               ];
        }
 
 
@@ -335,10 +335,10 @@ class EncryptionTest extends TestCase {
        }
 
        public function dataTestUpdate() {
-               return array(
-                       array('', false),
-                       array('fileKey', true)
-               );
+               return [
+                       ['', false],
+                       ['fileKey', true]
+               ];
        }
 
        public function testUpdateNoUsers() {
@@ -417,19 +417,19 @@ class EncryptionTest extends TestCase {
        }
 
        public function dataTestShouldEncrypt() {
-               return array(
-                       array('/user1/files/foo.txt', true, true, true),
-                       array('/user1/files_versions/foo.txt', true, true, true),
-                       array('/user1/files_trashbin/foo.txt', true, true, true),
-                       array('/user1/some_folder/foo.txt', true, true, false),
-                       array('/user1/foo.txt', true, true, false),
-                       array('/user1/files', true, true, false),
-                       array('/user1/files_trashbin', true, true, false),
-                       array('/user1/files_versions', true, true, false),
+               return [
+                       ['/user1/files/foo.txt', true, true, true],
+                       ['/user1/files_versions/foo.txt', true, true, true],
+                       ['/user1/files_trashbin/foo.txt', true, true, true],
+                       ['/user1/some_folder/foo.txt', true, true, false],
+                       ['/user1/foo.txt', true, true, false],
+                       ['/user1/files', true, true, false],
+                       ['/user1/files_trashbin', true, true, false],
+                       ['/user1/files_versions', true, true, false],
                        // test if shouldEncryptHomeStorage is set to false
-                       array('/user1/files/foo.txt', false, true, false),
-                       array('/user1/files_versions/foo.txt', false, false, true),
-               );
+                       ['/user1/files/foo.txt', false, true, false],
+                       ['/user1/files_versions/foo.txt', false, false, true],
+               ];
        }
 
        
index a9886a0b9ec40492b7a678f1c1bd462bf2f238fa..c7b9d62690e311fb7dd11cefbd6b0fb2f015eece 100644 (file)
@@ -322,7 +322,7 @@ class KeyManagerTest extends TestCase {
 
                $this->assertTrue(
                        $this->instance->setRecoveryKey('pass',
-                               array('publicKey' => 'publicKey', 'privateKey' => 'privateKey'))
+                               ['publicKey' => 'publicKey', 'privateKey' => 'privateKey'])
                );
        }
 
@@ -505,12 +505,12 @@ class KeyManagerTest extends TestCase {
         * @return array
         */
        public function dataTestAddSystemKeys() {
-               return array(
-                       array(['public' => true],[], 'user1', ['publicShareKey', 'recoveryKey']),
-                       array(['public' => false], [], 'user1', ['recoveryKey']),
-                       array(['public' => true],[], 'user2', ['publicShareKey']),
-                       array(['public' => false], [], 'user2', []),
-               );
+               return [
+                       [['public' => true],[], 'user1', ['publicShareKey', 'recoveryKey']],
+                       [['public' => false], [], 'user1', ['recoveryKey']],
+                       [['public' => true],[], 'user2', ['publicShareKey']],
+                       [['public' => false], [], 'user2', []],
+               ];
        }
 
        public function testGetMasterKeyId() {
index 7a272781fe684ab818a019211dd19a22f27b5294..113978bab82eb0c689a369cabe7172803fd092db 100644 (file)
@@ -106,12 +106,12 @@ class AddressHandler {
                        \OCP\Util::emitHook(
                                '\OCA\Files_Sharing\API\Server2Server',
                                'preLoginNameUsedAsUserName',
-                               array('uid' => &$user1)
+                               ['uid' => &$user1]
                        );
                        \OCP\Util::emitHook(
                                '\OCA\Files_Sharing\API\Server2Server',
                                'preLoginNameUsedAsUserName',
-                               array('uid' => &$user2)
+                               ['uid' => &$user2]
                        );
 
                        if ($user1 === $user2) {
index 575e3cdff5702a29cc9d9fb666942b6c176229f6..5d44643899aefcdfaf4e50f202e0fd414751019a 100644 (file)
@@ -187,7 +187,7 @@ class FederatedShareProvider implements IShareProvider {
                $alreadySharedGroup = $this->getSharedWith($shareWith, \OCP\Share::SHARE_TYPE_REMOTE_GROUP, $share->getNode(), 1, 0);
                if (!empty($alreadyShared) || !empty($alreadySharedGroup)) {
                        $message = 'Sharing %1$s failed, because this item is already shared with %2$s';
-                       $message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with %2$s', array($share->getNode()->getName(), $shareWith));
+                       $message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with %2$s', [$share->getNode()->getName(), $shareWith]);
                        $this->logger->debug(sprintf($message, $share->getNode()->getName(), $shareWith), ['app' => 'Federated File Sharing']);
                        throw new \Exception($message_t);
                }
index 5df2173263ca9e61f5a2908c3118045058dd7b36..70cf11c7672df78637b630b1986eee5850e4489b 100644 (file)
@@ -99,7 +99,7 @@ class Notifications {
                if ($user && $remote) {
                        $local = $this->addressHandler->generateRemoteURL();
 
-                       $fields = array(
+                       $fields = [
                                'shareWith' => $user,
                                'token' => $token,
                                'name' => $name,
@@ -110,7 +110,7 @@ class Notifications {
                                'sharedByFederatedId' => $sharedByFederatedId,
                                'remote' => $local,
                                'shareType' => $shareType
-                       );
+                       ];
 
                        $result = $this->tryHttpPostToShareEndpoint($remote, '', $fields);
                        $status = json_decode($result['result'], true);
@@ -144,12 +144,12 @@ class Notifications {
         */
        public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission, $filename) {
 
-               $fields = array(
+               $fields = [
                        'shareWith' => $shareWith,
                        'token' => $token,
                        'permission' => $permission,
                        'remoteId' => $shareId,
-               );
+               ];
 
                $ocmFields = $fields;
                $ocmFields['remoteId'] = $id;
index e2e2f26ad3a83405b1ac40bd7de6afaa63d44301..c87d4e273fcf8e5ce57796c657af5b0b91cb089b 100644 (file)
@@ -215,7 +215,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
                                Util::emitHook(
                                        '\OCA\Files_Sharing\API\Server2Server',
                                        'preLoginNameUsedAsUserName',
-                                       array('uid' => &$shareWith)
+                                       ['uid' => &$shareWith]
                                );
                                $this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']);
 
@@ -774,7 +774,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
                } catch (NotFoundException $e) {
                        $file = null;
                }
-               $args = Filesystem::is_dir($file) ? array('dir' => $file) : array('dir' => dirname($file), 'scrollto' => $file);
+               $args = Filesystem::is_dir($file) ? ['dir' => $file] : ['dir' => dirname($file), 'scrollto' => $file];
                $link = Util::linkToAbsolute('files', 'index.php', $args);
 
                return [$file, $link];
index d6a7bdaf2920f7ff551c7909245b498b328c6162..f69bc4209d38987774fcc7dba20f6d34fd2be972 100644 (file)
@@ -104,21 +104,21 @@ class AddressHandlerTest extends \Test\TestCase {
        }
 
        public function dataTestSplitUserRemoteError() {
-               return array(
+               return [
                        // Invalid path
-                       array('user@'),
+                       ['user@'],
 
                        // Invalid user
-                       array('@server'),
-                       array('us/er@server'),
-                       array('us:er@server'),
+                       ['@server'],
+                       ['us/er@server'],
+                       ['us:er@server'],
 
                        // Invalid splitting
-                       array('user'),
-                       array(''),
-                       array('us/erserver'),
-                       array('us:erserver'),
-               );
+                       ['user'],
+                       [''],
+                       ['us/erserver'],
+                       ['us:erserver'],
+               ];
        }
 
        /**
index 5b29175a83c1b2e57fdcf437d714029dd6807f33..d5ea0f634f28796a5de92341bbbbfee3de42a37e 100644 (file)
@@ -38,7 +38,7 @@ $dir = isset($_GET['dir']) ? (string)$_GET['dir'] : '';
 $files_list = json_decode($files);
 // in case we get only a single file
 if (!is_array($files_list)) {
-       $files_list = array($files);
+       $files_list = [$files];
 }
 
 /**
@@ -52,7 +52,7 @@ if(isset($_GET['downloadStartSecret'])
        setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
 }
 
-$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' );
+$server_params = [ 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ];
 
 /**
  * Http range requests support
index 0b66ed108976cd72eed4e61e47b74d2c21c2d619..8cbe5841aafde290a58d8572aefe4bb1689542d1 100644 (file)
@@ -43,7 +43,7 @@ try {
                exit();
        }
 
-       $data = array();
+       $data = [];
        $baseUrl = \OC::$server->getURLGenerator()->linkTo('files', 'index.php') . '?dir=';
 
        $permissions = $dirInfo->getPermissions();
@@ -80,7 +80,7 @@ try {
        $data['files'] = \OCA\Files\Helper::formatFileInfos($files);
        $data['permissions'] = $permissions;
 
-       \OC_JSON::success(array('data' => $data));
+       \OC_JSON::success(['data' => $data]);
 } catch (\OCP\Files\StorageNotAvailableException $e) {
        \OC::$server->getLogger()->logException($e, ['app' => 'files']);
        \OC_JSON::error([
@@ -91,18 +91,18 @@ try {
        ]);
 } catch (\OCP\Files\StorageInvalidException $e) {
        \OC::$server->getLogger()->logException($e, ['app' => 'files']);
-       \OC_JSON::error(array(
-               'data' => array(
+       \OC_JSON::error([
+               'data' => [
                        'exception' => StorageInvalidException::class,
                        'message' => $l->t('Storage invalid')
-               )
-       ));
+               ]
+       ]);
 } catch (\Exception $e) {
        \OC::$server->getLogger()->logException($e, ['app' => 'files']);
-       \OC_JSON::error(array(
-               'data' => array(
+       \OC_JSON::error([
+               'data' => [
                        'exception' => \Exception::class,
                        'message' => $l->t('Unknown error')
-               )
-       ));
+               ]
+       ]);
 }
index 35e46c0c151e0f15406011382f15ebbae166ec61..bb98613377cc9877714526e70fa6e5ebbf378110 100644 (file)
@@ -36,7 +36,7 @@ $app = \OC::$server->query(Application::class);
 // t('Files')
 $l = \OC::$server->getL10N('files');
 
-\OC::$server->getSearch()->registerProvider(File::class, array('apps' => array('files')));
+\OC::$server->getSearch()->registerProvider(File::class, ['apps' => ['files']]);
 
 $templateManager = \OC_Helper::getFileTemplateManager();
 $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp');
index 8bda6329d29a7065a7d461f6b4e11246e0dd47d8..b043cfeb6acb285434cc89f2e8d70630065ef805 100644 (file)
@@ -50,7 +50,7 @@ class Application extends App {
 
        public const APP_ID = 'files';
 
-       public function __construct(array $urlParams=array()) {
+       public function __construct(array $urlParams=[]) {
                parent::__construct(self::APP_ID, $urlParams);
                $container = $this->getContainer();
                $server = $container->getServer();
index 39eebbb2c4329ab3c2b90324a54d54aeb906a62f..38d4b1cc979a886e5c51d2ab742488750a4e4ba7 100644 (file)
@@ -174,7 +174,7 @@ class Scan extends Base {
                if ($inputPath) {
                        $inputPath = '/' . trim($inputPath, '/');
                        list (, $user,) = explode('/', $inputPath, 3);
-                       $users = array($user);
+                       $users = [$user];
                } else if ($input->getOption('all')) {
                        $users = $this->userManager->search('');
                } else {
index 70b878f43ad104f26529ed704032abc37ef303f1..7c5d2a08b883e1a9b76ba89ed8ea034f62e6d545 100644 (file)
@@ -200,7 +200,7 @@ class ViewController extends Controller {
                        $collapseClasses = 'collapsible';
                }
 
-               $favoritesSublistArray = Array();
+               $favoritesSublistArray = [];
 
                $navBarPositionPosition = 6;
                $currentCount           = 0;
index f88689af2667d646075589f08c40dfb835be059e..c46d3028553262e27d47ebf39edabc2986c7e67c 100644 (file)
@@ -51,7 +51,7 @@ class Helper {
                $l = \OC::$server->getL10N('files');
                $maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']);
                $maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize);
-               $maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize));
+               $maxHumanFileSize = $l->t('Upload (max. %s)', [$maxHumanFileSize]);
 
                return [
                        'uploadMaxFilesize' => $maxUploadFileSize,
@@ -140,7 +140,7 @@ class Helper {
         * @return array formatted file info
         */
        public static function formatFileInfo(FileInfo $i) {
-               $entry = array();
+               $entry = [];
 
                $entry['id'] = $i['fileid'];
                $entry['parentId'] = $i['parent'];
@@ -182,7 +182,7 @@ class Helper {
         * @return array
         */
        public static function formatFileInfos($fileInfos) {
-               $files = array();
+               $files = [];
                foreach ($fileInfos as $i) {
                        $files[] = self::formatFileInfo($i);
                }
@@ -262,7 +262,7 @@ class Helper {
                } else if ($sortAttribute === 'size') {
                        $sortFunc = 'compareSize';
                }
-               usort($files, array(Helper::class, $sortFunc));
+               usort($files, [Helper::class, $sortFunc]);
                if ($sortDescending) {
                        $files = array_reverse($files);
                }
index a477db324ac21e946b3632b2274440fc4b6a429d..5df00ae5c5fda9b7bc9a15764b0dbbb6753ae1bb 100644 (file)
@@ -83,7 +83,7 @@ class TagService {
        public function updateFileTags($path, $tags) {
                $fileId = $this->homeFolder->get($path)->getId();
 
-               $currentTags = $this->tagger->getTagsForObjects(array($fileId));
+               $currentTags = $this->tagger->getTagsForObjects([$fileId]);
 
                if (!empty($currentTags)) {
                        $currentTags = current($currentTags);
index b14617f0ca31a7802da5d867e6deb1a32fbc393f..9d6227c86b38c330c73e5c765c423b92e0af2ec7 100644 (file)
@@ -47,7 +47,7 @@ script(\OCA\Files\AppInfo\Application::APP_ID, 'dist/files-app-settings');
                        <label for="webdavurl"><?php p($l->t('WebDAV')); ?></label>
                        <input id="webdavurl" type="text" readonly="readonly"
                                   value="<?php p($_['webdav_url']); ?>"/>
-                       <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em>
+                       <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', [link_to_docs('user-webdav')])); ?></em>
                </div>
        </div>
 
index b756386a2bf48420458f2e951be06039aece1637..8dda7be5a198e62e70c7a145dbd36efcdec5754f 100644 (file)
@@ -37,13 +37,13 @@ class HelperTest extends \Test\TestCase {
                        '/' . $name,
                        null,
                        '/',
-                       array(
+                       [
                                'name' => $name,
                                'size' => $size,
                                'mtime' => $mtime,
                                'type' => $isDir ? 'dir' : 'file',
                                'mimetype' => $isDir ? 'httpd/unix-directory' : 'application/octet-stream'
-                       ),
+                       ],
                        null
                );
        }
@@ -52,49 +52,49 @@ class HelperTest extends \Test\TestCase {
         * Returns a file list for testing
         */
        private function getTestFileList() {
-               return array(
+               return [
                        self::makeFileInfo('a.txt', 4, 2.3 * pow(10, 9)),
                        self::makeFileInfo('q.txt', 5, 150),
                        self::makeFileInfo('subdir2', 87, 128, true),
                        self::makeFileInfo('b.txt', 2.2 * pow(10, 9), 800),
                        self::makeFileInfo('o.txt', 12, 100),
                        self::makeFileInfo('subdir', 88, 125, true),
-               );
+               ];
        }
 
        function sortDataProvider() {
-               return array(
-                       array(
+               return [
+                       [
                                'name',
                                false,
-                               array('subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'),
-                       ),
-                       array(
+                               ['subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'],
+                       ],
+                       [
                                'name',
                                true,
-                               array('q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'),
-                       ),
-                       array(
+                               ['q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'],
+                       ],
+                       [
                                'size',
                                false,
-                               array('a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'),
-                       ),
-                       array(
+                               ['a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'],
+                       ],
+                       [
                                'size',
                                true,
-                               array('b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'),
-                       ),
-                       array(
+                               ['b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'],
+                       ],
+                       [
                                'mtime',
                                false,
-                               array('o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'),
-                       ),
-                       array(
+                               ['o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'],
+                       ],
+                       [
                                'mtime',
                                true,
-                               array('a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'),
-                       ),
-               );
+                               ['a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'],
+                       ],
+               ];
        }
 
        /**
@@ -103,7 +103,7 @@ class HelperTest extends \Test\TestCase {
        public function testSortByName($sort, $sortDescending, $expectedOrder) {
                $files = self::getTestFileList();
                $files = \OCA\Files\Helper::sortFiles($files, $sort, $sortDescending);
-               $fileNames = array();
+               $fileNames = [];
                foreach ($files as $fileInfo) {
                        $fileNames[] = $fileInfo->getName();
                }
index bc7c803953ba385bd9ddd882f1943771792c4522..a2792a38647cb9b90310f4c47a15abb89b02e2d6 100644 (file)
@@ -132,25 +132,25 @@ class TagServiceTest extends \Test\TestCase {
                $fileId = $testFile->getId();
 
                // set tags
-               $this->tagService->updateFileTags('subdir/test.txt', array($tag1, $tag2));
+               $this->tagService->updateFileTags('subdir/test.txt', [$tag1, $tag2]);
 
-               $this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag1));
-               $this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag2));
+               $this->assertEquals([$fileId], $this->tagger->getIdsForTag($tag1));
+               $this->assertEquals([$fileId], $this->tagger->getIdsForTag($tag2));
 
                // remove tag
-               $this->tagService->updateFileTags('subdir/test.txt', array($tag2));
-               $this->assertEquals(array(), $this->tagger->getIdsForTag($tag1));
-               $this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag2));
+               $this->tagService->updateFileTags('subdir/test.txt', [$tag2]);
+               $this->assertEquals([], $this->tagger->getIdsForTag($tag1));
+               $this->assertEquals([$fileId], $this->tagger->getIdsForTag($tag2));
 
                // clear tags
-               $this->tagService->updateFileTags('subdir/test.txt', array());
-               $this->assertEquals(array(), $this->tagger->getIdsForTag($tag1));
-               $this->assertEquals(array(), $this->tagger->getIdsForTag($tag2));
+               $this->tagService->updateFileTags('subdir/test.txt', []);
+               $this->assertEquals([], $this->tagger->getIdsForTag($tag1));
+               $this->assertEquals([], $this->tagger->getIdsForTag($tag2));
 
                // non-existing file
                $caught = false;
                try {
-                       $this->tagService->updateFileTags('subdir/unexist.txt', array($tag1));
+                       $this->tagService->updateFileTags('subdir/unexist.txt', [$tag1]);
                } catch (\OCP\Files\NotFoundException $e) {
                        $caught = true;
                }
index 0a6b9f5af46ff741d77e98b5009d517d029da6f8..bda2c9195964ffa9ae53f953580d1d5b16b2ae68 100644 (file)
@@ -51,6 +51,6 @@ foreach (\OC::$server->getUserManager()->searchDisplayName($pattern, $limit, $of
        $users[$user->getUID()] = $user->getDisplayName();
 }
 
-$results = array('groups' => $groups, 'users' => $users);
+$results = ['groups' => $groups, 'users' => $users];
 
 \OC_JSON::success($results);
index 347fa02e1b02c42adbb525a0d97cb6247cafda36..b9e414a410a25bbccad4f12d88615f43bca52710 100644 (file)
@@ -88,12 +88,12 @@ class AjaxController extends Controller {
        public function getSshKeys($keyLength = 1024) {
                $key = $this->generateSshKeys($keyLength);
                return new JSONResponse(
-                       array('data' => array(
+                       ['data' => [
                                'private_key' => $key['privatekey'],
                                'public_key' => $key['publickey']
-                       ),
+                       ],
                        'status' => 'success'
-               ));
+               ]);
        }
 
        /**
index 1882ea3150448ea989a83e89fb5e10f9709aef14..aa0c8ddb6a1877b08cd17d3e1b12fbb424480975 100644 (file)
@@ -74,7 +74,7 @@ class ApiController extends OCSController {
                        $permissions |= \OCP\Constants::PERMISSION_DELETE;
                }
 
-               $entry = array(
+               $entry = [
                        'name' => basename($mountPoint),
                        'path' => $path,
                        'type' => 'dir',
@@ -83,7 +83,7 @@ class ApiController extends OCSController {
                        'permissions' => $permissions,
                        'id' => $mountConfig['id'],
                        'class' => $mountConfig['class']
-               );
+               ];
                return $entry;
        }
 
index c8fc4b00ef8d3d80f5a01449ef606ad8a0fdf06d..a3c9fbb284c8ea40e8a31a0c2ecd332fdb073272 100644 (file)
@@ -171,7 +171,7 @@ class GlobalStoragesController extends StoragesController {
                } catch (NotFoundException $e) {
                        return new DataResponse(
                                [
-                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
                                ],
                                Http::STATUS_NOT_FOUND
                        );
index 8e0dac5a898172dd2f553a14ed9eb1eb5bfd51b6..a3a258c599a868f49f47f18b27906733525ccadc 100644 (file)
@@ -124,7 +124,7 @@ class UserGlobalStoragesController extends StoragesController {
                } catch (NotFoundException $e) {
                        return new DataResponse(
                                [
-                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
                                ],
                                Http::STATUS_NOT_FOUND
                        );
@@ -164,7 +164,7 @@ class UserGlobalStoragesController extends StoragesController {
                        } else {
                                return new DataResponse(
                                        [
-                                               'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', array($id))
+                                               'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', [$id])
                                        ],
                                        Http::STATUS_FORBIDDEN
                                );
@@ -172,7 +172,7 @@ class UserGlobalStoragesController extends StoragesController {
                } catch (NotFoundException $e) {
                        return new DataResponse(
                                [
-                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
                                ],
                                Http::STATUS_NOT_FOUND
                        );
index 46285c4758a750a6daa35017387d5fcd994419d2..df42198aeb30d3cd10e3820b1536551edf8e98a7 100644 (file)
@@ -199,7 +199,7 @@ class UserStoragesController extends StoragesController {
                } catch (NotFoundException $e) {
                        return new DataResponse(
                                [
-                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+                                       'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
                                ],
                                Http::STATUS_NOT_FOUND
                        );
index 60e39a4d300e2fdae9f55973997155bd3cfa19ad..0d7cbacd8b5ebd74e5c12a87b57728e83bc6d334 100644 (file)
@@ -128,10 +128,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
        private function headObject($key) {
                if (!isset($this->objectCache[$key])) {
                        try {
-                               $this->objectCache[$key] = $this->getConnection()->headObject(array(
+                               $this->objectCache[$key] = $this->getConnection()->headObject([
                                        'Bucket' => $this->bucket,
                                        'Key' => $key
-                               ));
+                               ]);
                        } catch (S3Exception $e) {
                                if ($e->getStatusCode() >= 500) {
                                        throw $e;
@@ -191,7 +191,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                $stmt = \OC::$server->getDatabaseConnection()->prepare(
                        'SELECT `numeric_id`, `id` FROM `*PREFIX*storages` WHERE `id` IN (?, ?)'
                );
-               $stmt->execute(array($oldId, $this->id));
+               $stmt->execute([$oldId, $this->id]);
                while ($row = $stmt->fetch()) {
                        $storages[$row['id']] = $row['numeric_id'];
                }
@@ -204,7 +204,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                        $stmt = \OC::$server->getDatabaseConnection()->prepare(
                                'UPDATE `*PREFIX*storages` SET `id` = ? WHERE `id` = ?'
                        );
-                       $stmt->execute(array($this->id, $oldId));
+                       $stmt->execute([$this->id, $oldId]);
                }
                // only the bucket based id may exist, do nothing
        }
@@ -235,12 +235,12 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                }
 
                try {
-                       $this->getConnection()->putObject(array(
+                       $this->getConnection()->putObject([
                                'Bucket' => $this->bucket,
                                'Key' => $path . '/',
                                'Body' => '',
                                'ContentType' => 'httpd/unix-directory'
-                       ));
+                       ]);
                        $this->testTimeout();
                } catch (S3Exception $e) {
                        \OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
@@ -284,9 +284,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
        }
 
        private function batchDelete($path = null) {
-               $params = array(
+               $params = [
                        'Bucket' => $this->bucket
-               );
+               ];
                if ($path !== null) {
                        $params['Prefix'] = $path . '/';
                }
@@ -326,7 +326,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                }
 
                try {
-                       $files = array();
+                       $files = [];
                        $results = $this->getConnection()->getPaginator('ListObjects', [
                                'Bucket' => $this->bucket,
                                'Delimiter' => '/',
@@ -550,7 +550,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
        public function touch($path, $mtime = null) {
                $path = $this->normalizePath($path);
 
-               $metadata = array();
+               $metadata = [];
                if (is_null($mtime)) {
                        $mtime = time();
                }
@@ -599,11 +599,11 @@ class AmazonS3 extends \OC\Files\Storage\Common {
 
                if ($this->is_file($path1)) {
                        try {
-                               $this->getConnection()->copyObject(array(
+                               $this->getConnection()->copyObject([
                                        'Bucket' => $this->bucket,
                                        'Key' => $this->cleanKey($path2),
                                        'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1)
-                               ));
+                               ]);
                                $this->testTimeout();
                        } catch (S3Exception $e) {
                                \OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
@@ -613,11 +613,11 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                        $this->remove($path2);
 
                        try {
-                               $this->getConnection()->copyObject(array(
+                               $this->getConnection()->copyObject([
                                        'Bucket' => $this->bucket,
                                        'Key' => $path2 . '/',
                                        'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1 . '/')
-                               ));
+                               ]);
                                $this->testTimeout();
                        } catch (S3Exception $e) {
                                \OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
index 8f014ce921c5f9eefcd8283fbb9fa10dcf30037e..adf7f29a3d600e6deb681471748fd9b2593274fa 100644 (file)
@@ -109,7 +109,7 @@ class FTP extends StreamWrapper{
                        case 'a':
                        case 'ab':
                                //these are supported by the wrapper
-                               $context = stream_context_create(array('ftp' => array('overwrite' => true)));
+                               $context = stream_context_create(['ftp' => ['overwrite' => true]]);
                                $handle = fopen($this->constructUrl($path), $mode, false, $context);
                                return RetryWrapper::wrap($handle);
                        case 'r+':
@@ -150,7 +150,7 @@ class FTP extends StreamWrapper{
                if (function_exists('ftp_login')) {
                        return true;
                } else {
-                       return array('ftp');
+                       return ['ftp'];
                }
        }
 
index 5d83bf253e494bcddb5c4792e3858fc830ab6b16..eaead3eea4510e6e25ae1a87f9cc97d20bc91a85 100644 (file)
@@ -251,8 +251,8 @@ class SFTP extends \OC\Files\Storage\Common {
                try {
                        $keyPath = $this->hostKeysPath();
                        if (file_exists($keyPath)) {
-                               $hosts = array();
-                               $keys = array();
+                               $hosts = [];
+                               $keys = [];
                                $lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
                                if ($lines) {
                                        foreach ($lines as $line) {
@@ -267,7 +267,7 @@ class SFTP extends \OC\Files\Storage\Common {
                        }
                } catch (\Exception $e) {
                }
-               return array();
+               return [];
        }
 
        /**
@@ -307,7 +307,7 @@ class SFTP extends \OC\Files\Storage\Common {
                        }
 
                        $id = md5('sftp:' . $path);
-                       $dirStream = array();
+                       $dirStream = [];
                        foreach($list as $file) {
                                if ($file !== '.' && $file !== '..') {
                                        $dirStream[] = $file;
@@ -391,7 +391,7 @@ class SFTP extends \OC\Files\Storage\Common {
                                case 'x+':
                                case 'c':
                                case 'c+':
-                                       $context = stream_context_create(array('sftp' => array('session' => $this->getConnection())));
+                                       $context = stream_context_create(['sftp' => ['session' => $this->getConnection()]]);
                                        $handle = fopen($this->constructUrl($path), $mode, false, $context);
                                        return RetryWrapper::wrap($handle);
                        }
@@ -464,7 +464,7 @@ class SFTP extends \OC\Files\Storage\Common {
                        $mtime = $stat ? $stat['mtime'] : -1;
                        $size = $stat ? $stat['size'] : 0;
 
-                       return array('mtime' => $mtime, 'size' => $size, 'ctime' => -1);
+                       return ['mtime' => $mtime, 'size' => $size, 'ctime' => -1];
                } catch (\Exception $e) {
                        return false;
                }
index 6cf7bb7db85119a907438401fc5dba0c94571c74..8f7d594cd67711e980dd0647cef7fbfa43cb9d11 100644 (file)
@@ -472,7 +472,7 @@ class SMB extends Common implements INotifyStorage {
                }
 
                try {
-                       $this->statCache = array();
+                       $this->statCache = [];
                        $content = $this->share->dir($this->buildPath($path));
                        foreach ($content as $file) {
                                if ($file->isDirectory()) {
index 0072f91d4ed1ad1b0552df5b2f38474aebd20372..daa222def0473ca619af2d56dcd5684507a25a1e 100644 (file)
@@ -351,7 +351,7 @@ class Swift extends \OC\Files\Storage\Common {
                        $mtime = floor($mtime);
                }
 
-               $stat = array();
+               $stat = [];
                $stat['size'] = (int)$object->contentLength;
                $stat['mtime'] = $mtime;
                $stat['atime'] = time();
@@ -602,7 +602,7 @@ class Swift extends \OC\Files\Storage\Common {
                }
                $path = $this->normalizePath($path);
                $dh = $this->opendir($path);
-               $content = array();
+               $content = [];
                while (($file = readdir($dh)) !== false) {
                        $content[] = $file;
                }
index f799fd25f570c667d5e1a6ec7fdcb35bac5414c0..a65b3b3a9c26dae047fe3628909037932f406631 100644 (file)
@@ -96,7 +96,7 @@ class OC_Mount_Config {
         * @deprecated 8.2.0 use UserGlobalStoragesService::getStorages() and UserStoragesService::getStorages()
         */
        public static function getAbsoluteMountPoints($uid) {
-               $mountPoints = array();
+               $mountPoints = [];
 
                $userGlobalStoragesService = self::$app->getContainer()->query(UserGlobalStoragesService::class);
                $userStoragesService = self::$app->getContainer()->query(UserStoragesService::class);
@@ -296,7 +296,7 @@ class OC_Mount_Config {
                                return $mountPoints;
                        }
                }
-               return array();
+               return [];
        }
 
        /**
@@ -430,14 +430,14 @@ class OC_Mount_Config {
         */
        public static function makeConfigHash($config) {
                $data = json_encode(
-                       array(
+                       [
                                'c' => $config['backend'],
                                'a' => $config['authMechanism'],
                                'm' => $config['mountpoint'],
                                'o' => $config['options'],
                                'p' => isset($config['priority']) ? $config['priority'] : -1,
                                'mo' => isset($config['mountOptions']) ? $config['mountOptions'] : [],
-                       )
+                       ]
                );
                return hash('md5', $data);
        }
index 3ecf47419b591d9a593613ac1452bd0f9be14dd1..56311a7be4cecd334274c00029e68f2885ea300f 100644 (file)
@@ -117,7 +117,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        'mount',
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -159,7 +159,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        'mount',
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -172,11 +172,11 @@ abstract class StoragesControllerTest extends \Test\TestCase {
        }
 
        function mountPointNamesProvider() {
-               return array(
-                       array(''),
-                       array('/'),
-                       array('//'),
-               );
+               return [
+                       [''],
+                       ['/'],
+                       ['//'],
+               ];
        }
 
        /**
@@ -201,7 +201,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        $mountPoint,
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -215,7 +215,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        $mountPoint,
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -238,7 +238,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        'mount',
                        '\OC\Files\Storage\InvalidStorage',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -252,7 +252,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        'mount',
                        '\OC\Files\Storage\InvalidStorage',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -292,7 +292,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        'mount',
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -388,7 +388,7 @@ abstract class StoragesControllerTest extends \Test\TestCase {
                        'mount',
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\OCA\Files_External\Lib\Auth\NullMechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
index 7d8f60380c6537a5b47353dd866c1d7ab1057910..5f82121cf7ab4d3b94f1589f2fc690a956eba4a4 100644 (file)
@@ -86,7 +86,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
                        'mount',
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\Auth\Mechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
@@ -100,7 +100,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
                        'mount',
                        '\OCA\Files_External\Lib\Storage\SMB',
                        '\Auth\Mechanism',
-                       array(),
+                       [],
                        [],
                        [],
                        [],
index d87288edb10ab3e6c6d4962c59a28be4ed9bc584..060f8c61a4428875e5927ef54f54f59dd5bb0f10 100644 (file)
@@ -36,72 +36,72 @@ namespace OCA\Files_External\Tests;
 class OwnCloudFunctionsTest extends \Test\TestCase {
 
        function configUrlProvider() {
-               return array(
-                       array(
-                               array(
+               return [
+                       [
+                               [
                                        'host' => 'testhost',
                                        'root' => 'testroot',
                                        'secure' => false
-                               ),
+                               ],
                                'http://testhost/remote.php/webdav/testroot/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'testhost',
                                        'root' => 'testroot',
                                        'secure' => true
-                               ),
+                               ],
                                'https://testhost/remote.php/webdav/testroot/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'http://testhost',
                                        'root' => 'testroot',
                                        'secure' => false
-                               ),
+                               ],
                                'http://testhost/remote.php/webdav/testroot/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'https://testhost',
                                        'root' => 'testroot',
                                        'secure' => false
-                               ),
+                               ],
                                'https://testhost/remote.php/webdav/testroot/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'https://testhost/testroot',
                                        'root' => '',
                                        'secure' => false
-                               ),
+                               ],
                                'https://testhost/testroot/remote.php/webdav/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'https://testhost/testroot',
                                        'root' => 'subdir',
                                        'secure' => false
-                               ),
+                               ],
                                'https://testhost/testroot/remote.php/webdav/subdir/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'http://testhost/testroot',
                                        'root' => 'subdir',
                                        'secure' => true
-                               ),
+                               ],
                                'http://testhost/testroot/remote.php/webdav/subdir/',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        'host' => 'http://testhost/testroot/',
                                        'root' => '/subdir',
                                        'secure' => false
-                               ),
+                               ],
                                'http://testhost/testroot/remote.php/webdav/subdir/',
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
index 9d3a44042e0b9ee0d3452fc28dd18e53b9e9c699..dd35ee8f92c4674e8739431deee07e2c519620d5 100644 (file)
@@ -95,7 +95,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
                $this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto());
-               self::$hookCalls = array();
+               self::$hookCalls = [];
                $config = \OC::$server->getConfig();
                $this->dataDir = $config->getSystemValue(
                        'datadirectory',
@@ -177,7 +177,7 @@ abstract class StoragesServiceTest extends \Test\TestCase {
 
        protected function tearDown(): void {
                \OC_Mount_Config::$skipTest = false;
-               self::$hookCalls = array();
+               self::$hookCalls = [];
                if ($this->dbConfig) {
                        $this->dbConfig->clean();
                }
@@ -448,17 +448,17 @@ abstract class StoragesServiceTest extends \Test\TestCase {
        }
 
        public static function createHookCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_create_mount,
                        'params' => $params
-               );
+               ];
        }
 
        public static function deleteHookCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_delete_mount,
                        'params' => $params
-               );
+               ];
        }
 
        /**
index 65a1566ec1eb78823b3ee89362a522e39100d668..6b9ce2d5b3163dfe9e9e809cb682ed642bb4abe1 100644 (file)
@@ -63,11 +63,11 @@ class FtpTest extends \Test\Files\Storage\Storage {
        }
 
        public function testConstructUrl(){
-               $config = array ( 'host' => 'localhost',
+               $config =  [ 'host' => 'localhost',
                                                  'user' => 'ftp',
                                                  'password' => 'ftp',
                                                  'root' => '/',
-                                                 'secure' => false );
+                                                 'secure' => false ];
                $instance = new FTP($config);
                $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
 
index 2af9d00ebe918d24de13d6a202fe7e81fd9cbc40..87a5668be49da43226444259ea7668e2089f82a3 100644 (file)
@@ -73,7 +73,7 @@ class SmbTest extends \Test\Files\Storage\Storage {
 
        public function directoryProvider() {
                // doesn't support leading/trailing spaces
-               return array(array('folder'));
+               return [['folder']];
        }
 
        public function testRenameWithSpaces() {
index a080b33e7fe1f481ac0306024f6e487bf05c332c..d6d3731c5a5659febb0f866397c1ac631b3f4313 100644 (file)
@@ -33,15 +33,15 @@ if (file_exists($privateConfigFile)) {
 }
 
 // this is now more a template now for your private configurations
-return array(
-       'ftp'=>array(
+return [
+       'ftp'=>[
                'run'=>false,
                'host'=>'localhost',
                'user'=>'test',
                'password'=>'test',
                'root'=>'/test',
-       ),
-       'webdav'=>array(
+       ],
+       'webdav'=>[
                'run'=>false,
                'host'=>'localhost',
                'user'=>'test',
@@ -51,15 +51,15 @@ return array(
                // (only in tests)
                // set to higher value for lighttpd webdav
                'wait'=> 0
-       ),
-       'owncloud'=>array(
+       ],
+       'owncloud'=>[
                'run'=>false,
                'host'=>'localhost/owncloud',
                'user'=>'test',
                'password'=>'test',
                'root'=>'',
-       ),
-       'swift' => array(
+       ],
+       'swift' => [
                'run' => false,
                'user' => 'test',
                'bucket' => 'test',
@@ -70,16 +70,16 @@ return array(
                //'service_name' => 'swift', //should be 'swift' for OpenStack Object Storage and 'cloudFiles' for Rackspace Cloud Files (default value)
                //'url' => 'https://identity.api.rackspacecloud.com/v2.0/', //to be used with Rackspace Cloud Files and OpenStack Object Storage
                //'timeout' => 5 // timeout of HTTP requests in seconds
-       ),
-       'smb'=>array(
+       ],
+       'smb'=>[
                'run'=>false,
                'user'=>'test',
                'password'=>'test',
                'host'=>'localhost',
                'share'=>'/test',
                'root'=>'/test/',
-       ),
-       'amazons3'=>array(
+       ],
+       'amazons3'=>[
                'run'=>false,
                'key'=>'test',
                'secret'=>'test',
@@ -90,20 +90,20 @@ return array(
                //'region' => 'eu-west-1',
                //'test'=>'true',
                //'timeout'=>20
-       ),
-       'sftp' => array (
+       ],
+       'sftp' =>  [
                'run'=>false,
                'host'=>'localhost',
                'user'=>'test',
                'password'=>'test',
                'root'=>'/test'
-       ),
-       'sftp_key' => array (
+       ],
+       'sftp_key' =>  [
                 'run'=>false,
                 'host'=>'localhost',
                 'user'=>'test',
                 'public_key'=>'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJPTvz3OLonF2KSGEKP/nd4CPmRYvemG2T4rIiNYjDj0U5y+2sKEWbjiUlQl2bsqYuVoJ+/UNJlGQbbZ08kQirFeo1GoWBzqioaTjUJfbLN6TzVVKXxR9YIVmH7Ajg2iEeGCndGgbmnPfj+kF9TR9IH8vMVvtubQwf7uEwB0ALhw== phpseclib-generated-key',
                'private_key'=>'test',
                 'root'=>'/test'
-        ),
-);
+        ],
+];
index 620aaf42c6917ee5f3d60909b5ff05078e82717d..1022788ed2fa14e4d94bec2352c003ac41abc6ce 100644 (file)
@@ -615,7 +615,7 @@ class ShareController extends AuthPublicShareController {
 
                $this->emitAccessShareHook($share);
 
-               $server_params = array( 'head' => $this->request->getMethod() === 'HEAD' );
+               $server_params = [ 'head' => $this->request->getMethod() === 'HEAD' ];
 
                /**
                 * Http range requests support
index c58e6e7b98a78b859cda836df3ee3fdfd9ae68dc..c89bb2c2f4f832eb8bdf2ffd852a6c1961e6c085 100644 (file)
@@ -193,13 +193,13 @@ class Manager {
 
                $this->writeShareToDb($remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType);
 
-               $options = array(
+               $options = [
                        'remote'        => $remote,
                        'token'         => $token,
                        'password'      => $password,
                        'mountpoint'    => $mountPoint,
                        'owner'         => $owner
-               );
+               ];
                return $this->mountShare($options);
        }
 
@@ -226,7 +226,7 @@ class Manager {
                                        (`remote`, `share_token`, `password`, `name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`, `accepted`, `remote_id`, `parent`, `share_type`)
                                VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
                        ');
-               return $query->execute(array($remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType));
+               return $query->execute([$remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType]);
        }
 
        /**
@@ -240,7 +240,7 @@ class Manager {
                        SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`, `parent`, `share_type`, `password`, `mountpoint_hash`
                        FROM  `*PREFIX*share_external`
                        WHERE `id` = ?');
-               $result = $getShare->execute(array($id));
+               $result = $getShare->execute([$id]);
 
                $share = $result ? $getShare->fetch() : [];
 
@@ -286,7 +286,7 @@ class Manager {
                                        `mountpoint` = ?,
                                        `mountpoint_hash` = ?
                                WHERE `id` = ? AND `user` = ?');
-                               $userShareAccepted = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
+                               $userShareAccepted = $acceptShare->execute([1, $mountPoint, $hash, $id, $this->uid]);
                        } else {
                                $result = $this->writeShareToDb(
                                        $share['remote'],
@@ -327,7 +327,7 @@ class Manager {
                if ($share && (int)$share['share_type'] === Share::SHARE_TYPE_USER) {
                        $removeShare = $this->connection->prepare('
                                DELETE FROM `*PREFIX*share_external` WHERE `id` = ? AND `user` = ?');
-                       $removeShare->execute(array($id, $this->uid));
+                       $removeShare->execute([$id, $this->uid]);
                        $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
 
                        $this->processNotification($id);
@@ -384,7 +384,7 @@ class Manager {
                $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
 
                $url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . Share::RESPONSE_FORMAT;
-               $fields = array('token' => $token);
+               $fields = ['token' => $token];
 
                $client = $this->clientService->newClient();
 
@@ -502,7 +502,7 @@ class Manager {
                        WHERE `mountpoint_hash` = ?
                        AND `user` = ?
                ');
-               $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid));
+               $result = (bool)$query->execute([$target, $targetHash, $sourceHash, $this->uid]);
 
                return $result;
        }
@@ -519,7 +519,7 @@ class Manager {
                        SELECT `remote`, `share_token`, `remote_id`, `share_type`, `id`
                        FROM  `*PREFIX*share_external`
                        WHERE `mountpoint_hash` = ? AND `user` = ?');
-               $result = $getShare->execute(array($hash, $this->uid));
+               $result = $getShare->execute([$hash, $this->uid]);
 
                $share = $getShare->fetch();
                $getShare->closeCursor();
@@ -535,13 +535,13 @@ class Manager {
                        DELETE FROM `*PREFIX*share_external`
                        WHERE `id` = ?
                        ');
-                       $result = (bool)$query->execute(array((int)$share['id']));
+                       $result = (bool)$query->execute([(int)$share['id']]);
                } else if ($result && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
                        $query = $this->connection->prepare('
                                UPDATE `*PREFIX*share_external`
                                SET `accepted` = ?
                                WHERE `id` = ?');
-                       $result = (bool)$query->execute(array(0, (int)$share['id']));
+                       $result = (bool)$query->execute([0, (int)$share['id']]);
                }
 
                if($result) {
@@ -585,7 +585,7 @@ class Manager {
                        SELECT `remote`, `share_token`, `remote_id`
                        FROM  `*PREFIX*share_external`
                        WHERE `user` = ?');
-               $result = $getShare->execute(array($uid));
+               $result = $getShare->execute([$uid]);
 
                if ($result) {
                        $shares = $getShare->fetchAll();
@@ -598,7 +598,7 @@ class Manager {
                        DELETE FROM `*PREFIX*share_external`
                        WHERE `user` = ?
                ');
-               return (bool)$query->execute(array($uid));
+               return (bool)$query->execute([$uid]);
        }
 
        /**
index 97870f733433b8e45b015d5c90802f349fc9ad84..e405d8c447247be9f03b517460869cd835c9057b 100644 (file)
@@ -85,13 +85,13 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage {
                $this->mountPoint = $options['mountpoint'];
                $this->token = $options['token'];
 
-               parent::__construct(array(
+               parent::__construct([
                        'secure' => $secure,
                        'host' => $host,
                        'root' => $root,
                        'user' => $options['token'],
                        'password' => (string)$options['password']
-               ));
+               ]);
        }
 
        public function getWatcher($path = '', $storage = null) {
index a3a041142eb9f9947160fb8144642ae9e92e309d..7bde5979ce11316d4029d91e1b39dd644817926b 100644 (file)
@@ -117,7 +117,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
                        }
                }
 
-               $excludeList = is_array($exclude) ? $exclude : array();
+               $excludeList = is_array($exclude) ? $exclude : [];
 
                return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
        }
@@ -126,17 +126,17 @@ class File implements \OCP\Share_Backend_File_Dependent {
                if ($format === self::FORMAT_SHARED_STORAGE) {
                        // Only 1 item should come through for this format call
                        $item = array_shift($items);
-                       return array(
+                       return [
                                'parent' => $item['parent'],
                                'path' => $item['path'],
                                'storage' => $item['storage'],
                                'permissions' => $item['permissions'],
                                'uid_owner' => $item['uid_owner'],
-                       );
+                       ];
                } else if ($format === self::FORMAT_GET_FOLDER_CONTENTS) {
-                       $files = array();
+                       $files = [];
                        foreach ($items as $item) {
-                               $file = array();
+                               $file = [];
                                $file['fileid'] = $item['file_source'];
                                $file['storage'] = $item['storage'];
                                $file['path'] = $item['file_target'];
@@ -157,31 +157,31 @@ class File implements \OCP\Share_Backend_File_Dependent {
                        }
                        return $files;
                } else if ($format === self::FORMAT_OPENDIR) {
-                       $files = array();
+                       $files = [];
                        foreach ($items as $item) {
                                $files[] = basename($item['file_target']);
                        }
                        return $files;
                } else if ($format === self::FORMAT_GET_ALL) {
-                       $ids = array();
+                       $ids = [];
                        foreach ($items as $item) {
                                $ids[] = $item['file_source'];
                        }
                        return $ids;
                } else if ($format === self::FORMAT_PERMISSIONS) {
-                       $filePermissions = array();
+                       $filePermissions = [];
                        foreach ($items as $item) {
                                $filePermissions[$item['file_source']] = $item['permissions'];
                        }
                        return $filePermissions;
                } else if ($format === self::FORMAT_TARGET_NAMES) {
-                       $targets = array();
+                       $targets = [];
                        foreach ($items as $item) {
                                $targets[] = $item['file_target'];
                        }
                        return $targets;
                }
-               return array();
+               return [];
        }
 
        /**
index fd4bb2491fa8c3fec246ebded8fb70fc91f77da5..0c1ea18667ce3b7551f4d8800ec25a6611a72887 100644 (file)
@@ -39,7 +39,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
         * @return array with shares
         */
        public function getParents($itemSource, $shareWith = null, $owner = null) {
-               $result = array();
+               $result = [];
                $parent = $this->getParentId($itemSource);
 
                $userManager = \OC::$server->getUserManager();
@@ -89,8 +89,8 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
        }
 
        public function getChildren($itemSource) {
-               $children = array();
-               $parents = array($itemSource);
+               $children = [];
+               $parents = [$itemSource];
 
                $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
                $qb->select('id')
@@ -123,9 +123,9 @@ class Folder extends File implements \OCP\Share_Backend_Collection {
 
                        $result = $qb->execute();
 
-                       $parents = array();
+                       $parents = [];
                        while ($file = $result->fetch()) {
-                               $children[] = array('source' => $file['fileid'], 'file_path' => $file['name']);
+                               $children[] = ['source' => $file['fileid'], 'file_path' => $file['name']];
                                // If a child folder is found look inside it
                                if ((int) $file['mimetype'] === $mimetype) {
                                        $parents[] = $file['fileid'];
index 0baa36ac985fbafd393b657819d3f82ee6abaf8c..ea0163e80b21cd5bc637704842203bae8bde8d96 100644 (file)
@@ -285,11 +285,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
                                                }
                                        }
                        }
-                       $info = array(
+                       $info = [
                                'target' => $this->getMountPoint() . $path,
                                'source' => $source,
                                'mode' => $mode,
-                       );
+                       ];
                        \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'fopen', $info);
                        return $this->nonMaskedStorage->fopen($this->getUnjailedPath($path), $mode);
                }
index 1fcdf2fe505a80cf3389803406fe090f038b6939..99cdb882206b7dd7aadfe5143f12a17df852913a 100644 (file)
@@ -34,7 +34,7 @@ if ($token !== '') {
        } else {
                http_response_code(307);
        }
-       header('Location: ' . $urlGenerator->linkToRoute($route, array('token' => $token)));
+       header('Location: ' . $urlGenerator->linkToRoute($route, ['token' => $token]));
 } else {
        http_response_code(404);
        $tmpl = new OCP\Template('', '404', 'guest');
index 792b4d238045b64ca38fd1ae675221c428f79187..a9cfaae9df13b0b54b81b8ae1e592c6d08e2ef76 100644 (file)
@@ -75,7 +75,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
                                        <div class="directDownload">
                                                <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
                                                        <span class="icon icon-download"></span>
-                                                       <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
+                                                       <?php p($l->t('Download %s', [$_['filename']]))?> (<?php p($_['fileSize']) ?>)
                                                </a>
                                        </div>
                                <?php endif; ?>
index c510c4dad98226c399d9b833b77c4338ead56691..a356525260fc947f64165909200751e0c723ad2f 100644 (file)
@@ -648,12 +648,12 @@ class ApiTest extends TestCase {
                $share3->setStatus(IShare::STATUS_ACCEPTED);
                $this->shareManager->updateShare($share3);
 
-               $testValues=array(
-                       array('query' => $this->folder,
-                               'expectedResult' => $this->folder . $this->filename),
-                       array('query' => $this->folder . $this->subfolder,
-                               'expectedResult' => $this->folder . $this->subfolder . $this->filename),
-               );
+               $testValues=[
+                       ['query' => $this->folder,
+                               'expectedResult' => $this->folder . $this->filename],
+                       ['query' => $this->folder . $this->subfolder,
+                               'expectedResult' => $this->folder . $this->subfolder . $this->filename],
+               ];
 
                foreach ($testValues as $value) {
                        $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER2);
@@ -1214,7 +1214,7 @@ class ApiTest extends TestCase {
         */
        public static function initTestMountPointsHook($data) {
                if ($data['user'] === self::TEST_FILES_SHARING_API_USER1) {
-                       \OC\Files\Filesystem::mount(self::$tempStorage, array(), '/' . self::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME);
+                       \OC\Files\Filesystem::mount(self::$tempStorage, [], '/' . self::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME);
                }
        }
 
@@ -1222,7 +1222,7 @@ class ApiTest extends TestCase {
         * Tests mounting a folder that is an external storage mount point.
         */
        public function testShareStorageMountPoint() {
-               $tempStorage = new \OC\Files\Storage\Temporary(array());
+               $tempStorage = new \OC\Files\Storage\Temporary([]);
                $tempStorage->file_put_contents('test.txt', 'abcdef');
                $tempStorage->getScanner()->scan('');
 
index 1c05e70f080a66ef33432fa1ca3582f8d4063787..cba90e8f9e61a39b5b564e81313ae462672f2ec3 100644 (file)
@@ -148,63 +148,63 @@ class CacheTest extends TestCase {
        }
 
        function searchDataProvider() {
-               return array(
-                       array('%another%',
-                               array(
-                                       array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
-                                       array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
-                               )
-                       ),
-                       array('%Another%',
-                               array(
-                                       array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
-                                       array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
-                               )
-                       ),
-                       array('%dir%',
-                               array(
-                                       array('name' => 'emptydir', 'path' => 'emptydir'),
-                                       array('name' => 'subdir', 'path' => 'subdir'),
-                                       array('name' => 'shareddir', 'path' => ''),
-                               )
-                       ),
-                       array('%Dir%',
-                               array(
-                                       array('name' => 'emptydir', 'path' => 'emptydir'),
-                                       array('name' => 'subdir', 'path' => 'subdir'),
-                                       array('name' => 'shareddir', 'path' => ''),
-                               )
-                       ),
-                       array('%txt%',
-                               array(
-                                       array('name' => 'bar.txt', 'path' => 'bar.txt'),
-                                       array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
-                                       array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
-                               )
-                       ),
-                       array('%Txt%',
-                               array(
-                                       array('name' => 'bar.txt', 'path' => 'bar.txt'),
-                                       array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
-                                       array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
-                               )
-                       ),
-                       array('%',
-                               array(
-                                       array('name' => 'bar.txt', 'path' => 'bar.txt'),
-                                       array('name' => 'emptydir', 'path' => 'emptydir'),
-                                       array('name' => 'subdir', 'path' => 'subdir'),
-                                       array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
-                                       array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
-                                       array('name' => 'not a text file.xml', 'path' => 'subdir/not a text file.xml'),
-                                       array('name' => 'shareddir', 'path' => ''),
-                               )
-                       ),
-                       array('%nonexistent%',
-                               array(
-                               )
-                       ),
-               );
+               return [
+                       ['%another%',
+                               [
+                                       ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+                                       ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+                               ]
+                       ],
+                       ['%Another%',
+                               [
+                                       ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+                                       ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+                               ]
+                       ],
+                       ['%dir%',
+                               [
+                                       ['name' => 'emptydir', 'path' => 'emptydir'],
+                                       ['name' => 'subdir', 'path' => 'subdir'],
+                                       ['name' => 'shareddir', 'path' => ''],
+                               ]
+                       ],
+                       ['%Dir%',
+                               [
+                                       ['name' => 'emptydir', 'path' => 'emptydir'],
+                                       ['name' => 'subdir', 'path' => 'subdir'],
+                                       ['name' => 'shareddir', 'path' => ''],
+                               ]
+                       ],
+                       ['%txt%',
+                               [
+                                       ['name' => 'bar.txt', 'path' => 'bar.txt'],
+                                       ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+                                       ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+                               ]
+                       ],
+                       ['%Txt%',
+                               [
+                                       ['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' => 'emptydir', 'path' => 'emptydir'],
+                                       ['name' => 'subdir', 'path' => 'subdir'],
+                                       ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+                                       ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+                                       ['name' => 'not a text file.xml', 'path' => 'subdir/not a text file.xml'],
+                                       ['name' => 'shareddir', 'path' => ''],
+                               ]
+                       ],
+                       ['%nonexistent%',
+                               [
+                               ]
+                       ],
+               ];
        }
 
        /**
@@ -226,20 +226,20 @@ class CacheTest extends TestCase {
         */
        function testSearchByMime() {
                $results = $this->sharedStorage->getCache()->searchByMime('text');
-               $check = array(
-                               array(
+               $check = [
+                               [
                                        'name' => 'bar.txt',
                                        'path' => 'bar.txt'
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'another too.txt',
                                        'path' => 'subdir/another too.txt'
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'another.txt',
                                        'path' => 'subdir/another.txt'
-                               ),
-                       );
+                               ],
+                       ];
                $this->verifyFiles($check, $results);
        }
 
@@ -250,27 +250,27 @@ class CacheTest extends TestCase {
                // additional root will always contain the example file "welcome.txt",
                //  so this will be part of the result
                $this->verifyFiles(
-                       array(
-                               array(
+                       [
+                               [
                                        'name' => 'welcome.txt',
                                        'path' => 'files/welcome.txt',
                                        'mimetype' => 'text/plain',
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'shareddir',
                                        'path' => 'files/shareddir',
                                        'mimetype' => 'httpd/unix-directory',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'shared single file.txt',
                                        'path' => 'files/shared single file.txt',
                                        'mimetype' => 'text/plain',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                       ),
+                               ],
+                       ],
                        $results
                );
        }
@@ -279,29 +279,29 @@ class CacheTest extends TestCase {
                $results = $this->user2View->getDirectoryContent('/shareddir');
 
                $this->verifyFiles(
-                       array(
-                               array(
+                       [
+                               [
                                        'name' => 'bar.txt',
                                        'path' => 'bar.txt',
                                        'mimetype' => 'text/plain',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'emptydir',
                                        'path' => 'emptydir',
                                        'mimetype' => 'httpd/unix-directory',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'subdir',
                                        'path' => 'subdir',
                                        'mimetype' => 'httpd/unix-directory',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                       ),
+                               ],
+                       ],
                        $results
                );
        }
@@ -327,29 +327,29 @@ class CacheTest extends TestCase {
                $results = $thirdView->getDirectoryContent('/subdir');
 
                $this->verifyFiles(
-                       array(
-                               array(
+                       [
+                               [
                                        'name' => 'another too.txt',
                                        'path' => 'another too.txt',
                                        'mimetype' => 'text/plain',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'another.txt',
                                        'path' => 'another.txt',
                                        'mimetype' => 'text/plain',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                               array(
+                               ],
+                               [
                                        'name' => 'not a text file.xml',
                                        'path' => 'not a text file.xml',
                                        'mimetype' => 'application/xml',
                                        'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
                                        'displayname_owner' => 'User One',
-                               ),
-                       ),
+                               ],
+                       ],
                        $results
                );
 
@@ -376,7 +376,7 @@ class CacheTest extends TestCase {
                                }
                        }
                }
-               $this->assertEquals(array(), $results);
+               $this->assertEquals([], $results);
        }
 
        /**
index 69b00ff9424596c2fd14ae61a7a844c47941fdff..e8fb3454e1e320619a3d0fb446a4cbc920ac4bdd 100644 (file)
@@ -1525,7 +1525,7 @@ class ShareAPIControllerTest extends TestCase {
                                ->willReturn(true);
 
                        $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
-                               ->setMethods(array('canAccessShare'))
+                               ->setMethods(['canAccessShare'])
                                ->getMock();
                        $helper->method('canAccessShare')
                                ->with($share, $this->currentUser)
@@ -2170,7 +2170,7 @@ class ShareAPIControllerTest extends TestCase {
                        ->willReturn(true);
 
                $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
-                       ->setMethods(array('createShare'))
+                       ->setMethods(['createShare'])
                        ->getMock();
                $helper->method('createShare')
                        ->with(
@@ -2293,7 +2293,7 @@ class ShareAPIControllerTest extends TestCase {
                        ->willReturn(true);
 
                $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
-                       ->setMethods(array('createShare'))
+                       ->setMethods(['createShare'])
                        ->getMock();
                $helper->method('createShare')
                        ->with(
@@ -4291,7 +4291,7 @@ class ShareAPIControllerTest extends TestCase {
                                ->willReturn(true);
 
                        $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
-                               ->setMethods(array('formatShare'))
+                               ->setMethods(['formatShare'])
                                ->getMock();
                        $helper->method('formatShare')
                                ->with($share)
index 35807dffe821b5be08dbcd44e6695927e2a0e216..c560595a7b4e1810430847b8e988112d94fa86bd 100644 (file)
@@ -287,7 +287,7 @@ class ShareControllerTest extends \Test\TestCase {
                        });
 
                $response = $this->shareController->showShare();
-               $sharedTmplParams = array(
+               $sharedTmplParams = [
                        'displayName' => 'ownerDisplay',
                        'owner' => 'ownerUID',
                        'filename' => 'file1.txt',
@@ -315,7 +315,7 @@ class ShareControllerTest extends \Test\TestCase {
                        'note' => $note,
                        'hideDownload' => false,
                        'showgridview' => false
-               );
+               ];
 
                $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
                $csp->addAllowedFrameDomain('\'self\'');
@@ -427,7 +427,7 @@ class ShareControllerTest extends \Test\TestCase {
                        });
 
                $response = $this->shareController->showShare();
-               $sharedTmplParams = array(
+               $sharedTmplParams = [
                        'displayName' => 'ownerDisplay',
                        'owner' => 'ownerUID',
                        'filename' => 'file1.txt',
@@ -455,7 +455,7 @@ class ShareControllerTest extends \Test\TestCase {
                        'note' => $note,
                        'hideDownload' => true,
                        'showgridview' => false
-               );
+               ];
 
                $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
                $csp->addAllowedFrameDomain('\'self\'');
@@ -541,7 +541,7 @@ class ShareControllerTest extends \Test\TestCase {
                unset($responseParams['folder']);
                $response->setParams($responseParams);
 
-               $sharedTmplParams = array(
+               $sharedTmplParams = [
                        'displayName' => 'ownerDisplay',
                        'owner' => 'ownerUID',
                        'filename' => '/fileDrop',
@@ -569,7 +569,7 @@ class ShareControllerTest extends \Test\TestCase {
                        'note' => '',
                        'hideDownload' => false,
                        'showgridview' => false
-               );
+               ];
 
                $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
                $csp->addAllowedFrameDomain('\'self\'');
index 766f0232b87ef76d3b4640479c6241c101a47216..42cd05ebdf4ebd000c0dabee36299cafda446a32 100644 (file)
@@ -76,11 +76,11 @@ class CacheTest extends TestCase {
                );
                $this->cache->put(
                        'test.txt',
-                       array(
+                       [
                                'mimetype' => 'text/plain',
                                'size' => 5,
                                'mtime' => 123,
-                       )
+                       ]
                );
        }
 
@@ -107,19 +107,19 @@ class CacheTest extends TestCase {
        public function testGetFolderPopulatesOwner() {
                $dirId = $this->cache->put(
                        'subdir',
-                       array(
+                       [
                                'mimetype' => 'httpd/unix-directory',
                                'size' => 5,
                                'mtime' => 123,
-                       )
+                       ]
                );
                $this->cache->put(
                        'subdir/contents.txt',
-                       array(
+                       [
                                'mimetype' => 'text/plain',
                                'size' => 5,
                                'mtime' => 123,
-                       )
+                       ]
                );
 
                $results = $this->cache->getFolderContentsById($dirId);
index b4e84846ed4a3e69af6449b4b90173ebc9e6bac5..2a9577bccb97f4c1025be695c9594b06f1236156 100644 (file)
@@ -39,37 +39,37 @@ use OCP\Http\Client\IResponse;
 class ExternalStorageTest extends \Test\TestCase {
 
        function optionsProvider() {
-               return array(
-                       array(
+               return [
+                       [
                                'http://remoteserver:8080/owncloud',
                                'http://remoteserver:8080/owncloud/public.php/webdav/',
-                       ),
+                       ],
                        // extra slash
-                       array(
+                       [
                                'http://remoteserver:8080/owncloud/',
                                'http://remoteserver:8080/owncloud/public.php/webdav/',
-                       ),
+                       ],
                        // extra path
-                       array(
+                       [
                                'http://remoteserver:8080/myservices/owncloud/',
                                'http://remoteserver:8080/myservices/owncloud/public.php/webdav/',
-                       ),
+                       ],
                        // root path
-                       array(
+                       [
                                'http://remoteserver:8080/',
                                'http://remoteserver:8080/public.php/webdav/',
-                       ),
+                       ],
                        // without port
-                       array(
+                       [
                                'http://remoteserver/oc.test',
                                'http://remoteserver/oc.test/public.php/webdav/',
-                       ),
+                       ],
                        // https
-                       array(
+                       [
                                'https://remoteserver/',
                                'https://remoteserver/public.php/webdav/',
-                       ),
-               );
+                       ],
+               ];
        }
 
        private function getTestStorage($uri) {
@@ -91,7 +91,7 @@ class ExternalStorageTest extends \Test\TestCase {
                        ->willReturn($client);
 
                return new TestSharingExternalStorage(
-                       array(
+                       [
                                'cloudId' => new CloudId('testOwner@' . $uri, 'testOwner', $uri),
                                'remote' => $uri,
                                'owner' => 'testOwner',
@@ -101,7 +101,7 @@ class ExternalStorageTest extends \Test\TestCase {
                                'manager' => null,
                                'certificateManager' => $certificateManager,
                                'HttpClientService' => $httpClientService,
-                       )
+                       ]
                );
        }
 
index 508599841334512c37d6a7eb73cb6293b608d489..dddeb5cf5510ac4933f856703a33c54b92aa9ad4 100644 (file)
@@ -226,13 +226,13 @@ class ShareTest extends TestCase {
                $permission5 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE;
                $permission6 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE;
 
-               return array(
-                       array($permission1, false),
-                       array($permission3, true),
-                       array($permission4, true),
-                       array($permission5, false),
-                       array($permission6, false),
-               );
+               return [
+                       [$permission1, false],
+                       [$permission3, true],
+                       [$permission4, true],
+                       [$permission5, false],
+                       [$permission6, false],
+               ];
        }
 
        public function testFileOwner() {
index 55abbd20cbaefcf31ec11b0ae878e090d8131671..e63cb597950d6379d2e840892188a43e82f442a8 100644 (file)
@@ -251,14 +251,14 @@ class SharedMountTest extends TestCase {
        }
 
        public function dataProviderTestStripUserFilesPath() {
-               return array(
-                       array('/user/files/foo.txt', '/foo.txt', false),
-                       array('/user/files/folder/foo.txt', '/folder/foo.txt', false),
-                       array('/data/user/files/foo.txt', null, true),
-                       array('/data/user/files/', null, true),
-                       array('/files/foo.txt', null, true),
-                       array('/foo.txt', null, true),
-               );
+               return [
+                       ['/user/files/foo.txt', '/foo.txt', false],
+                       ['/user/files/folder/foo.txt', '/folder/foo.txt', false],
+                       ['/data/user/files/foo.txt', null, true],
+                       ['/data/user/files/', null, true],
+                       ['/files/foo.txt', null, true],
+                       ['/foo.txt', null, true],
+               ];
        }
 
        public function dataPermissionMovedGroupShare() {
index 59e411e47f77d5f0aed7e4b3ec5a95f3c1811e14..1c222055d4e95d3abf7b7500f412c9e5937707ce 100644 (file)
@@ -406,7 +406,7 @@ class SharedStorageTest extends TestCase {
 
                $mountConfigManager = \OC::$server->getMountProviderCollection();
                $mounts = $mountConfigManager->getMountsForUser(\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));
-               array_walk($mounts, array(\OC\Files\Filesystem::getMountManager(), 'addMount'));
+               array_walk($mounts, [\OC\Files\Filesystem::getMountManager(), 'addMount']);
 
                $this->assertTrue($rootView->file_exists('/' . self::TEST_FILES_SHARING_API_USER3 . '/files/' . $this->filename));
 
@@ -443,7 +443,7 @@ class SharedStorageTest extends TestCase {
                list($sharedStorage,) = $view->resolvePath($this->folder);
                $this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
 
-               $sourceStorage = new \OC\Files\Storage\Temporary(array());
+               $sourceStorage = new \OC\Files\Storage\Temporary([]);
                $sourceStorage->file_put_contents('foo.txt', 'asd');
 
                $sharedStorage->copyFromStorage($sourceStorage, 'foo.txt', 'bar.txt');
@@ -476,7 +476,7 @@ class SharedStorageTest extends TestCase {
                list($sharedStorage,) = $view->resolvePath($this->folder);
                $this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
 
-               $sourceStorage = new \OC\Files\Storage\Temporary(array());
+               $sourceStorage = new \OC\Files\Storage\Temporary([]);
                $sourceStorage->file_put_contents('foo.txt', 'asd');
 
                $sharedStorage->moveFromStorage($sourceStorage, 'foo.txt', 'bar.txt');
index 093f6139dd3d61aa97da60dc60e8d3ebde586b02..0386828c4ca04e341c64be3114c2f728aa09428d 100644 (file)
@@ -115,9 +115,9 @@ class WatcherTest extends TestCase {
 
                $textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                $dataLen = strlen($textData);
-               $this->sharedCache->put('bar.txt', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
+               $this->sharedCache->put('bar.txt', ['mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain']);
                $this->sharedStorage->file_put_contents('bar.txt', $textData);
-               $this->sharedCache->put('', array('mtime' => 10, 'storage_mtime' => 10, 'size' => '-1', 'mimetype' => 'httpd/unix-directory'));
+               $this->sharedCache->put('', ['mtime' => 10, 'storage_mtime' => 10, 'size' => '-1', 'mimetype' => 'httpd/unix-directory']);
 
                // run the propagation code
                $this->sharedStorage->getWatcher()->checkUpdate('');
@@ -145,9 +145,9 @@ class WatcherTest extends TestCase {
 
                $textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                $dataLen = strlen($textData);
-               $this->sharedCache->put('subdir/bar.txt', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
+               $this->sharedCache->put('subdir/bar.txt', ['mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain']);
                $this->sharedStorage->file_put_contents('subdir/bar.txt', $textData);
-               $this->sharedCache->put('subdir', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
+               $this->sharedCache->put('subdir', ['mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain']);
 
                // run the propagation code
                $this->sharedStorage->getWatcher()->checkUpdate('subdir');
@@ -173,7 +173,7 @@ class WatcherTest extends TestCase {
         * @param string $path
         */
        function getOwnerDirSizes($path) {
-               $result = array();
+               $result = [];
 
                while ($path != '' && $path != '' && $path != '.') {
                        $cachedData = $this->ownerCache->get($path);
index 343734f882a2560a1f59298a39e60080f403359a..3cc096decbb342867b1bfdf1e498245c2f026cfe 100644 (file)
@@ -46,7 +46,7 @@ class Helper {
         * @return \OCP\Files\FileInfo[]
         */
        public static function getTrashFiles($dir, $user, $sortAttribute = '', $sortDescending = false) {
-               $result = array();
+               $result = [];
                $timestamp = null;
 
                $view = new \OC\Files\View('/' . $user . '/files_trashbin/files');
@@ -84,7 +84,7 @@ class Helper {
                                }
                        }
                        $type = $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file';
-                       $i = array(
+                       $i = [
                                'name' => $name,
                                'mtime' => $timestamp,
                                'mimetype' => $type === 'dir' ? 'httpd/unix-directory' : \OC::$server->getMimeTypeDetector()->detectPath($name),
@@ -94,7 +94,7 @@ class Helper {
                                'etag' => '',
                                'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE,
                                'fileid' => $entry->getId(),
-                       );
+                       ];
                        if ($originalPath) {
                                if ($originalPath !== '.') {
                                        $i['extraData'] = $originalPath . '/' . $originalName;
@@ -117,7 +117,7 @@ class Helper {
         * @param \OCP\Files\FileInfo[] $fileInfos file infos
         */
        public static function formatFileInfos($fileInfos) {
-               $files = array();
+               $files = [];
                foreach ($fileInfos as $i) {
                        $entry = \OCA\Files\Helper::formatFileInfo($i);
                        $entry['id'] = $i->getId();
index 8e94a2154000f3108aa2e938bcfcb9eb790fe8a5..0f1787223a20b4597f3a2d079e2a94c49460cd63 100644 (file)
@@ -122,13 +122,13 @@ class Trashbin {
        public static function getLocations($user) {
                $query = \OC_DB::prepare('SELECT `id`, `timestamp`, `location`'
                        . ' FROM `*PREFIX*files_trash` WHERE `user`=?');
-               $result = $query->execute(array($user));
-               $array = array();
+               $result = $query->execute([$user]);
+               $array = [];
                while ($row = $result->fetchRow()) {
                        if (isset($array[$row['id']])) {
                                $array[$row['id']][$row['timestamp']] = $row['location'];
                        } else {
-                               $array[$row['id']] = array($row['timestamp'] => $row['location']);
+                               $array[$row['id']] = [$row['timestamp'] => $row['location']];
                        }
                }
                return $array;
@@ -145,7 +145,7 @@ class Trashbin {
        public static function getLocation($user, $filename, $timestamp) {
                $query = \OC_DB::prepare('SELECT `location` FROM `*PREFIX*files_trash`'
                        . ' WHERE `user`=? AND `id`=? AND `timestamp`=?');
-               $result = $query->execute(array($user, $filename, $timestamp))->fetchAll();
+               $result = $query->execute([$user, $filename, $timestamp])->fetchAll();
                if (isset($result[0]['location'])) {
                        return $result[0]['location'];
                } else {
@@ -201,7 +201,7 @@ class Trashbin {
 
                if ($view->file_exists($target)) {
                        $query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)");
-                       $result = $query->execute(array($targetFilename, $timestamp, $targetLocation, $user));
+                       $result = $query->execute([$targetFilename, $timestamp, $targetLocation, $user]);
                        if (!$result) {
                                \OC::$server->getLogger()->error('trash bin database couldn\'t be updated for the files owner', ['app' => 'files_trashbin']);
                        }
@@ -281,12 +281,12 @@ class Trashbin {
 
                if ($moveSuccessful) {
                        $query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)");
-                       $result = $query->execute(array($filename, $timestamp, $location, $owner));
+                       $result = $query->execute([$filename, $timestamp, $location, $owner]);
                        if (!$result) {
                                \OC::$server->getLogger()->error('trash bin database couldn\'t be updated', ['app' => 'files_trashbin']);
                        }
-                       \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', array('filePath' => Filesystem::normalizePath($file_path),
-                               'trashPath' => Filesystem::normalizePath($filename . '.d' . $timestamp)));
+                       \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', ['filePath' => Filesystem::normalizePath($file_path),
+                               'trashPath' => Filesystem::normalizePath($filename . '.d' . $timestamp)]);
 
                        self::retainVersions($filename, $owner, $ownerPath, $timestamp);
 
@@ -433,14 +433,14 @@ class Trashbin {
                        $view->chroot('/' . $user . '/files');
                        $view->touch('/' . $location . '/' . $uniqueFilename, $mtime);
                        $view->chroot($fakeRoot);
-                       \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
-                               'trashPath' => Filesystem::normalizePath($file)));
+                       \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', ['filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
+                               'trashPath' => Filesystem::normalizePath($file)]);
 
                        self::restoreVersions($view, $file, $filename, $uniqueFilename, $location, $timestamp);
 
                        if ($timestamp) {
                                $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
-                               $query->execute(array($user, $filename, $timestamp));
+                               $query->execute([$user, $filename, $timestamp]);
                        }
 
                        return true;
@@ -512,14 +512,14 @@ class Trashbin {
                }
 
                // Array to store the relative path in (after the file is deleted, the view won't be able to relativise the path anymore)
-               $filePaths = array();
+               $filePaths = [];
                foreach($fileInfos as $fileInfo){
                        $filePaths[] = $view->getRelativePath($fileInfo->getPath());
                }
                unset($fileInfos); // save memory
 
                // Bulk PreDelete-Hook
-               \OC_Hook::emit('\OCP\Trashbin', 'preDeleteAll', array('paths' => $filePaths));
+               \OC_Hook::emit('\OCP\Trashbin', 'preDeleteAll', ['paths' => $filePaths]);
 
                // Single-File Hooks
                foreach($filePaths as $path){
@@ -529,10 +529,10 @@ class Trashbin {
                // actual file deletion
                $trash->delete();
                $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
-               $query->execute(array($user));
+               $query->execute([$user]);
 
                // Bulk PostDelete-Hook
-               \OC_Hook::emit('\OCP\Trashbin', 'deleteAll', array('paths' => $filePaths));
+               \OC_Hook::emit('\OCP\Trashbin', 'deleteAll', ['paths' => $filePaths]);
 
                // Single-File Hooks
                foreach($filePaths as $path){
@@ -550,7 +550,7 @@ class Trashbin {
         * @param string $path
         */
        protected static function emitTrashbinPreDelete($path){
-               \OC_Hook::emit('\OCP\Trashbin', 'preDelete', array('path' => $path));
+               \OC_Hook::emit('\OCP\Trashbin', 'preDelete', ['path' => $path]);
        }
 
        /**
@@ -558,7 +558,7 @@ class Trashbin {
         * @param string $path
         */
        protected static function emitTrashbinPostDelete($path){
-               \OC_Hook::emit('\OCP\Trashbin', 'delete', array('path' => $path));
+               \OC_Hook::emit('\OCP\Trashbin', 'delete', ['path' => $path]);
        }
 
        /**
@@ -577,7 +577,7 @@ class Trashbin {
 
                if ($timestamp) {
                        $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
-                       $query->execute(array($user, $filename, $timestamp));
+                       $query->execute([$user, $filename, $timestamp]);
                        $file = $filename . '.d' . $timestamp;
                } else {
                        $file = $filename;
@@ -660,7 +660,7 @@ class Trashbin {
         */
        public static function deleteUser($uid) {
                $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
-               return $query->execute(array($uid));
+               return $query->execute([$uid]);
        }
 
        /**
@@ -818,7 +818,7 @@ class Trashbin {
                        }
                }
 
-               return array($size, $count);
+               return [$size, $count];
        }
 
        /**
@@ -868,7 +868,7 @@ class Trashbin {
         */
        private static function getVersionsFromTrash($filename, $timestamp, $user) {
                $view = new View('/' . $user . '/files_trashbin/versions');
-               $versions = array();
+               $versions = [];
 
                //force rescan of versions, local storage may not have updated the cache
                if (!self::$scannedVersions) {
@@ -1015,6 +1015,6 @@ class Trashbin {
         * @return string
         */
        public static function preview_icon($path) {
-               return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_trashbin_preview', array('x' => 32, 'y' => 32, 'file' => $path));
+               return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_trashbin_preview', ['x' => 32, 'y' => 32, 'file' => $path]);
        }
 }
index 3bfbf2b35fd4081643e2bcfa21bd2644e6a94256..a906bf75853fa516433562b68a529d0ef5096ee3 100644 (file)
@@ -81,12 +81,12 @@ class CleanUpTest extends TestCase {
                $query->delete($this->trashTable)->execute();
                for ($i = 0; $i < 10; $i++) {
                        $query->insert($this->trashTable)
-                               ->values(array(
+                               ->values([
                                        'id' => $query->expr()->literal('file'.$i),
                                        'timestamp' => $query->expr()->literal($i),
                                        'location' => $query->expr()->literal('.'),
                                        'user' => $query->expr()->literal('user'.$i%2)
-                               ))->execute();
+                               ])->execute();
                }
                $getAllQuery = $this->dbConnection->getQueryBuilder();
                $result = $getAllQuery->select('id')
@@ -143,10 +143,10 @@ class CleanUpTest extends TestCase {
 
        }
        public function dataTestRemoveDeletedFiles() {
-               return array(
-                       array(true),
-                       array(false)
-               );
+               return [
+                       [true],
+                       [false]
+               ];
        }
 
        /**
index 6b57d111ea9a328ec1a0e75db23b3f6cd190722d..6047e488a7745c935d555a724d349728c04dc3a0 100644 (file)
@@ -145,8 +145,8 @@ class StorageTest extends \Test\TestCase {
         * isn't.
         */
        public function testCrossStorageDeleteFile() {
-               $storage2 = new Temporary(array());
-               \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+               $storage2 = new Temporary([]);
+               \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
 
                $this->userView->file_put_contents('substorage/subfile.txt', 'foo');
                $storage2->getScanner()->scan('');
@@ -171,8 +171,8 @@ class StorageTest extends \Test\TestCase {
         * isn't.
         */
        public function testCrossStorageDeleteFolder() {
-               $storage2 = new Temporary(array());
-               \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+               $storage2 = new Temporary([]);
+               \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
 
                $this->userView->mkdir('substorage/folder');
                $this->userView->file_put_contents('substorage/folder/subfile.txt', 'bar');
@@ -388,8 +388,8 @@ class StorageTest extends \Test\TestCase {
        public function testKeepFileAndVersionsWhenMovingFileBetweenStorages() {
                \OCA\Files_Versions\Hooks::connectHooks();
 
-               $storage2 = new Temporary(array());
-               \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+               $storage2 = new Temporary([]);
+               \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
 
                // trigger a version (multiple would not work because of the expire logic)
                $this->userView->file_put_contents('test.txt', 'v1');
@@ -429,8 +429,8 @@ class StorageTest extends \Test\TestCase {
        public function testKeepFileAndVersionsWhenMovingFolderBetweenStorages() {
                \OCA\Files_Versions\Hooks::connectHooks();
 
-               $storage2 = new Temporary(array());
-               \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+               $storage2 = new Temporary([]);
+               \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
 
                // trigger a version (multiple would not work because of the expire logic)
                $this->userView->file_put_contents('folder/inside.txt', 'v1');
index 4465bfbab3c0532dd0c75de2ba8799c7ad8620d7..bdcef91e37cd2fcc000c3b174f37ae9ea0a11c1f 100644 (file)
@@ -270,14 +270,14 @@ class TrashbinTest extends \Test\TestCase {
                $filesInTrashUser2AfterDelete = OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER2);
 
                // user2-1.txt should have been expired
-               $this->verifyArray($filesInTrashUser2AfterDelete, array('user2-2.txt', 'user1-4.txt'));
+               $this->verifyArray($filesInTrashUser2AfterDelete, ['user2-2.txt', 'user1-4.txt']);
 
                self::loginHelper(self::TEST_TRASHBIN_USER1);
 
                // user1-1.txt and user1-3.txt should have been expired
                $filesInTrashUser1AfterDelete = OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1);
 
-               $this->verifyArray($filesInTrashUser1AfterDelete, array('user1-2.txt', 'user1-4.txt'));
+               $this->verifyArray($filesInTrashUser1AfterDelete, ['user1-2.txt', 'user1-4.txt']);
        }
 
        /**
index 8df98d087d85b84dd6f6f809ed767f779553b668..b1d6c689c61d461700eaccefa73b27e942fd7c33 100644 (file)
@@ -67,24 +67,24 @@ class Storage {
        const DELETE_TRIGGER_QUOTA_EXCEEDED = 2;
 
        // files for which we can remove the versions after the delete operation was successful
-       private static $deletedFiles = array();
+       private static $deletedFiles = [];
 
-       private static $sourcePathAndUser = array();
+       private static $sourcePathAndUser = [];
 
-       private static $max_versions_per_interval = array(
+       private static $max_versions_per_interval = [
                //first 10sec, one version every 2sec
-               1 => array('intervalEndsAfter' => 10,      'step' => 2),
+               1 => ['intervalEndsAfter' => 10,      'step' => 2],
                //next minute, one version every 10sec
-               2 => array('intervalEndsAfter' => 60,      'step' => 10),
+               2 => ['intervalEndsAfter' => 60,      'step' => 10],
                //next hour, one version every minute
-               3 => array('intervalEndsAfter' => 3600,    'step' => 60),
+               3 => ['intervalEndsAfter' => 3600,    'step' => 60],
                //next 24h, one version every hour
-               4 => array('intervalEndsAfter' => 86400,   'step' => 3600),
+               4 => ['intervalEndsAfter' => 86400,   'step' => 3600],
                //next 30days, one version per day
-               5 => array('intervalEndsAfter' => 2592000, 'step' => 86400),
+               5 => ['intervalEndsAfter' => 2592000, 'step' => 86400],
                //until the end one version per week
-               6 => array('intervalEndsAfter' => -1,      'step' => 604800),
-       );
+               6 => ['intervalEndsAfter' => -1,      'step' => 604800],
+       ];
 
        /** @var \OCA\Files_Versions\AppInfo\Application */
        private static $application;
@@ -129,7 +129,7 @@ class Storage {
         */
        public static function setSourcePathAndUser($source) {
                list($uid, $path) = self::getUidAndFilename($source);
-               self::$sourcePathAndUser[$source] = array('uid' => $uid, 'path' => $path);
+               self::$sourcePathAndUser[$source] = ['uid' => $uid, 'path' => $path];
        }
 
        /**
@@ -147,7 +147,7 @@ class Storage {
                } else {
                        $uid = $path = false;
                }
-               return array($uid, $path);
+               return [$uid, $path];
        }
 
        /**
@@ -215,9 +215,9 @@ class Storage {
         */
        public static function markDeletedFile($path) {
                list($uid, $filename) = self::getUidAndFilename($path);
-               self::$deletedFiles[$path] = array(
+               self::$deletedFiles[$path] = [
                        'uid' => $uid,
-                       'filename' => $filename);
+                       'filename' => $filename];
        }
 
        /**
@@ -253,9 +253,9 @@ class Storage {
                        $versions = self::getVersions($uid, $filename);
                        if (!empty($versions)) {
                                foreach ($versions as $v) {
-                                       \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED));
+                                       \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
                                        self::deleteVersion($view, $filename . '.v' . $v['version']);
-                                       \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED));
+                                       \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
                                }
                        }
                }
@@ -378,11 +378,11 @@ class Storage {
                        $node = $userFolder->get($file);
 
                        // TODO: move away from those legacy hooks!
-                       \OC_Hook::emit('\OCP\Versions', 'rollback', array(
+                       \OC_Hook::emit('\OCP\Versions', 'rollback', [
                                'path' => $filename,
                                'revision' => $revision,
                                'node' => $node,
-                       ));
+                       ]);
                        return true;
                } else if ($versionCreated) {
                        self::deleteVersion($users_view, $version);
@@ -439,7 +439,7 @@ class Storage {
         * @return array versions newest version first
         */
        public static function getVersions($uid, $filename, $userFullPath = '') {
-               $versions = array();
+               $versions = [];
                if (empty($filename)) {
                        return $versions;
                }
@@ -518,9 +518,9 @@ class Storage {
                $view = new View('/' . $uid . '/files_versions');
                if (!empty($toDelete)) {
                        foreach ($toDelete as $version) {
-                               \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT));
+                               \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
                                self::deleteVersion($view, $version['path'] . '.v' . $version['version']);
-                               \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT));
+                               \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
                        }
                }
        }
@@ -559,8 +559,8 @@ class Storage {
         */
        private static function getAllVersions($uid) {
                $view = new View('/' . $uid . '/');
-               $dirs = array(self::VERSIONS_ROOT);
-               $versions = array();
+               $dirs = [self::VERSIONS_ROOT];
+               $versions = [];
 
                while (!empty($dirs)) {
                        $dir = array_pop($dirs);
@@ -577,7 +577,7 @@ class Storage {
                                        $version = substr($filePath, $versionsBegin + 2);
                                        $relpath = substr($filePath, $relPathStart, $versionsBegin - $relPathStart);
                                        $key = $version . '#' . $relpath;
-                                       $versions[$key] = array('path' => $relpath, 'timestamp' => $version);
+                                       $versions[$key] = ['path' => $relpath, 'timestamp' => $version];
                                }
                        }
                }
@@ -585,7 +585,7 @@ class Storage {
                // newest version first
                krsort($versions);
 
-               $result = array();
+               $result = [];
 
                foreach ($versions as $key => $value) {
                        $size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']);
@@ -638,7 +638,7 @@ class Storage {
         */
        protected static function getAutoExpireList($time, $versions) {
                $size = 0;
-               $toDelete = array();  // versions we want to delete
+               $toDelete = [];  // versions we want to delete
 
                $interval = 1;
                $step = Storage::$max_versions_per_interval[$interval]['step'];
@@ -682,7 +682,7 @@ class Storage {
                        }
                }
 
-               return array($toDelete, $size);
+               return [$toDelete, $size];
        }
 
        /**
@@ -791,9 +791,9 @@ class Storage {
 
                        $logger = \OC::$server->getLogger();
                        foreach($toDelete as $key => $path) {
-                               \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+                               \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
                                self::deleteVersion($versionsFileview, $path);
-                               \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+                               \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
                                unset($allVersions[$key]); // update array with the versions we keep
                                $logger->info('Expire: ' . $path, ['app' => 'files_versions']);
                        }
@@ -808,9 +808,9 @@ class Storage {
                        reset($allVersions);
                        while ($availableSpace < 0 && $i < $numOfVersions) {
                                $version = current($allVersions);
-                               \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+                               \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
                                self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']);
-                               \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+                               \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
                                \OC::$server->getLogger()->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']);
                                $versionsSize -= $version['size'];
                                $availableSpace += $version['size'];
index b5ed6c33a07c323152052db2d98a9b0216d48439..94f54f96d8968d2a99b9bd8b925ce5087c619c49 100644 (file)
@@ -90,10 +90,10 @@ class CleanupTest extends TestCase {
        }
 
        public function dataTestDeleteVersions() {
-               return array(
-                       array(true),
-                       array(false)
-               );
+               return [
+                       [true],
+                       [false]
+               ];
        }
 
 
index 53179bd6b30b10aab4cf9943ce361b07b6d8347c..c7eaec0a6994b1af9634642c34e958044401c54a 100644 (file)
@@ -159,121 +159,121 @@ class VersioningTest extends \Test\TestCase {
        }
 
        public function versionsProvider() {
-               return array(
+               return [
                        // first set of versions uniformly distributed versions
-                       array(
-                               array(
+                       [
+                               [
                                        // first slice (10sec) keep one version every 2 seconds
-                                       array("version" => 4999999, "path" => "keep", "size" => 1),
-                                       array("version" => 4999998, "path" => "delete", "size" => 1),
-                                       array("version" => 4999997, "path" => "keep", "size" => 1),
-                                       array("version" => 4999995, "path" => "keep", "size" => 1),
-                                       array("version" => 4999994, "path" => "delete", "size" => 1),
+                                       ["version" => 4999999, "path" => "keep", "size" => 1],
+                                       ["version" => 4999998, "path" => "delete", "size" => 1],
+                                       ["version" => 4999997, "path" => "keep", "size" => 1],
+                                       ["version" => 4999995, "path" => "keep", "size" => 1],
+                                       ["version" => 4999994, "path" => "delete", "size" => 1],
                                        //next slice (60sec) starts at 4999990 keep one version every 10 secons
-                                       array("version" => 4999988, "path" => "keep", "size" => 1),
-                                       array("version" => 4999978, "path" => "keep", "size" => 1),
-                                       array("version" => 4999975, "path" => "delete", "size" => 1),
-                                       array("version" => 4999972, "path" => "delete", "size" => 1),
-                                       array("version" => 4999967, "path" => "keep", "size" => 1),
-                                       array("version" => 4999958, "path" => "delete", "size" => 1),
-                                       array("version" => 4999957, "path" => "keep", "size" => 1),
+                                       ["version" => 4999988, "path" => "keep", "size" => 1],
+                                       ["version" => 4999978, "path" => "keep", "size" => 1],
+                                       ["version" => 4999975, "path" => "delete", "size" => 1],
+                                       ["version" => 4999972, "path" => "delete", "size" => 1],
+                                       ["version" => 4999967, "path" => "keep", "size" => 1],
+                                       ["version" => 4999958, "path" => "delete", "size" => 1],
+                                       ["version" => 4999957, "path" => "keep", "size" => 1],
                                        //next slice (3600sec) start at 4999940 keep one version every 60 seconds
-                                       array("version" => 4999900, "path" => "keep", "size" => 1),
-                                       array("version" => 4999841, "path" => "delete", "size" => 1),
-                                       array("version" => 4999840, "path" => "keep", "size" => 1),
-                                       array("version" => 4999780, "path" => "keep", "size" => 1),
-                                       array("version" => 4996401, "path" => "keep", "size" => 1),
+                                       ["version" => 4999900, "path" => "keep", "size" => 1],
+                                       ["version" => 4999841, "path" => "delete", "size" => 1],
+                                       ["version" => 4999840, "path" => "keep", "size" => 1],
+                                       ["version" => 4999780, "path" => "keep", "size" => 1],
+                                       ["version" => 4996401, "path" => "keep", "size" => 1],
                                        // next slice (86400sec) start at 4996400 keep one version every 3600 seconds
-                                       array("version" => 4996350, "path" => "delete", "size" => 1),
-                                       array("version" => 4992800, "path" => "keep", "size" => 1),
-                                       array("version" => 4989800, "path" => "delete", "size" => 1),
-                                       array("version" => 4989700, "path" => "delete", "size" => 1),
-                                       array("version" => 4989200, "path" => "keep", "size" => 1),
+                                       ["version" => 4996350, "path" => "delete", "size" => 1],
+                                       ["version" => 4992800, "path" => "keep", "size" => 1],
+                                       ["version" => 4989800, "path" => "delete", "size" => 1],
+                                       ["version" => 4989700, "path" => "delete", "size" => 1],
+                                       ["version" => 4989200, "path" => "keep", "size" => 1],
                                        // next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
-                                       array("version" => 4913600, "path" => "keep", "size" => 1),
-                                       array("version" => 4852800, "path" => "delete", "size" => 1),
-                                       array("version" => 4827201, "path" => "delete", "size" => 1),
-                                       array("version" => 4827200, "path" => "keep", "size" => 1),
-                                       array("version" => 4777201, "path" => "delete", "size" => 1),
-                                       array("version" => 4777501, "path" => "delete", "size" => 1),
-                                       array("version" => 4740000, "path" => "keep", "size" => 1),
+                                       ["version" => 4913600, "path" => "keep", "size" => 1],
+                                       ["version" => 4852800, "path" => "delete", "size" => 1],
+                                       ["version" => 4827201, "path" => "delete", "size" => 1],
+                                       ["version" => 4827200, "path" => "keep", "size" => 1],
+                                       ["version" => 4777201, "path" => "delete", "size" => 1],
+                                       ["version" => 4777501, "path" => "delete", "size" => 1],
+                                       ["version" => 4740000, "path" => "keep", "size" => 1],
                                        // final slice starts at 2408000 keep one version every 604800 secons
-                                       array("version" => 2408000, "path" => "keep", "size" => 1),
-                                       array("version" => 1803201, "path" => "delete", "size" => 1),
-                                       array("version" => 1803200, "path" => "keep", "size" => 1),
-                                       array("version" => 1800199, "path" => "delete", "size" => 1),
-                                       array("version" => 1800100, "path" => "delete", "size" => 1),
-                                       array("version" => 1198300, "path" => "keep", "size" => 1),
-                               ),
+                                       ["version" => 2408000, "path" => "keep", "size" => 1],
+                                       ["version" => 1803201, "path" => "delete", "size" => 1],
+                                       ["version" => 1803200, "path" => "keep", "size" => 1],
+                                       ["version" => 1800199, "path" => "delete", "size" => 1],
+                                       ["version" => 1800100, "path" => "delete", "size" => 1],
+                                       ["version" => 1198300, "path" => "keep", "size" => 1],
+                               ],
                                16 // size of all deleted files (every file has the size 1)
-                       ),
+                       ],
                        // second set of versions, here we have only really old versions
-                       array(
-                               array(
+                       [
+                               [
                                        // first slice (10sec) keep one version every 2 seconds
                                        // next slice (60sec) starts at 4999990 keep one version every 10 secons
                                        // next slice (3600sec) start at 4999940 keep one version every 60 seconds
                                        // next slice (86400sec) start at 4996400 keep one version every 3600 seconds
-                                       array("version" => 4996400, "path" => "keep", "size" => 1),
-                                       array("version" => 4996350, "path" => "delete", "size" => 1),
-                                       array("version" => 4996350, "path" => "delete", "size" => 1),
-                                       array("version" => 4992800, "path" => "keep", "size" => 1),
-                                       array("version" => 4989800, "path" => "delete", "size" => 1),
-                                       array("version" => 4989700, "path" => "delete", "size" => 1),
-                                       array("version" => 4989200, "path" => "keep", "size" => 1),
+                                       ["version" => 4996400, "path" => "keep", "size" => 1],
+                                       ["version" => 4996350, "path" => "delete", "size" => 1],
+                                       ["version" => 4996350, "path" => "delete", "size" => 1],
+                                       ["version" => 4992800, "path" => "keep", "size" => 1],
+                                       ["version" => 4989800, "path" => "delete", "size" => 1],
+                                       ["version" => 4989700, "path" => "delete", "size" => 1],
+                                       ["version" => 4989200, "path" => "keep", "size" => 1],
                                        // next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
-                                       array("version" => 4913600, "path" => "keep", "size" => 1),
-                                       array("version" => 4852800, "path" => "delete", "size" => 1),
-                                       array("version" => 4827201, "path" => "delete", "size" => 1),
-                                       array("version" => 4827200, "path" => "keep", "size" => 1),
-                                       array("version" => 4777201, "path" => "delete", "size" => 1),
-                                       array("version" => 4777501, "path" => "delete", "size" => 1),
-                                       array("version" => 4740000, "path" => "keep", "size" => 1),
+                                       ["version" => 4913600, "path" => "keep", "size" => 1],
+                                       ["version" => 4852800, "path" => "delete", "size" => 1],
+                                       ["version" => 4827201, "path" => "delete", "size" => 1],
+                                       ["version" => 4827200, "path" => "keep", "size" => 1],
+                                       ["version" => 4777201, "path" => "delete", "size" => 1],
+                                       ["version" => 4777501, "path" => "delete", "size" => 1],
+                                       ["version" => 4740000, "path" => "keep", "size" => 1],
                                        // final slice starts at 2408000 keep one version every 604800 secons
-                                       array("version" => 2408000, "path" => "keep", "size" => 1),
-                                       array("version" => 1803201, "path" => "delete", "size" => 1),
-                                       array("version" => 1803200, "path" => "keep", "size" => 1),
-                                       array("version" => 1800199, "path" => "delete", "size" => 1),
-                                       array("version" => 1800100, "path" => "delete", "size" => 1),
-                                       array("version" => 1198300, "path" => "keep", "size" => 1),
-                               ),
+                                       ["version" => 2408000, "path" => "keep", "size" => 1],
+                                       ["version" => 1803201, "path" => "delete", "size" => 1],
+                                       ["version" => 1803200, "path" => "keep", "size" => 1],
+                                       ["version" => 1800199, "path" => "delete", "size" => 1],
+                                       ["version" => 1800100, "path" => "delete", "size" => 1],
+                                       ["version" => 1198300, "path" => "keep", "size" => 1],
+                               ],
                                11 // size of all deleted files (every file has the size 1)
-                       ),
+                       ],
                        // third set of versions, with some gaps between
-                       array(
-                               array(
+                       [
+                               [
                                        // first slice (10sec) keep one version every 2 seconds
-                                       array("version" => 4999999, "path" => "keep", "size" => 1),
-                                       array("version" => 4999998, "path" => "delete", "size" => 1),
-                                       array("version" => 4999997, "path" => "keep", "size" => 1),
-                                       array("version" => 4999995, "path" => "keep", "size" => 1),
-                                       array("version" => 4999994, "path" => "delete", "size" => 1),
+                                       ["version" => 4999999, "path" => "keep", "size" => 1],
+                                       ["version" => 4999998, "path" => "delete", "size" => 1],
+                                       ["version" => 4999997, "path" => "keep", "size" => 1],
+                                       ["version" => 4999995, "path" => "keep", "size" => 1],
+                                       ["version" => 4999994, "path" => "delete", "size" => 1],
                                        //next slice (60sec) starts at 4999990 keep one version every 10 secons
-                                       array("version" => 4999988, "path" => "keep", "size" => 1),
-                                       array("version" => 4999978, "path" => "keep", "size" => 1),
+                                       ["version" => 4999988, "path" => "keep", "size" => 1],
+                                       ["version" => 4999978, "path" => "keep", "size" => 1],
                                        //next slice (3600sec) start at 4999940 keep one version every 60 seconds
                                        // next slice (86400sec) start at 4996400 keep one version every 3600 seconds
-                                       array("version" => 4989200, "path" => "keep", "size" => 1),
+                                       ["version" => 4989200, "path" => "keep", "size" => 1],
                                        // next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
-                                       array("version" => 4913600, "path" => "keep", "size" => 1),
-                                       array("version" => 4852800, "path" => "delete", "size" => 1),
-                                       array("version" => 4827201, "path" => "delete", "size" => 1),
-                                       array("version" => 4827200, "path" => "keep", "size" => 1),
-                                       array("version" => 4777201, "path" => "delete", "size" => 1),
-                                       array("version" => 4777501, "path" => "delete", "size" => 1),
-                                       array("version" => 4740000, "path" => "keep", "size" => 1),
+                                       ["version" => 4913600, "path" => "keep", "size" => 1],
+                                       ["version" => 4852800, "path" => "delete", "size" => 1],
+                                       ["version" => 4827201, "path" => "delete", "size" => 1],
+                                       ["version" => 4827200, "path" => "keep", "size" => 1],
+                                       ["version" => 4777201, "path" => "delete", "size" => 1],
+                                       ["version" => 4777501, "path" => "delete", "size" => 1],
+                                       ["version" => 4740000, "path" => "keep", "size" => 1],
                                        // final slice starts at 2408000 keep one version every 604800 secons
-                                       array("version" => 2408000, "path" => "keep", "size" => 1),
-                                       array("version" => 1803201, "path" => "delete", "size" => 1),
-                                       array("version" => 1803200, "path" => "keep", "size" => 1),
-                                       array("version" => 1800199, "path" => "delete", "size" => 1),
-                                       array("version" => 1800100, "path" => "delete", "size" => 1),
-                                       array("version" => 1198300, "path" => "keep", "size" => 1),
-                               ),
+                                       ["version" => 2408000, "path" => "keep", "size" => 1],
+                                       ["version" => 1803201, "path" => "delete", "size" => 1],
+                                       ["version" => 1803200, "path" => "keep", "size" => 1],
+                                       ["version" => 1800199, "path" => "delete", "size" => 1],
+                                       ["version" => 1800100, "path" => "delete", "size" => 1],
+                                       ["version" => 1198300, "path" => "keep", "size" => 1],
+                               ],
                                9 // size of all deleted files (every file has the size 1)
-                       ),
+                       ],
 
-               );
+               ];
        }
 
        public function testRename() {
@@ -647,8 +647,8 @@ class VersioningTest extends \Test\TestCase {
        }
 
        public function testRestoreCrossStorage() {
-               $storage2 = new Temporary(array());
-               \OC\Files\Filesystem::mount($storage2, array(), self::TEST_VERSIONS_USER . '/files/sub');
+               $storage2 = new Temporary([]);
+               \OC\Files\Filesystem::mount($storage2, [], self::TEST_VERSIONS_USER . '/files/sub');
 
                $this->doTestRestore();
        }
@@ -787,13 +787,13 @@ class VersioningTest extends \Test\TestCase {
                $this->assertEquals('test file', $this->rootView->file_get_contents($filePath));
                $info1 = $this->rootView->getFileInfo($filePath);
 
-               $params = array();
+               $params = [];
                $this->connectMockHooks('rollback', $params);
 
                $this->assertTrue(\OCA\Files_Versions\Storage::rollback('sub/test.txt', $t2, $this->user1));
-               $expectedParams = array(
+               $expectedParams = [
                        'path' => '/sub/test.txt',
-               );
+               ];
 
                $this->assertEquals($expectedParams['path'], $params['path']);
                $this->assertTrue(array_key_exists('revision', $params));
index 63ea0b5e76ee466e04683273f4e211425f2c5d85..a2dfa5bac41c062d645e74be3688748bfed4a86b 100644 (file)
@@ -36,7 +36,7 @@ use OCP\Defaults;
 use OCP\Util;
 
 class Application extends App {
-       public function __construct(array $urlParams = array()) {
+       public function __construct(array $urlParams = []) {
                parent::__construct('provisioning_api', $urlParams);
 
                $container = $this->getContainer();
index 7c9de539c7c19b274701ab9f595f35fe59d04f19..e54025856fed01f0f640ae98ac0e941bae9a50fc 100644 (file)
@@ -101,7 +101,7 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
                $result = $this->api->getApps('disabled');
                $data = $result->getData();
                $apps = (new \OC_App)->listAllApps();
-               $list =  array();
+               $list =  [];
                foreach($apps as $app) {
                        $list[] = $app['id'];
                }
index 5416e686ee3466cd5f5e5267d6433ac8a8e0074a..bb50786ee868ed262db824ee0c8bcf732041777a 100644 (file)
@@ -241,15 +241,15 @@ class GroupsControllerTest extends \Test\TestCase {
 
                $result = $this->api->getGroupsDetails($search, $limit, $offset);
                $this->assertEquals(['groups' => [
-                       Array(
+                       [
                                'id' => 'group1',
                                'displayname' => 'group1-name',
                                'usercount' => 123,
                                'disabled' => 11,
                                'canAdd' => true,
                                'canRemove' => true
-                       )
-                       Array(
+                       ]
+                       [
                                'id' => 'group2',
                                'displayname' => 'group2-name',
                                'usercount' => 123,
@@ -257,7 +257,7 @@ class GroupsControllerTest extends \Test\TestCase {
                                'canAdd' => true,
                                'canRemove' => true
                                
-                               )
+                               ]
                ]], $result->getData());
 
        }
index 12580abd757421eef52dae735da27b9a99ccd1e8..3d1310ca5d0010bdeee446a399607287ca0b0b52 100644 (file)
@@ -32,7 +32,7 @@ use OCP\IUserManager;
 abstract class TestCase extends \Test\TestCase {
 
        /** @var IUser[] */
-       protected $users = array();
+       protected $users = [];
 
        /** @var IUserManager */
        protected $userManager;
@@ -54,7 +54,7 @@ abstract class TestCase extends \Test\TestCase {
         * @return IUser[]|IUser
         */
        protected function generateUsers($num = 1) {
-               $users = array();
+               $users = [];
                for ($i = 0; $i < $num; $i++) {
                        $user = $this->userManager->createUser($this->getUniqueID(), 'password');
                        $this->users[] = $user;
index acc44501e642c42ebfc95df0473a6f2c30d40acd..e7b1a27a637765bc2b57b77ba623c463f2c8e0b1 100644 (file)
@@ -101,15 +101,15 @@ class AdminSettingsController extends Controller {
                                $anchor = strtolower($sectionName);
                                $anchor = str_replace(' ', '-', $anchor);
 
-                               return array(
+                               return [
                                        'anchor' => $anchor,
                                        'section-name' => $sectionName,
                                        'form' => $form
-                               );
+                               ];
                        }
-                       return array(
+                       return [
                                'form' => $form
-                       );
+                       ];
                }, $forms);
 
                $out = new Template('settings', 'settings/additional');
index 47067a9fcf59a5e57dc2b20028356cc4185d45c0..fc92fe8c775237cdc3be78e9307340df226c2b98 100644 (file)
@@ -258,7 +258,7 @@ class AppSettingsController extends Controller {
                        }
 
                        // fix groups to be an array
-                       $groups = array();
+                       $groups = [];
                        if (is_string($appData['groups'])) {
                                $groups = json_decode($appData['groups']);
                        }
index 18719a8565236d357024531473cfc5f33e23e051..12d8af3af17a49e42ab0d666307a7419f7be6d41 100644 (file)
@@ -94,15 +94,15 @@ class PersonalSettingsController extends Controller {
                                $anchor = strtolower($sectionName);
                                $anchor = str_replace(' ', '-', $anchor);
 
-                               return array(
+                               return [
                                        'anchor' => $anchor,
                                        'section-name' => $sectionName,
                                        'form' => $form
-                               );
+                               ];
                        }
-                       return array(
+                       return [
                                'form' => $form
-                       );
+                       ];
                }, $forms);
 
                $out = new Template('settings', 'settings/additional');
index cfbe35eb201c71ebffa43ddd9fb7d6933be46def..3f6bcd3a46c38383ae76452c7771c5776c4936af 100644 (file)
@@ -226,7 +226,7 @@ class UsersController extends Controller {
                $languages = $this->l10nFactory->getLanguages();
 
                /* FINAL DATA */
-               $serverData = array();
+               $serverData = [];
                // groups
                $serverData['groups'] = array_merge_recursive($adminGroup, [$disabledUsersGroup], $groups);
                // Various data
index ab1b6b5c745a3fa9ecc2a9770f45aa50cb83bd00..ffc507e50e0a593e5b5266e8274a02f839610920 100644 (file)
@@ -82,7 +82,7 @@ class SubadminMiddleware extends Middleware {
         */
        public function afterException($controller, $methodName, \Exception $exception) {
                if($exception instanceof NotAdminException) {
-                       $response = new TemplateResponse('core', '403', array(), 'guest');
+                       $response = new TemplateResponse('core', '403', [], 'guest');
                        $response->setStatus(Http::STATUS_FORBIDDEN);
                        return $response;
                }
index c8d9b3f8128494c58065df012f8bc7d5117477f4..69363cdd08f1b432d1b756ef9aba47d1ee29e819 100644 (file)
@@ -220,7 +220,7 @@ class PersonalInfo implements ISettings {
                }
 
                return array_merge(
-                       array('activelanguage' => $userLang),
+                       ['activelanguage' => $userLang],
                        $languages
                );
        }
index 46769434f422936da1c6aede8b572d73197d3097..5e59bfe353aff382ba2193a6b925a8088d4ea564 100644 (file)
@@ -969,7 +969,7 @@ class CheckSetupControllerTest extends TestCase {
                $this->checker
                                ->expects($this->once())
                                ->method('getResults')
-                               ->willReturn(array ( 'core' => array ( 'EXTRA_FILE' => array('/testfile' => array()), 'INVALID_HASH' => array ( '/.idea/workspace.xml' => array ( 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ), '/lib/private/integritycheck/checker.php' => array ( 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ), '/settings/controller/checksetupcontroller.php' => array ( 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ), ), ), 'bookmarks' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'dav' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'encryption' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'external' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'federation' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_antivirus' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_drop' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_external' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_pdfviewer' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_sharing' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_trashbin' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_versions' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_videoviewer' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'firstrunwizard' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'gitsmart' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'logreader' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ), ), 'password_policy' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'provisioning_api' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'sketch' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'threatblock' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'two_factor_auth' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'user_ldap' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'user_shibboleth' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), ));
+                               ->willReturn( [ 'core' =>  [ 'EXTRA_FILE' => ['/testfile' => []], 'INVALID_HASH' =>  [ '/.idea/workspace.xml' =>  [ 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ], '/lib/private/integritycheck/checker.php' =>  [ 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ], '/settings/controller/checksetupcontroller.php' =>  [ 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ], ], ], 'bookmarks' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'dav' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'encryption' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'external' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'federation' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_antivirus' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_drop' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_external' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_pdfviewer' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_sharing' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_trashbin' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_versions' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_videoviewer' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'firstrunwizard' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'gitsmart' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'logreader' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ], ], 'password_policy' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'provisioning_api' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'sketch' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'threatblock' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'two_factor_auth' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_ldap' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_shibboleth' =>  [ 'EXCEPTION' =>  [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], ]);
 
                $expected = new DataDisplayResponse(
                                'Technical information
index 8b40f002c32095c3365667c4ef6ad0272ab0c881..ad68d3b615ea530e7e6984e1af9af5148c63bf6f 100644 (file)
@@ -105,7 +105,7 @@ class SubadminMiddlewareTest extends \Test\TestCase {
        }
 
        public function testAfterNotAdminException() {
-               $expectedResponse = new TemplateResponse('core', '403', array(), 'guest');
+               $expectedResponse = new TemplateResponse('core', '403', [], 'guest');
                $expectedResponse->setStatus(403);
                $this->assertEquals($expectedResponse, $this->subadminMiddleware->afterException($this->controller, 'foo', new NotAdminException('')));
        }
@@ -114,7 +114,7 @@ class SubadminMiddlewareTest extends \Test\TestCase {
        public function testAfterRegularException() {
                $this->expectException(\Exception::class);
 
-               $expectedResponse = new TemplateResponse('core', '403', array(), 'guest');
+               $expectedResponse = new TemplateResponse('core', '403', [], 'guest');
                $expectedResponse->setStatus(403);
                $this->subadminMiddleware->afterException($this->controller, 'foo', new \Exception());
        }
index c6546860028425738059af69478e96611eb6328d..e24743aa40b557d65b7d5bd59abcc838ec98be33 100644 (file)
@@ -33,7 +33,7 @@ use OCP\Util;
 
 class Application extends App {
 
-       public function __construct(array $urlParams = array()) {
+       public function __construct(array $urlParams = []) {
                parent::__construct('sharebymail', $urlParams);
 
                $settingsManager = \OC::$server->query(Settings\SettingsManager::class);
index d2465a5797b459c9bf52eb933694628b7bbad32c..9f0362f1908e49da9046a9fa6e48dd6896a0b5f0 100644 (file)
@@ -180,7 +180,7 @@ class ShareByMailProvider implements IShareProvider {
                $alreadyShared = $this->getSharedWith($shareWith, \OCP\Share::SHARE_TYPE_EMAIL, $share->getNode(), 1, 0);
                if (!empty($alreadyShared)) {
                        $message = 'Sharing %1$s failed, this item is already shared with %2$s';
-                       $message_t = $this->l->t('Sharing %1$s failed, this item is already shared with %2$s', array($share->getNode()->getName(), $shareWith));
+                       $message_t = $this->l->t('Sharing %1$s failed, this item is already shared with %2$s', [$share->getNode()->getName(), $shareWith]);
                        $this->logger->debug(sprintf($message, $share->getNode()->getName(), $shareWith), ['app' => 'Federated File Sharing']);
                        throw new \Exception($message_t);
                }
@@ -416,7 +416,7 @@ class ShareByMailProvider implements IShareProvider {
                        'shareWith' => $shareWith,
                ]);
 
-               $emailTemplate->setSubject($this->l->t('%1$s shared »%2$s« with you', array($initiatorDisplayName, $filename)));
+               $emailTemplate->setSubject($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]));
                $emailTemplate->addHeader();
                $emailTemplate->addHeading($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false);
                $text = $this->l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]);
index da34d419d32a98eea9ae24b0186ece46e825771e..79ee279170a3d5ad34afd4a06e38ed10cd17a19d 100644 (file)
@@ -27,7 +27,7 @@ use OCA\Testing\AlternativeHomeUserBackend;
 use OCP\AppFramework\App;
 
 class Application extends App {
-       public function __construct (array $urlParams = array()) {
+       public function __construct (array $urlParams = []) {
                $appName = 'testing';
                parent::__construct($appName, $urlParams);
 
index 30dcf3d5a4fb85d865dd59869106eda99bf29e3c..c61f776ac09d7ddb73a48a2a7337fa2ac1d4ca14 100644 (file)
@@ -62,25 +62,25 @@ return ['routes' => [
                'name' => 'Theming#getManifest',
                'url' => '/manifest/{app}',
                'verb' => 'GET',
-               'defaults' => array('app' => 'core')
+               'defaults' => ['app' => 'core']
        ],
        [
                'name'  => 'Icon#getFavicon',
                'url' => '/favicon/{app}',
                'verb' => 'GET',
-               'defaults' => array('app' => 'core'),
+               'defaults' => ['app' => 'core'],
        ],
        [
                'name'  => 'Icon#getTouchIcon',
                'url' => '/icon/{app}',
                'verb' => 'GET',
-               'defaults' => array('app' => 'core'),
+               'defaults' => ['app' => 'core'],
        ],
        [
                'name'  => 'Icon#getThemedIcon',
                'url' => '/img/{app}/{image}',
                'verb' => 'GET',
-               'requirements' => array('image' => '.+')
+               'requirements' => ['image' => '.+']
        ],
 ]];
 
index 9e4efb6a4dc914a735665cf598e171193325f434..0a60d9f38f8088d76aa6cdd2e689f97ebe48242d 100644 (file)
@@ -142,7 +142,7 @@ class Util {
         * @return string|ISimpleFile path to app icon / file of logo
         */
        public function getAppIcon($app) {
-               $app = str_replace(array('\0', '/', '\\', '..'), '', $app);
+               $app = str_replace(['\0', '/', '\\', '..'], '', $app);
                try {
                        $appPath = $this->appManager->getAppPath($app);
                        $icon = $appPath . '/img/' . $app . '.svg';
@@ -173,8 +173,8 @@ class Util {
         * @return string|false absolute path to image
         */
        public function getAppImage($app, $image) {
-               $app = str_replace(array('\0', '/', '\\', '..'), '', $app);
-               $image = str_replace(array('\0', '\\', '..'), '', $image);
+               $app = str_replace(['\0', '/', '\\', '..'], '', $app);
+               $image = str_replace(['\0', '\\', '..'], '', $image);
                if ($app === "core") {
                        $icon = \OC::$SERVERROOT . '/core/img/' . $image;
                        if (file_exists($icon)) {
index 3e98162904c6fc3c17276cf5896c05d7103f5599..f847b818db07075b9837a2ef8c6983d8299e4566 100644 (file)
@@ -56,5 +56,5 @@ try {
        }
        \OC_JSON::success();
 } catch (\Exception $e) {
-       \OC_JSON::error(array('message' => $e->getMessage()));
+       \OC_JSON::error(['message' => $e->getMessage()]);
 }
index d6bce7439f7d5fa6c4e1a53a2118122325ec312f..c2bf4f265d07c055e522b488f77cdb2b541c0026 100644 (file)
@@ -36,5 +36,5 @@ if($helper->deleteServerConfiguration($prefix)) {
        \OC_JSON::success();
 } else {
        $l = \OC::$server->getL10N('user_ldap');
-       \OC_JSON::error(array('message' => $l->t('Failed to delete the server configuration')));
+       \OC_JSON::error(['message' => $l->t('Failed to delete the server configuration')]);
 }
index b8ed917de6ed736a408b7e44490c03351a2daea7..8c9a3a6c3f64e9e4a1f48bb33fdb0940ebdfa5be 100644 (file)
@@ -38,4 +38,4 @@ if (isset($configuration['ldap_agent_password']) && $configuration['ldap_agent_p
        // hide password
        $configuration['ldap_agent_password'] = '**PASSWORD SET**';
 }
-\OC_JSON::success(array('configuration' => $configuration));
+\OC_JSON::success(['configuration' => $configuration]);
index 9c6f63fc3de8e254abb924287e45f740f0e62140..9d93b2b89712e5f9437032ca20cd12a6d35a4c5a 100644 (file)
@@ -35,7 +35,7 @@ $lk = array_pop($serverConnections);
 $ln = (int)str_replace('s', '', $lk);
 $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
 
-$resultData = array('configPrefix' => $nk);
+$resultData = ['configPrefix' => $nk];
 
 $newConfig = new \OCA\User_LDAP\Configuration($nk, false);
 if(isset($_POST['copyConfig'])) {
index 31aa80d094539d03de0a594c42db175125c241de..fd8a2b0c1b578a4d728d8a9587739b9a64d1b099 100644 (file)
@@ -35,8 +35,8 @@ $prefix = (string)$_POST['ldap_serverconfig_chooser'];
 // Checkboxes are not submitted, when they are unchecked. Set them manually.
 // only legacy checkboxes (Advanced and Expert tab) need to be handled here,
 // the Wizard-like tabs handle it on their own
-$chkboxes = array('ldap_configuration_active', 'ldap_override_main_server',
-                                 'ldap_turn_off_cert_check');
+$chkboxes = ['ldap_configuration_active', 'ldap_override_main_server',
+                                 'ldap_turn_off_cert_check'];
 foreach($chkboxes as $boxid) {
        if(!isset($_POST[$boxid])) {
                $_POST[$boxid] = 0;
index 00393ff66e387151213b81d67a093270a02cde0d..a21cb4075584cc3f7d08e3f2c247279a49dbd950 100644 (file)
@@ -66,23 +66,23 @@ try {
                         * pass (like e.g. expected syntax error).
                         */
                        try {
-                               $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', array('dn'));
+                               $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', ['dn']);
                        } catch (\Exception $e) {
                                if($e->getCode() === 1) {
-                                       \OC_JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')));
+                                       \OC_JSON::error(['message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')]);
                                        exit;
                                }
                        }
-                       \OC_JSON::success(array('message'
-                       => $l->t('Valid configuration, connection established!')));
+                       \OC_JSON::success(['message'
+                       => $l->t('Valid configuration, connection established!')]);
                } else {
-                       \OC_JSON::error(array('message'
-                       => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.')));
+                       \OC_JSON::error(['message'
+                       => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.')]);
                }
        } else {
-               \OC_JSON::error(array('message'
-               => $l->t('Invalid configuration. Please have a look at the logs for further details.')));
+               \OC_JSON::error(['message'
+               => $l->t('Invalid configuration. Please have a look at the logs for further details.')]);
        }
 } catch (\Exception $e) {
-       \OC_JSON::error(array('message' => $e->getMessage()));
+       \OC_JSON::error(['message' => $e->getMessage()]);
 }
index 3cce732f07056463ecf4590a45af838429852f1d..1756e978de26f5cdac2fa681ff386c04494dc71d 100644 (file)
 $l = \OC::$server->getL10N('user_ldap');
 
 if(!isset($_POST['action'])) {
-       \OC_JSON::error(array('message' => $l->t('No action specified')));
+       \OC_JSON::error(['message' => $l->t('No action specified')]);
 }
 $action = (string)$_POST['action'];
 
 
 if(!isset($_POST['ldap_serverconfig_chooser'])) {
-       \OC_JSON::error(array('message' => $l->t('No configuration specified')));
+       \OC_JSON::error(['message' => $l->t('No configuration specified')]);
 }
 $prefix = (string)$_POST['ldap_serverconfig_chooser'];
 
@@ -99,7 +99,7 @@ switch($action) {
                                exit;
                        }
                } catch (\Exception $e) {
-                       \OC_JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode()));
+                       \OC_JSON::error(['message' => $e->getMessage(), 'code' => $e->getCode()]);
                        exit;
                }
                \OC_JSON::error();
@@ -115,7 +115,7 @@ switch($action) {
                                exit;
                        }
                } catch (\Exception $e) {
-                       \OC_JSON::error(array('message' => $e->getMessage()));
+                       \OC_JSON::error(['message' => $e->getMessage()]);
                        exit;
                }
                \OC_JSON::error();
@@ -127,15 +127,15 @@ switch($action) {
                $key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false;
                $val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null;
                if($key === false || is_null($val)) {
-                       \OC_JSON::error(array('message' => $l->t('No data specified')));
+                       \OC_JSON::error(['message' => $l->t('No data specified')]);
                        exit;
                }
-               $cfg = array($key => $val);
-               $setParameters = array();
+               $cfg = [$key => $val];
+               $setParameters = [];
                $configuration->setConfiguration($cfg, $setParameters);
                if(!in_array($key, $setParameters)) {
-                       \OC_JSON::error(array('message' => $l->t($key.
-                               ' Could not set configuration %s', $setParameters[0])));
+                       \OC_JSON::error(['message' => $l->t($key.
+                               ' Could not set configuration %s', $setParameters[0])]);
                        exit;
                }
                $configuration->saveConfiguration();
@@ -145,6 +145,6 @@ switch($action) {
                \OC_JSON::success();
                break;
        default:
-               \OC_JSON::error(array('message' => $l->t('Action does not exist')));
+               \OC_JSON::error(['message' => $l->t('Action does not exist')]);
                break;
 }
index a16e8f04cb21e04a82d40d3a33145b90f103d0df..6f6e3648e30fc177ac42442e0a3213fcdc5d192e 100644 (file)
@@ -75,7 +75,7 @@ class Access extends LDAPUtility {
        /**
         * @var string[] $cookies an array of returned Paged Result cookies
         */
-       protected $cookies = array();
+       protected $cookies = [];
 
        /**
         * @var string $lastCookie the last cookie returned from a Paged Results
@@ -268,9 +268,9 @@ class Access extends LDAPUtility {
         * @throws ServerNotAvailableException
         */
        public function executeRead($cr, $dn, $attribute, $filter, $maxResults) {
-               $this->initPagedSearch($filter, array($dn), array($attribute), $maxResults, 0);
+               $this->initPagedSearch($filter, [$dn], [$attribute], $maxResults, 0);
                $dn = $this->helper->DNasBaseParameter($dn);
-               $rr = @$this->invokeLDAPMethod('read', $cr, $dn, $filter, array($attribute));
+               $rr = @$this->invokeLDAPMethod('read', $cr, $dn, $filter, [$attribute]);
                if (!$this->ldap->isResource($rr)) {
                        if ($attribute !== '') {
                                //do not throw this message on userExists check, irritates
@@ -384,13 +384,13 @@ class Access extends LDAPUtility {
         * @return boolean if so true, otherwise false
         */
        private function resemblesDN($attr) {
-               $resemblingAttributes = array(
+               $resemblingAttributes = [
                        'dn',
                        'uniquemember',
                        'member',
                        // memberOf is an "operational" attribute, without a definition in any RFC
                        'memberof'
-               );
+               ];
                return in_array($attr, $resemblingAttributes);
        }
 
@@ -419,7 +419,7 @@ class Access extends LDAPUtility {
                        //not a valid DN
                        return '';
                }
-               $domainParts = array();
+               $domainParts = [];
                $dcFound = false;
                foreach($allParts as $part) {
                        if(!$dcFound && strpos($part, 'dc=') === 0) {
@@ -865,13 +865,13 @@ class Access extends LDAPUtility {
         */
        private function createAltInternalOwnCloudName($name, $isUser) {
                $originalTTL = $this->connection->ldapCacheTTL;
-               $this->connection->setConfiguration(array('ldapCacheTTL' => 0));
+               $this->connection->setConfiguration(['ldapCacheTTL' => 0]);
                if($isUser) {
                        $altName = $this->_createAltInternalOwnCloudNameForUsers($name);
                } else {
                        $altName = $this->_createAltInternalOwnCloudNameForGroups($name);
                }
-               $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL));
+               $this->connection->setConfiguration(['ldapCacheTTL' => $originalTTL]);
 
                return $altName;
        }
@@ -884,7 +884,7 @@ class Access extends LDAPUtility {
         * @param array $attributes optional, list of attributes to read
         * @return array
         */
-       public function fetchUsersByLoginName($loginName, $attributes = array('dn')) {
+       public function fetchUsersByLoginName($loginName, $attributes = ['dn']) {
                $loginName = $this->escapeFilterPart($loginName);
                $filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter);
                return $this->fetchListOfUsers($filter, $attributes);
@@ -996,13 +996,13 @@ class Access extends LDAPUtility {
                                        $attribute = array_keys($item)[0];
                                        $carry[] = $item[$attribute][0];
                                        return $carry;
-                               }, array());
+                               }, []);
                                return array_unique($list, SORT_LOCALE_STRING);
                        }
                }
 
                //error cause actually, maybe throw an exception in future.
-               return array();
+               return [];
        }
 
        /**
@@ -1033,7 +1033,7 @@ class Access extends LDAPUtility {
         * @return false|int
         * @throws ServerNotAvailableException
         */
-       public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) {
+       public function countUsers($filter, $attr = ['dn'], $limit = null, $offset = null) {
                $result = false;
                foreach($this->connection->ldapBaseUsers as $base) {
                        $count = $this->count($filter, [$base], $attr, $limit, $offset);
@@ -1072,7 +1072,7 @@ class Access extends LDAPUtility {
         * @return int|bool
         * @throws ServerNotAvailableException
         */
-       public function countGroups($filter, $attr = array('dn'), $limit = null, $offset = null) {
+       public function countGroups($filter, $attr = ['dn'], $limit = null, $offset = null) {
                $result = false;
                foreach($this->connection->ldapBaseGroups as $base) {
                        $count = $this->count($filter, [$base], $attr, $limit, $offset);
@@ -1122,7 +1122,7 @@ class Access extends LDAPUtility {
                        if ($command == 'controlPagedResultResponse') {
                                throw new \InvalidArgumentException('Invoker does not support controlPagedResultResponse, call LDAP Wrapper directly instead.');
                        } else {
-                               return call_user_func_array(array($this->ldap, $command), $arguments);
+                               return call_user_func_array([$this->ldap, $command], $arguments);
                        }
                };
                try {
@@ -1162,7 +1162,7 @@ class Access extends LDAPUtility {
         */
        private function executeSearch($filter, $base, &$attr = null, $limit = null, $offset = null) {
                if(!is_null($attr) && !is_array($attr)) {
-                       $attr = array(mb_strtolower($attr, 'UTF-8'));
+                       $attr = [mb_strtolower($attr, 'UTF-8')];
                }
 
                // See if we have a resource, in case not cancel with message
@@ -1177,7 +1177,7 @@ class Access extends LDAPUtility {
                //check whether paged search should be attempted
                $pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, (int)$limit, $offset);
 
-               $linkResources = array_pad(array(), count($base), $cr);
+               $linkResources = array_pad([], count($base), $cr);
                $sr = $this->invokeLDAPMethod('search', $linkResources, $base, $filter, $attr);
                // cannot use $cr anymore, might have changed in the previous call!
                $error = $this->ldap->errno($this->connection->getConnectionResource());
@@ -1186,7 +1186,7 @@ class Access extends LDAPUtility {
                        return false;
                }
 
-               return array($sr, $pagedSearchOK);
+               return [$sr, $pagedSearchOK];
        }
 
        /**
@@ -1349,7 +1349,7 @@ class Access extends LDAPUtility {
                                $this->processPagedSearchStatus($sr, $filter, $base, 1, $limitPerPage,
                                                                $offset, $pagedSearchOK,
                                                                $skipHandling);
-                               return array();
+                               return [];
                        }
 
                        $iFoundItems = 0;
@@ -1370,7 +1370,7 @@ class Access extends LDAPUtility {
                // if we're here, probably no connection resource is returned.
                // to make Nextcloud behave nicely, we simply give back an empty array.
                if(is_null($findings)) {
-                       return array();
+                       return [];
                }
 
                if(!is_null($attr)) {
@@ -1463,8 +1463,8 @@ class Access extends LDAPUtility {
                        $asterisk = '*';
                        $input = mb_substr($input, 1, null, 'UTF-8');
                }
-               $search  = array('*', '\\', '(', ')');
-               $replace = array('\\*', '\\\\', '\\(', '\\)');
+               $search  = ['*', '\\', '(', ')'];
+               $replace = ['\\*', '\\\\', '\\(', '\\)'];
                return $asterisk . str_replace($search, $replace, $input);
        }
 
@@ -1541,11 +1541,11 @@ class Access extends LDAPUtility {
                        throw new \Exception('searchAttributes must be an array with at least two string');
                }
                $searchWords = explode(' ', trim($search));
-               $wordFilters = array();
+               $wordFilters = [];
                foreach($searchWords as $word) {
                        $word = $this->prepareSearchTerm($word);
                        //every word needs to appear at least once
-                       $wordMatchOneAttrFilters = array();
+                       $wordMatchOneAttrFilters = [];
                        foreach($searchAttributes as $attr) {
                                $wordMatchOneAttrFilters[] = $attr . '=' . $word;
                        }
@@ -1563,7 +1563,7 @@ class Access extends LDAPUtility {
         * @return string the final filter part to use in LDAP searches
         */
        private function getFilterPartForSearch($search, $searchAttributes, $fallbackAttribute) {
-               $filter = array();
+               $filter = [];
                $haveMultiSearchAttributes = (is_array($searchAttributes) && count($searchAttributes) > 0);
                if($haveMultiSearchAttributes && strpos(trim($search), ' ') !== false) {
                        try {
@@ -1619,10 +1619,10 @@ class Access extends LDAPUtility {
         * @return string
         */
        public function getFilterForUserCount() {
-               $filter = $this->combineFilterWithAnd(array(
+               $filter = $this->combineFilterWithAnd([
                        $this->connection->ldapUserFilter,
                        $this->connection->ldapUserDisplayName . '=*'
-               ));
+               ]);
 
                return $filter;
        }
@@ -1635,10 +1635,10 @@ class Access extends LDAPUtility {
        public function areCredentialsValid($name, $password) {
                $name = $this->helper->DNasBaseParameter($name);
                $testConnection = clone $this->connection;
-               $credentials = array(
+               $credentials = [
                        'ldapAgentName' => $name,
                        'ldapAgentPassword' => $password
-               );
+               ];
                if(!$testConnection->setConfiguration($credentials)) {
                        return false;
                }
@@ -1919,7 +1919,7 @@ class Access extends LDAPUtility {
                // precision (see https://gist.github.com/bantu/886ac680b0aef5812f71)
                $iav = number_format(hexdec(bin2hex(substr($sid, 2, 6))), 0, '', '');
 
-               $subIDs = array();
+               $subIDs = [];
                for ($i = 0; $i < $numberSubID; $i++) {
                        $subID = unpack('V', substr($sid, $subIdStart + $subIdLength * $i, $subIdLength));
                        $subIDs[] = sprintf('%u', $subID[1]);
@@ -2065,7 +2065,7 @@ class Access extends LDAPUtility {
                                        // to start from 0 to come to the desired page. cookie value
                                        // of '0' is valid, because 389ds
                                        $reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit;
-                                       $this->search($filter, array($base), $attr, $limit, $reOffset, true);
+                                       $this->search($filter, [$base], $attr, $limit, $reOffset, true);
                                        $cookie = $this->getPagedResultCookie($base, $filter, $limit, $offset);
                                        //still no cookie? obviously, the server does not like us. Let's skip paging efforts.
                                        // '0' is valid, because 389ds
index fd33a0bc0dfe1b2ae3e5ed7c511343078bb63a00..46d08986617036662ba806105277d318540b7c23 100644 (file)
@@ -94,8 +94,8 @@ class ShowConfig extends Command {
                        ksort($configuration);
 
                        $table = new Table($output);
-                       $table->setHeaders(array('Configuration', $id));
-                       $rows = array();
+                       $table->setHeaders(['Configuration', $id]);
+                       $rows = [];
                        foreach($configuration as $key => $value) {
                                if($key === 'ldapAgentPassword' && !$withPassword) {
                                        $value = '***';
@@ -103,7 +103,7 @@ class ShowConfig extends Command {
                                if(is_array($value)) {
                                        $value = implode(';', $value);
                                }
-                               $rows[] = array($key, $value);
+                               $rows[] = [$key, $value];
                        }
                        $table->setRows($rows);
                        $table->render($output);
index 67ff73d4e91af44374f2791734b68e146d92e743..b38d2e972a2937ee02473146218dd2fa9a3228f2 100644 (file)
@@ -80,9 +80,9 @@ class TestConfig extends Command {
                //ensure validation is run before we attempt the bind
                $connection->getConfiguration();
 
-               if(!$connection->setConfiguration(array(
+               if(!$connection->setConfiguration([
                        'ldap_configuration_active' => 1,
-               ))) {
+               ])) {
                        return 1;
                }
                if($connection->bind()) {
index 724f240847a93352b7236f14eddd86a59e6697e3..9fa386a8215a6ae994311c732470706f239be038 100644 (file)
@@ -53,7 +53,7 @@ class Configuration {
        protected $unsavedChanges = ['ldapConfigurationActive' => 'ldapConfigurationActive'];
 
        //settings
-       protected $config = array(
+       protected $config = [
                'ldapHost' => null,
                'ldapPort' => null,
                'ldapBackupHost' => null,
@@ -109,7 +109,7 @@ class Configuration {
                'ldapDynamicGroupMemberURL' => null,
                'ldapDefaultPPolicyDN' => null,
                'ldapExtStorageHomeAttribute' => null,
-       );
+       ];
 
        /**
         * @param string $configPrefix
@@ -138,7 +138,7 @@ class Configuration {
         * @param mixed $value
         */
        public function __set($name, $value) {
-               $this->setConfiguration(array($name => $value));
+               $this->setConfiguration([$name => $value]);
        }
 
        /**
@@ -426,7 +426,7 @@ class Configuration {
         * to config-value entries in the database table
         */
        public function getDefaults() {
-               return array(
+               return [
                        'ldap_host'                         => '',
                        'ldap_port'                         => '',
                        'ldap_backup_host'                  => '',
@@ -481,7 +481,7 @@ class Configuration {
                        'ldap_default_ppolicy_dn'           => '',
                        'ldap_user_avatar_rule'             => 'default',
                        'ldap_ext_storage_home_attribute'   => '',
-               );
+               ];
        }
 
        /**
@@ -489,7 +489,7 @@ class Configuration {
         */
        public function getConfigTranslationArray() {
                //TODO: merge them into one representation
-               static $array = array(
+               static $array = [
                        'ldap_host'                         => 'ldapHost',
                        'ldap_port'                         => 'ldapPort',
                        'ldap_backup_host'                  => 'ldapBackupHost',
@@ -543,7 +543,7 @@ class Configuration {
                        'ldap_default_ppolicy_dn'           => 'ldapDefaultPPolicyDN',
                        'ldap_ext_storage_home_attribute'   => 'ldapExtStorageHomeAttribute',
                        'ldapIgnoreNamingRules'             => 'ldapIgnoreNamingRules', // sysconfig
-               );
+               ];
                return $array;
        }
 
index 8d499a4ee1cc53e978c37d7db6ff3201adb69048..5e2d7fb858358229fc7566ef7a531f93e824be18 100644 (file)
@@ -298,7 +298,7 @@ class Connection extends LDAPUtility {
         */
        public function setConfiguration($config, &$setParameters = null) {
                if(is_null($setParameters)) {
-                       $setParameters = array();
+                       $setParameters = [];
                }
                $this->doNotValidate = false;
                $this->configuration->setConfiguration($config, $setParameters);
@@ -328,7 +328,7 @@ class Connection extends LDAPUtility {
                $this->readConfiguration();
                $config = $this->configuration->getConfiguration();
                $cta = $this->configuration->getConfigTranslationArray();
-               $result = array();
+               $result = [];
                foreach($cta as $dbkey => $configkey) {
                        switch($configkey) {
                                case 'homeFolderNamingRule':
@@ -356,15 +356,15 @@ class Connection extends LDAPUtility {
 
        private function doSoftValidation() {
                //if User or Group Base are not set, take over Base DN setting
-               foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) {
+               foreach(['ldapBaseUsers', 'ldapBaseGroups'] as $keyBase) {
                        $val = $this->configuration->$keyBase;
                        if(empty($val)) {
                                $this->configuration->$keyBase = $this->configuration->ldapBase;
                        }
                }
 
-               foreach(array('ldapExpertUUIDUserAttr'  => 'ldapUuidUserAttribute',
-                                         'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute')
+               foreach(['ldapExpertUUIDUserAttr'  => 'ldapUuidUserAttribute',
+                                         'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute']
                                as $expertSetting => $effectiveSetting) {
                        $uuidOverride = $this->configuration->$expertSetting;
                        if(!empty($uuidOverride)) {
@@ -392,12 +392,12 @@ class Connection extends LDAPUtility {
                }
 
                //make sure empty search attributes are saved as simple, empty array
-               $saKeys = array('ldapAttributesForUserSearch',
-                                               'ldapAttributesForGroupSearch');
+               $saKeys = ['ldapAttributesForUserSearch',
+                                               'ldapAttributesForGroupSearch'];
                foreach($saKeys as $key) {
                        $val = $this->configuration->$key;
                        if(is_array($val) && count($val) === 1 && empty($val[0])) {
-                               $this->configuration->$key = array();
+                               $this->configuration->$key = [];
                        }
                }
 
@@ -421,8 +421,8 @@ class Connection extends LDAPUtility {
                        (string)$this->configPrefix .'): ';
 
                //options that shall not be empty
-               $options = array('ldapHost', 'ldapPort', 'ldapUserDisplayName',
-                                                'ldapGroupDisplayName', 'ldapLoginFilter');
+               $options = ['ldapHost', 'ldapPort', 'ldapUserDisplayName',
+                                                'ldapGroupDisplayName', 'ldapLoginFilter'];
                foreach($options as $key) {
                        $val = $this->configuration->$key;
                        if(empty($val)) {
index 115cc8d3fdb2f7725aa3120b35bf1f9fb08a2ac8..f1b36923ada445f9494e70776e3273b225208a65 100644 (file)
@@ -29,14 +29,14 @@ class GroupPluginManager {
 
        private $respondToActions = 0;
 
-       private $which = array(
+       private $which = [
                GroupInterface::CREATE_GROUP => null,
                GroupInterface::DELETE_GROUP => null,
                GroupInterface::ADD_TO_GROUP => null,
                GroupInterface::REMOVE_FROM_GROUP => null,
                GroupInterface::COUNT_USERS => null,
                GroupInterface::GROUP_DETAILS => null
-       );
+       ];
 
        /**
         * @return int All implemented actions
index 40b8bcf16c97a9a46ad529d553470cbc7f29f70b..c19f6ac4ed65984c084123d62aa2bacfe2b9168d 100644 (file)
@@ -138,8 +138,8 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
 
                //extra work if we don't get back user DNs
                if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
-                       $dns = array();
-                       $filterParts = array();
+                       $dns = [];
+                       $filterParts = [];
                        $bytes = 0;
                        foreach($members as $mid) {
                                $filter = str_replace('%uid', $mid, $this->access->connection->ldapLoginFilter);
@@ -150,7 +150,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                                        // to take even the chance to exceed it
                                        $filter = $this->access->combineFilterWithOr($filterParts);
                                        $bytes = 0;
-                                       $filterParts = array();
+                                       $filterParts = [];
                                        $users = $this->access->fetchListOfUsers($filter, 'dn', count($filterParts));
                                        $dns = array_merge($dns, $users);
                                }
@@ -182,10 +182,10 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                $dynamicGroupMemberURL = strtolower($this->access->connection->ldapDynamicGroupMemberURL);
 
                if (empty($dynamicGroupMemberURL)) {
-                       return array();
+                       return [];
                }
 
-               $dynamicMembers = array();
+               $dynamicMembers = [];
                $memberURLs = $this->access->readAttribute(
                        $dnGroup,
                        $dynamicGroupMemberURL,
@@ -199,7 +199,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                        if ($pos !== false) {
                                $memberUrlFilter = substr($memberURLs[0], $pos);
                                $foundMembers = $this->access->searchUsers($memberUrlFilter,'dn');
-                               $dynamicMembers = array();
+                               $dynamicMembers = [];
                                foreach($foundMembers as $value) {
                                        $dynamicMembers[$value['dn'][0]] = 1;
                                }
@@ -335,7 +335,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                        'objectClass=posixGroup',
                        $this->access->connection->ldapGidNumber . '=' . $gid
                ]);
-               $result = $this->access->searchGroups($filter, array('dn'), 1);
+               $result = $this->access->searchGroups($filter, ['dn'], 1);
                if(empty($result)) {
                        return false;
                }
@@ -493,11 +493,11 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                }
 
                //we need to get the DN from LDAP
-               $filter = $this->access->combineFilterWithAnd(array(
+               $filter = $this->access->combineFilterWithAnd([
                        $this->access->connection->ldapGroupFilter,
                        'objectsid=' . $domainObjectSid . '-' . $gid
-               ));
-               $result = $this->access->searchGroups($filter, array('dn'), 1);
+               ]);
+               $result = $this->access->searchGroups($filter, ['dn'], 1);
                if(empty($result)) {
                        return false;
                }
@@ -590,13 +590,13 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                        $filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search);
                        $users = $this->access->fetchListOfUsers(
                                $filter,
-                               array($this->access->connection->ldapUserDisplayName, 'dn'),
+                               [$this->access->connection->ldapUserDisplayName, 'dn'],
                                $limit,
                                $offset
                        );
                        return $this->access->nextcloudUserNames($users);
                } catch (\Exception $e) {
-                       return array();
+                       return [];
                }
        }
 
@@ -612,7 +612,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
        public function countUsersInPrimaryGroup($groupDN, $search = '', $limit = -1, $offset = 0) {
                try {
                        $filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search);
-                       $users = $this->access->countUsers($filter, array('dn'), $limit, $offset);
+                       $users = $this->access->countUsers($filter, ['dn'], $limit, $offset);
                        return (int)$users;
                } catch (\Exception $e) {
                        return 0;
@@ -648,7 +648,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
         */
        public function getUserGroups($uid) {
                if(!$this->enabled) {
-                       return array();
+                       return [];
                }
                $cacheKey = 'getUserGroups'.$uid;
                $userGroups = $this->access->connection->getFromCache($cacheKey);
@@ -657,8 +657,8 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                }
                $userDN = $this->access->username2dn($uid);
                if(!$userDN) {
-                       $this->access->connection->writeToCache($cacheKey, array());
-                       return array();
+                       $this->access->connection->writeToCache($cacheKey, []);
+                       return [];
                }
 
                $groups = [];
@@ -670,7 +670,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                if (!empty($dynamicGroupMemberURL)) {
                        // look through dynamic groups to add them to the result array if needed
                        $groupsToMatch = $this->access->fetchListOfGroups(
-                               $this->access->connection->ldapGroupFilter,array('dn',$dynamicGroupMemberURL));
+                               $this->access->connection->ldapGroupFilter,['dn',$dynamicGroupMemberURL]);
                        foreach($groupsToMatch as $dynamicGroup) {
                                if (!array_key_exists($dynamicGroupMemberURL, $dynamicGroup)) {
                                        continue;
@@ -816,10 +816,10 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
         */
        public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
                if(!$this->enabled) {
-                       return array();
+                       return [];
                }
                if(!$this->groupExists($gid)) {
-                       return array();
+                       return [];
                }
                $search = $this->access->escapeFilterPart($search, true);
                $cacheKey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
@@ -843,8 +843,8 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                $groupDN = $this->access->groupname2dn($gid);
                if(!$groupDN) {
                        // group couldn't be found, return empty resultset
-                       $this->access->connection->writeToCache($cacheKey, array());
-                       return array();
+                       $this->access->connection->writeToCache($cacheKey, []);
+                       return [];
                }
 
                $primaryUsers = $this->getUsersInPrimaryGroup($groupDN, $search, $limit, $offset);
@@ -856,19 +856,19 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                        return [];
                }
 
-               $groupUsers = array();
+               $groupUsers = [];
                $isMemberUid = (strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid');
                $attrs = $this->access->userManager->getAttributes(true);
                foreach($members as $member) {
                        if($isMemberUid) {
                                //we got uids, need to get their DNs to 'translate' them to user names
-                               $filter = $this->access->combineFilterWithAnd(array(
+                               $filter = $this->access->combineFilterWithAnd([
                                        str_replace('%uid', trim($member), $this->access->connection->ldapLoginFilter),
                                        $this->access->combineFilterWithAnd([
                                                $this->access->getFilterPartForUserSearch($search),
                                                $this->access->connection->ldapUserFilter
                                        ])
-                               ));
+                               ]);
                                $ldap_users = $this->access->fetchListOfUsers($filter, $attrs, 1);
                                if(count($ldap_users) < 1) {
                                        continue;
@@ -968,14 +968,14 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                //   and let it count.
                //For now this is not important, because the only use of this method
                //does not supply a search string
-               $groupUsers = array();
+               $groupUsers = [];
                foreach($members as $member) {
                        if($isMemberUid) {
                                //we got uids, need to get their DNs to 'translate' them to user names
-                               $filter = $this->access->combineFilterWithAnd(array(
+                               $filter = $this->access->combineFilterWithAnd([
                                        str_replace('%uid', $member, $this->access->connection->ldapLoginFilter),
                                        $this->access->getFilterPartForUserSearch($search)
-                               ));
+                               ]);
                                $ldap_users = $this->access->fetchListOfUsers($filter, 'dn', 1);
                                if(count($ldap_users) < 1) {
                                        continue;
@@ -1013,7 +1013,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
         */
        protected function getGroupsChunk($search = '', $limit = -1, $offset = 0) {
                if(!$this->enabled) {
-                       return array();
+                       return [];
                }
                $cacheKey = 'getGroups-'.$search.'-'.$limit.'-'.$offset;
 
@@ -1029,13 +1029,13 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                if($limit <= 0) {
                        $limit = null;
                }
-               $filter = $this->access->combineFilterWithAnd(array(
+               $filter = $this->access->combineFilterWithAnd([
                        $this->access->connection->ldapGroupFilter,
                        $this->access->getFilterPartForGroupSearch($search)
-               ));
+               ]);
                \OCP\Util::writeLog('user_ldap', 'getGroups Filter '.$filter, ILogger::DEBUG);
                $ldap_groups = $this->access->fetchListOfGroups($filter,
-                               array($this->access->connection->ldapGroupDisplayName, 'dn'),
+                               [$this->access->connection->ldapGroupDisplayName, 'dn'],
                                $limit,
                                $offset);
                $ldap_groups = $this->access->nextcloudGroupNames($ldap_groups);
@@ -1059,7 +1059,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
         */
        public function getGroups($search = '', $limit = -1, $offset = 0) {
                if(!$this->enabled) {
-                       return array();
+                       return [];
                }
                $search = $this->access->escapeFilterPart($search, true);
                $pagingSize = (int)$this->access->connection->ldapPagingSize;
@@ -1073,7 +1073,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
                   $overallLimit = $maxGroups;
                }
                $chunkOffset = $offset;
-               $allGroups = array();
+               $allGroups = [];
                while ($chunkOffset < $overallLimit) {
                        $chunkLimit = min($pagingSize, $overallLimit - $chunkOffset);
                        $ldapGroups = $this->getGroupsChunk($search, $chunkLimit, $chunkOffset);
index 3b39d4398c7b76f4d1f2720430491f39c73ba4e9..441bf141a3875f0920c8767609c4de4fc9542c7b 100644 (file)
@@ -30,7 +30,7 @@ namespace OCA\User_LDAP;
 use OCP\Group\Backend\IGetDisplayNameBackend;
 
 class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGetDisplayNameBackend {
-       private $backends = array();
+       private $backends = [];
        private $refBackend = null;
 
        /**
@@ -58,7 +58,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
        protected function walkBackends($gid, $method, $parameters) {
                $cacheKey = $this->getGroupCacheKey($gid);
                foreach($this->backends as $configPrefix => $backend) {
-                       if($result = call_user_func_array(array($backend, $method), $parameters)) {
+                       if($result = call_user_func_array([$backend, $method], $parameters)) {
                                $this->writeToCache($cacheKey, $configPrefix);
                                return $result;
                        }
@@ -80,13 +80,13 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
                //in case the uid has been found in the past, try this stored connection first
                if(!is_null($prefix)) {
                        if(isset($this->backends[$prefix])) {
-                               $result = call_user_func_array(array($this->backends[$prefix], $method), $parameters);
+                               $result = call_user_func_array([$this->backends[$prefix], $method], $parameters);
                                if($result === $passOnWhen) {
                                        //not found here, reset cache to null if group vanished
                                        //because sometimes methods return false with a reason
                                        $groupExists = call_user_func_array(
-                                               array($this->backends[$prefix], 'groupExists'),
-                                               array($gid)
+                                               [$this->backends[$prefix], 'groupExists'],
+                                               [$gid]
                                        );
                                        if(!$groupExists) {
                                                $this->writeToCache($cacheKey, null);
@@ -107,7 +107,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         * Checks whether the user is member of a group or not.
         */
        public function inGroup($uid, $gid) {
-               return $this->handleRequest($gid, 'inGroup', array($uid, $gid));
+               return $this->handleRequest($gid, 'inGroup', [$uid, $gid]);
        }
 
        /**
@@ -119,7 +119,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         * if the user exists at all.
         */
        public function getUserGroups($uid) {
-               $groups = array();
+               $groups = [];
 
                foreach($this->backends as $backend) {
                        $backendGroups = $backend->getUserGroups($uid);
@@ -136,7 +136,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         * @return string[] with user ids
         */
        public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
-               $users = array();
+               $users = [];
 
                foreach($this->backends as $backend) {
                        $backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset);
@@ -154,7 +154,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         */
        public function createGroup($gid) {
                return $this->handleRequest(
-                       $gid, 'createGroup', array($gid));
+                       $gid, 'createGroup', [$gid]);
        }
 
        /**
@@ -164,7 +164,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         */
        public function deleteGroup($gid) {
                return $this->handleRequest(
-                       $gid, 'deleteGroup', array($gid));
+                       $gid, 'deleteGroup', [$gid]);
        }
 
        /**
@@ -177,7 +177,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         */
        public function addToGroup($uid, $gid) {
                return $this->handleRequest(
-                       $gid, 'addToGroup', array($uid, $gid));
+                       $gid, 'addToGroup', [$uid, $gid]);
        }
 
        /**
@@ -190,7 +190,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         */
        public function removeFromGroup($uid, $gid) {
                return $this->handleRequest(
-                       $gid, 'removeFromGroup', array($uid, $gid));
+                       $gid, 'removeFromGroup', [$uid, $gid]);
        }
 
        /**
@@ -201,7 +201,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         */
        public function countUsersInGroup($gid, $search = '') {
                return $this->handleRequest(
-                       $gid, 'countUsersInGroup', array($gid, $search));
+                       $gid, 'countUsersInGroup', [$gid, $search]);
        }
 
        /**
@@ -211,7 +211,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         */
        public function getGroupDetails($gid) {
                return $this->handleRequest(
-                       $gid, 'getGroupDetails', array($gid));
+                       $gid, 'getGroupDetails', [$gid]);
        }
 
        /**
@@ -221,7 +221,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         * Returns a list with all groups
         */
        public function getGroups($search = '', $limit = -1, $offset = 0) {
-               $groups = array();
+               $groups = [];
 
                foreach($this->backends as $backend) {
                        $backendGroups = $backend->getGroups($search, $limit, $offset);
@@ -239,7 +239,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         * @return bool
         */
        public function groupExists($gid) {
-               return $this->handleRequest($gid, 'groupExists', array($gid));
+               return $this->handleRequest($gid, 'groupExists', [$gid]);
        }
 
        /**
@@ -271,7 +271,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
         * @return resource of the LDAP connection
         */
        public function getNewLDAPConnection($gid) {
-               return $this->handleRequest($gid, 'getNewLDAPConnection', array($gid));
+               return $this->handleRequest($gid, 'getNewLDAPConnection', [$gid]);
        }
 
        public function getDisplayName(string $gid): string {
index 4279ea72c71cccb7d545f2c9544aa00d4f1538b8..6962a3cb9788350a8781827a8e3475b324890ba7 100644 (file)
@@ -99,7 +99,7 @@ class Helper {
 
                $keys = $this->getServersConfig($referenceConfigkey);
 
-               $result = array();
+               $result = [];
                foreach($keys as $key) {
                        $len = strlen($key) - strlen($referenceConfigkey);
                        $prefix = substr($key, 0, $len);
@@ -164,7 +164,7 @@ class Helper {
                                AND `appid` = \'user_ldap\'
                                AND `configkey` NOT IN (\'enabled\', \'installed_version\', \'types\', \'bgjUpdateGroupsLastRun\')
                ');
-               $delRows = $query->execute(array($prefix.'%'));
+               $delRows = $query->execute([$prefix.'%']);
 
                if($delRows === null) {
                        return false;
@@ -234,7 +234,7 @@ class Helper {
        public function sanitizeDN($dn) {
                //treating multiple base DNs
                if(is_array($dn)) {
-                       $result = array();
+                       $result = [];
                        foreach($dn as $singleDN) {
                                $result[] = $this->sanitizeDN($singleDN);
                        }
@@ -251,7 +251,7 @@ class Helper {
                //escape DN values according to RFC 2253 – this is already done by ldap_explode_dn
                //to use the DN in search filters, \ needs to be escaped to \5c additionally
                //to use them in bases, we convert them back to simple backslashes in readAttribute()
-               $replacements = array(
+               $replacements = [
                        '\,' => '\5c2C',
                        '\=' => '\5c3D',
                        '\+' => '\5c2B',
@@ -263,7 +263,7 @@ class Helper {
                        '('  => '\28',
                        ')'  => '\29',
                        '*'  => '\2A',
-               );
+               ];
                $dn = str_replace(array_keys($replacements), array_values($replacements), $dn);
 
                return $dn;
index 174897d8639509ba50fc96ca57955ce116977174..7b95950bda558b4ceae540db8d501ee682b16aea 100644 (file)
@@ -161,11 +161,11 @@ class Sync extends TimedJob {
                $access = $this->accessFactory->get($connection);
                $access->setUserMapper($this->mapper);
 
-               $filter = $access->combineFilterWithAnd(array(
+               $filter = $access->combineFilterWithAnd([
                        $access->connection->ldapUserFilter,
                        $access->connection->ldapUserDisplayName . '=*',
                        $access->getFilterPartForUserSearch('')
-               ));
+               ]);
                $results = $access->fetchListOfUsers(
                        $filter,
                        $access->userManager->getAttributes(),
index ef42f36f54f5062cdbe473d84fafdf595a50d5ac..bf5d730c3b8d95d43dd36a087101117eff9c341b 100644 (file)
@@ -104,21 +104,21 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob {
                        $actualUsers = self::getGroupBE()->usersInGroup($group);
                        $hasChanged = false;
                        foreach(array_diff($knownUsers, $actualUsers) as $removedUser) {
-                               \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group));
+                               \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', ['uid' => $removedUser, 'gid' => $group]);
                                \OCP\Util::writeLog('user_ldap',
                                'bgJ "updateGroups" – "'.$removedUser.'" removed from "'.$group.'".',
                                        ILogger::INFO);
                                $hasChanged = true;
                        }
                        foreach(array_diff($actualUsers, $knownUsers) as $addedUser) {
-                               \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group));
+                               \OCP\Util::emitHook('OC_User', 'post_addToGroup', ['uid' => $addedUser, 'gid' => $group]);
                                \OCP\Util::writeLog('user_ldap',
                                'bgJ "updateGroups" – "'.$addedUser.'" added to "'.$group.'".',
                                        ILogger::INFO);
                                $hasChanged = true;
                        }
                        if($hasChanged) {
-                               $query->execute(array(serialize($actualUsers), $group));
+                               $query->execute([serialize($actualUsers), $group]);
                        }
                }
                \OCP\Util::writeLog('user_ldap',
@@ -141,7 +141,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob {
                                'bgJ "updateGroups" – new group "'.$createdGroup.'" found.',
                                ILogger::INFO);
                        $users = serialize(self::getGroupBE()->usersInGroup($createdGroup));
-                       $query->execute(array($createdGroup, $users));
+                       $query->execute([$createdGroup, $users]);
                }
                \OCP\Util::writeLog('user_ldap',
                        'bgJ "updateGroups" – FINISHED dealing with created Groups.',
@@ -162,7 +162,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob {
                        \OCP\Util::writeLog('user_ldap',
                                'bgJ "updateGroups" – group "'.$removedGroup.'" was removed.',
                                ILogger::INFO);
-                       $query->execute(array($removedGroup));
+                       $query->execute([$removedGroup]);
                }
                \OCP\Util::writeLog('user_ldap',
                        'bgJ "updateGroups" – FINISHED dealing with removed groups.',
@@ -217,7 +217,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob {
                        FROM `*PREFIX*ldap_group_members`
                ');
                $result = $query->execute()->fetchAll();
-               self::$groupsFromDB = array();
+               self::$groupsFromDB = [];
                foreach($result as $dataset) {
                        self::$groupsFromDB[$dataset['owncloudname']] = $dataset;
                }
index e68c3149696c345938708e99379c347a2fef9445..8c8a6bfbf1e2dd83501bea2673d8e2ada7049f51 100644 (file)
@@ -35,7 +35,7 @@ use OCA\User_LDAP\Exceptions\ConstraintViolationException;
 
 class LDAP implements ILDAPWrapper {
        protected $curFunc = '';
-       protected $curArgs = array();
+       protected $curArgs = [];
 
        /**
         * @param resource $link
@@ -71,7 +71,7 @@ class LDAP implements ILDAPWrapper {
         */
        public function controlPagedResultResponse($link, $result, &$cookie) {
                $this->preFunctionCall('ldap_control_paged_result_response',
-                       array($link, $result, $cookie));
+                       [$link, $result, $cookie]);
                $result = ldap_control_paged_result_response($link, $result, $cookie);
                $this->postFunctionCall();
 
@@ -217,7 +217,7 @@ class LDAP implements ILDAPWrapper {
         * @return bool
         */
        public function modReplace($link, $userDN, $password) {
-               return $this->invokeLDAPMethod('mod_replace', $link, $userDN, array('userPassword' => $password));
+               return $this->invokeLDAPMethod('mod_replace', $link, $userDN, ['userPassword' => $password]);
        }
 
        /**
index 472cd8d277965ec686b141f5e6cbf74c4ad7780f..fecc25da92e3c39d245b8a508c802f3f1c980e46 100644 (file)
@@ -84,7 +84,7 @@ abstract class AbstractMapping {
                        WHERE `' . $compareCol . '` = ?
                ');
 
-               $res = $query->execute(array($search));
+               $res = $query->execute([$search]);
                if($res !== false) {
                        return $query->fetchColumn();
                }
@@ -126,7 +126,7 @@ abstract class AbstractMapping {
                        WHERE `directory_uuid` = ?
                ');
 
-               return $this->modify($query, array($fdn, $uuid));
+               return $this->modify($query, [$fdn, $uuid]);
        }
 
        /**
@@ -171,8 +171,8 @@ abstract class AbstractMapping {
                        WHERE `owncloud_name` LIKE ?
                ');
 
-               $res = $query->execute(array($prefixMatch.$this->dbc->escapeLikeParameter($search).$postfixMatch));
-               $names = array();
+               $res = $query->execute([$prefixMatch.$this->dbc->escapeLikeParameter($search).$postfixMatch]);
+               $names = [];
                if($res !== false) {
                        while($row = $query->fetch()) {
                                $names[] = $row['owncloud_name'];
@@ -240,11 +240,11 @@ abstract class AbstractMapping {
                        return false;
                }
 
-               $row = array(
+               $row = [
                        'ldap_dn'        => $fdn,
                        'owncloud_name'  => $name,
                        'directory_uuid' => $uuid
-               );
+               ];
 
                try {
                        $result = $this->dbc->insertIfNotExist($this->getTableName(), $row);
@@ -265,7 +265,7 @@ abstract class AbstractMapping {
                        DELETE FROM `'. $this->getTableName() .'`
                        WHERE `owncloud_name` = ?');
 
-               return $this->modify($query, array($name));
+               return $this->modify($query, [$name]);
        }
 
        /**
index 24313fc7bfb70633a00d3dd789377fe7315f0ef7..4515e53c6c44e19c51ed3b11fc69c952c084de2b 100644 (file)
@@ -37,7 +37,7 @@ use OCA\User_LDAP\Mapping\UserMapping;
 use OCA\User_LDAP\User\Manager;
 
 abstract class Proxy {
-       static private $accesses = array();
+       static private $accesses = [];
        private $ldap = null;
 
        /** @var \OCP\ICache|null */
index 1511f3bcd61b836346e2de875636b0d4dab025fc..c75a144e909e408f79e3fab4cfcf103bc190c0b3 100644 (file)
@@ -105,7 +105,7 @@ class OfflineUser {
         * @return array
         */
        public function export() {
-               $data = array();
+               $data = [];
                $data['ocName'] = $this->getOCName();
                $data['dn'] = $this->getDN();
                $data['uid'] = $this->getUID();
@@ -223,7 +223,7 @@ class OfflineUser {
                        FROM `*PREFIX*share`
                        WHERE `uid_owner` = ?
                ', 1);
-               $query->execute(array($this->ocName));
+               $query->execute([$this->ocName]);
                $sResult = $query->fetchColumn(0);
                if((int)$sResult === 1) {
                        $this->hasActiveShares = true;
@@ -235,7 +235,7 @@ class OfflineUser {
                        FROM `*PREFIX*share_external`
                        WHERE `owner` = ?
                ', 1);
-               $query->execute(array($this->ocName));
+               $query->execute([$this->ocName]);
                $sResult = $query->fetchColumn(0);
                if((int)$sResult === 1) {
                        $this->hasActiveShares = true;
index 467d5ca025ba6533b97397df42a420405000f0b1..eb126b94bfe89a557895c2e3d0db459a10d00bd3 100644 (file)
@@ -96,7 +96,7 @@ class User {
        /**
         * @var string[]
         */
-       protected $refreshedFeatures = array();
+       protected $refreshedFeatures = [];
        /**
         * @var string
         */
@@ -711,7 +711,7 @@ class User {
                $uid = $params['uid'];
                if (isset($uid) && $uid === $this->getUsername()) {
                        //retrieve relevant user attributes
-                       $result = $this->access->search('objectclass=*', array($this->dn), ['pwdpolicysubentry', 'pwdgraceusetime', 'pwdreset', 'pwdchangedtime']);
+                       $result = $this->access->search('objectclass=*', [$this->dn], ['pwdpolicysubentry', 'pwdgraceusetime', 'pwdreset', 'pwdchangedtime']);
 
                        if (array_key_exists('pwdpolicysubentry', $result[0])) {
                                $pwdPolicySubentry = $result[0]['pwdpolicysubentry'];
@@ -728,7 +728,7 @@ class User {
                        $cacheKey = 'ppolicyAttributes' . $ppolicyDN;
                        $result = $this->connection->getFromCache($cacheKey);
                        if(is_null($result)) {
-                               $result = $this->access->search('objectclass=*', array($ppolicyDN), ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']);
+                               $result = $this->access->search('objectclass=*', [$ppolicyDN], ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']);
                                $this->connection->writeToCache($cacheKey, $result);
                        }
 
@@ -742,10 +742,10 @@ class User {
                                        && count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available?
                                        $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true');
                                        header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
-                                       'user_ldap.renewPassword.showRenewPasswordForm', array('user' => $uid)));
+                                       'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid]));
                                } else { //no more grace login available
                                        header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
-                                       'user_ldap.renewPassword.showLoginFormInvalidPassword', array('user' => $uid)));
+                                       'user_ldap.renewPassword.showLoginFormInvalidPassword', ['user' => $uid]));
                                }
                                exit();
                        }
@@ -753,7 +753,7 @@ class User {
                        if (!empty($pwdReset) && $pwdReset[0] === 'TRUE') { //user must change his password
                                $this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true');
                                header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
-                               'user_ldap.renewPassword.showRenewPasswordForm', array('user' => $uid)));
+                               'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid]));
                                exit();
                        }
                        //handle password expiry warning
index 1407bec011d11ad9b9c1b389e9d4c68d93710e95..6301257b1afaf635e36e1ff6d76508a393aa1fe6 100644 (file)
@@ -32,7 +32,7 @@ class UserPluginManager {
 
        private $respondToActions = 0;
 
-       private $which = array(
+       private $which = [
                Backend::CREATE_USER => null,
                Backend::SET_PASSWORD => null,
                Backend::GET_HOME => null,
@@ -41,7 +41,7 @@ class UserPluginManager {
                Backend::PROVIDE_AVATAR => null,
                Backend::COUNT_USERS => null,
                'deleteUser' => null
-       );
+       ];
 
        /**
         * @return int All implemented actions, except for 'deleteUser'
index 323e59860f30a725eb23af214ff4c054f91672d0..fec3b25a78e8ccd08892e3e39636664139b3819f 100644 (file)
@@ -260,11 +260,11 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
                if($limit <= 0) {
                        $limit = null;
                }
-               $filter = $this->access->combineFilterWithAnd(array(
+               $filter = $this->access->combineFilterWithAnd([
                        $this->access->connection->ldapUserFilter,
                        $this->access->connection->ldapUserDisplayName . '=*',
                        $this->access->getFilterPartForUserSearch($search)
-               ));
+               ]);
 
                Util::writeLog('user_ldap',
                        'getUsers: Options: search '.$search.' limit '.$limit.' offset '.$offset.' Filter: '.$filter,
@@ -511,7 +511,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
                        return $displayNames;
                }
 
-               $displayNames = array();
+               $displayNames = [];
                $users = $this->getUsers($search, $limit, $offset);
                foreach ($users as $user) {
                        $displayNames[$user] = $this->getDisplayName($user);
index 96be4a7529f13a31768e560123ecbdc585d52885..2edc0d2d64ae23649f8d6a83730101eeaa708abd 100644 (file)
@@ -84,7 +84,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
                                && method_exists($this->getAccess($configPrefix), $method)) {
                                $instance = $this->getAccess($configPrefix);
                        }
-                       if($result = call_user_func_array(array($instance, $method), $parameters)) {
+                       if($result = call_user_func_array([$instance, $method], $parameters)) {
                                $this->writeToCache($cacheKey, $configPrefix);
                                return $result;
                        }
@@ -160,7 +160,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         */
        public function getUsers($search = '', $limit = 10, $offset = 0) {
                //we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends
-               $users = array();
+               $users = [];
                foreach($this->backends as $backend) {
                        $backendUsers = $backend->getUsers($search, $limit, $offset);
                        if (is_array($backendUsers)) {
@@ -177,7 +177,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         */
        public function userExists($uid) {
                $existsOnLDAP = false;
-               $existsLocally = $this->handleRequest($uid, 'userExists', array($uid));
+               $existsLocally = $this->handleRequest($uid, 'userExists', [$uid]);
                if($existsLocally) {
                        $existsOnLDAP = $this->userExistsOnLDAP($uid);
                }
@@ -202,7 +202,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         */
        public function userExistsOnLDAP($user) {
                $id = ($user instanceof User) ? $user->getUsername() : $user;
-               return $this->handleRequest($id, 'userExistsOnLDAP', array($user));
+               return $this->handleRequest($id, 'userExistsOnLDAP', [$user]);
        }
 
        /**
@@ -214,7 +214,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * Check if the password is correct without logging in the user
         */
        public function checkPassword($uid, $password) {
-               return $this->handleRequest($uid, 'checkPassword', array($uid, $password));
+               return $this->handleRequest($uid, 'checkPassword', [$uid, $password]);
        }
 
        /**
@@ -225,7 +225,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         */
        public function loginName2UserName($loginName) {
                $id = 'LOGINNAME,' . $loginName;
-               return $this->handleRequest($id, 'loginName2UserName', array($loginName));
+               return $this->handleRequest($id, 'loginName2UserName', [$loginName]);
        }
        
        /**
@@ -236,7 +236,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         */
        public function dn2UserName($dn) {
                $id = 'DN,' . $dn;
-               return $this->handleRequest($id, 'dn2UserName', array($dn));
+               return $this->handleRequest($id, 'dn2UserName', [$dn]);
        }
 
        /**
@@ -245,7 +245,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * @return boolean
         */
        public function getHome($uid) {
-               return $this->handleRequest($uid, 'getHome', array($uid));
+               return $this->handleRequest($uid, 'getHome', [$uid]);
        }
 
        /**
@@ -254,7 +254,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * @return string display name
         */
        public function getDisplayName($uid) {
-               return $this->handleRequest($uid, 'getDisplayName', array($uid));
+               return $this->handleRequest($uid, 'getDisplayName', [$uid]);
        }
 
        /**
@@ -265,7 +265,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * @return string display name
         */
        public function setDisplayName($uid, $displayName) {
-               return $this->handleRequest($uid, 'setDisplayName', array($uid, $displayName));
+               return $this->handleRequest($uid, 'setDisplayName', [$uid, $displayName]);
        }
 
        /**
@@ -286,7 +286,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         */
        public function getDisplayNames($search = '', $limit = null, $offset = null) {
                //we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends
-               $users = array();
+               $users = [];
                foreach($this->backends as $backend) {
                        $backendUsers = $backend->getDisplayNames($search, $limit, $offset);
                        if (is_array($backendUsers)) {
@@ -304,7 +304,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * Deletes a user
         */
        public function deleteUser($uid) {
-               return $this->handleRequest($uid, 'deleteUser', array($uid));
+               return $this->handleRequest($uid, 'deleteUser', [$uid]);
        }
        
        /**
@@ -315,7 +315,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         *
         */
        public function setPassword($uid, $password) {
-               return $this->handleRequest($uid, 'setPassword', array($uid, $password));
+               return $this->handleRequest($uid, 'setPassword', [$uid, $password]);
        }
 
        /**
@@ -346,7 +346,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * @return Access instance of Access for LDAP interaction
         */
        public function getLDAPAccess($uid) {
-               return $this->handleRequest($uid, 'getLDAPAccess', array($uid));
+               return $this->handleRequest($uid, 'getLDAPAccess', [$uid]);
        }
        
        /**
@@ -356,7 +356,7 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * @return resource of the LDAP connection
         */
        public function getNewLDAPConnection($uid) {
-               return $this->handleRequest($uid, 'getNewLDAPConnection', array($uid));
+               return $this->handleRequest($uid, 'getNewLDAPConnection', [$uid]);
        }
 
        /**
@@ -366,6 +366,6 @@ class User_Proxy extends Proxy implements \OCP\IUserBackend, \OCP\UserInterface,
         * @return bool
         */
        public function createUser($username, $password) {
-               return $this->handleRequest($username, 'createUser', array($username,$password));
+               return $this->handleRequest($username, 'createUser', [$username,$password]);
        }
 }
index 82f06010bcfaaf1c4143ce342aa2827f5ec5409a..4e3f41d6fc95442c94c2a5146a621f1d6565fdc7 100644 (file)
@@ -48,7 +48,7 @@ class Wizard extends LDAPUtility {
        protected $cr;
        protected $configuration;
        protected $result;
-       protected $resultCache = array();
+       protected $resultCache = [];
 
        const LRESULT_PROCESSED_OK = 2;
        const LRESULT_PROCESSED_INVALID = 3;
@@ -135,7 +135,7 @@ class Wizard extends LDAPUtility {
                $filter = $this->configuration->ldapGroupFilter;
 
                if(empty($filter)) {
-                       $output = self::$l->n('%s group found', '%s groups found', 0, array(0));
+                       $output = self::$l->n('%s group found', '%s groups found', 0, [0]);
                        $this->result->addChange('ldap_group_count', $output);
                        return $this->result;
                }
@@ -200,22 +200,22 @@ class Wizard extends LDAPUtility {
         * @return int|bool
         */
        public function countUsersWithAttribute($attr, $existsCheck = false) {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
                                                                                   'ldapUserFilter',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
 
-               $filter = $this->access->combineFilterWithAnd(array(
+               $filter = $this->access->combineFilterWithAnd([
                        $this->configuration->ldapUserFilter,
                        $attr . '=*'
-               ));
+               ]);
 
                $limit = ($existsCheck === false) ? null : 1;
 
-               return $this->access->countUsers($filter, array('dn'), $limit);
+               return $this->access->countUsers($filter, ['dn'], $limit);
        }
 
        /**
@@ -225,11 +225,11 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function detectUserDisplayNameAttribute() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                'ldapPort',
                                                                                'ldapBase',
                                                                                'ldapUserFilter',
-                                                                               ))) {
+                                                                               ])) {
                        return  false;
                }
 
@@ -247,7 +247,7 @@ class Wizard extends LDAPUtility {
                }
 
                // first attribute that has at least one result wins
-               $displayNameAttrs = array('displayname', 'cn');
+               $displayNameAttrs = ['displayname', 'cn'];
                foreach ($displayNameAttrs as $attr) {
                        $count = (int)$this->countUsersWithAttribute($attr, true);
 
@@ -267,11 +267,11 @@ class Wizard extends LDAPUtility {
         * @return WizardResult|bool
         */
        public function detectEmailAttribute() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
                                                                                   'ldapUserFilter',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
 
@@ -286,7 +286,7 @@ class Wizard extends LDAPUtility {
                        $writeLog = false;
                }
 
-               $emailAttributes = array('mail', 'mailPrimaryAddress');
+               $emailAttributes = ['mail', 'mailPrimaryAddress'];
                $winner = '';
                $maxUsers = 0;
                foreach($emailAttributes as $attr) {
@@ -314,11 +314,11 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function determineAttributes() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
                                                                                   'ldapUserFilter',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
 
@@ -343,11 +343,11 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        private function getUserAttributes() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
                                                                                   'ldapUserFilter',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
                $cr = $this->getConnection();
@@ -357,13 +357,13 @@ class Wizard extends LDAPUtility {
 
                $base = $this->configuration->ldapBase[0];
                $filter = $this->configuration->ldapUserFilter;
-               $rr = $this->ldap->search($cr, $base, $filter, array(), 1, 1);
+               $rr = $this->ldap->search($cr, $base, $filter, [], 1, 1);
                if(!$this->ldap->isResource($rr)) {
                        return false;
                }
                $er = $this->ldap->firstEntry($cr, $rr);
                $attributes = $this->ldap->getAttributes($cr, $er);
-               $pureAttributes = array();
+               $pureAttributes = [];
                for($i = 0; $i < $attributes['count']; $i++) {
                        $pureAttributes[] = $attributes[$i];
                }
@@ -399,10 +399,10 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        private function determineGroups($dbKey, $confKey, $testMemberOf = true) {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
                $cr = $this->getConnection();
@@ -432,9 +432,9 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function fetchGroups($dbKey, $confKey) {
-               $obclasses = array('posixGroup', 'group', 'zimbraDistributionList', 'groupOfNames', 'groupOfUniqueNames');
+               $obclasses = ['posixGroup', 'group', 'zimbraDistributionList', 'groupOfNames', 'groupOfUniqueNames'];
 
-               $filterParts = array();
+               $filterParts = [];
                foreach($obclasses as $obclass) {
                        $filterParts[] = 'objectclass='.$obclass;
                }
@@ -442,16 +442,16 @@ class Wizard extends LDAPUtility {
                //- that looks like a group and
                //- has the group display name set
                $filter = $this->access->combineFilterWithOr($filterParts);
-               $filter = $this->access->combineFilterWithAnd(array($filter, 'cn=*'));
+               $filter = $this->access->combineFilterWithAnd([$filter, 'cn=*']);
 
-               $groupNames = array();
-               $groupEntries = array();
+               $groupNames = [];
+               $groupEntries = [];
                $limit = 400;
                $offset = 0;
                do {
                        // we need to request dn additionally here, otherwise memberOf
                        // detection will fail later
-                       $result = $this->access->searchGroups($filter, array('cn', 'dn'), $limit, $offset);
+                       $result = $this->access->searchGroups($filter, ['cn', 'dn'], $limit, $offset);
                        foreach($result as $item) {
                                if(!isset($item['cn']) && !is_array($item['cn']) && !isset($item['cn'][0])) {
                                        // just in case - no issue known
@@ -479,17 +479,17 @@ class Wizard extends LDAPUtility {
        }
 
        public function determineGroupMemberAssoc() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapGroupFilter',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
                $attribute = $this->detectGroupMemberAssoc();
                if($attribute === false) {
                        return false;
                }
-               $this->configuration->setConfiguration(array('ldapGroupMemberAssocAttr' => $attribute));
+               $this->configuration->setConfiguration(['ldapGroupMemberAssocAttr' => $attribute]);
                $this->result->addChange('ldap_group_member_assoc_attribute', $attribute);
 
                return $this->result;
@@ -501,10 +501,10 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function determineGroupObjectClasses() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
                $cr = $this->getConnection();
@@ -512,7 +512,7 @@ class Wizard extends LDAPUtility {
                        throw new \Exception('Could not connect to LDAP');
                }
 
-               $obclasses = array('groupOfNames', 'groupOfUniqueNames', 'group', 'posixGroup', '*');
+               $obclasses = ['groupOfNames', 'groupOfUniqueNames', 'group', 'posixGroup', '*'];
                $this->determineFeature($obclasses,
                                                                'objectclass',
                                                                'ldap_groupfilter_objectclass',
@@ -528,10 +528,10 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function determineUserObjectClasses() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
-                                                                                  ))) {
+                                                                                  ])) {
                        return  false;
                }
                $cr = $this->getConnection();
@@ -539,8 +539,8 @@ class Wizard extends LDAPUtility {
                        throw new \Exception('Could not connect to LDAP');
                }
 
-               $obclasses = array('inetOrgPerson', 'person', 'organizationalPerson',
-                                                  'user', 'posixAccount', '*');
+               $obclasses = ['inetOrgPerson', 'person', 'organizationalPerson',
+                                                  'user', 'posixAccount', '*'];
                $filter = $this->configuration->ldapUserFilter;
                //if filter is empty, it is probably the first time the wizard is called
                //then, apply suggestions.
@@ -558,10 +558,10 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function getGroupFilter() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
-                                                                                  ))) {
+                                                                                  ])) {
                        return false;
                }
                //make sure the use display name is set
@@ -582,10 +582,10 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function getUserListFilter() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
-                                                                                  ))) {
+                                                                                  ])) {
                        return false;
                }
                //make sure the use display name is set
@@ -608,11 +608,11 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function getUserLoginFilter() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
                                                                                   'ldapBase',
                                                                                   'ldapUserFilter',
-                                                                                  ))) {
+                                                                                  ])) {
                        return false;
                }
 
@@ -631,11 +631,11 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function testLoginName($loginName) {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                        'ldapPort',
                        'ldapBase',
                        'ldapLoginFilter',
-               ))) {
+               ])) {
                        return false;
                }
 
@@ -665,8 +665,8 @@ class Wizard extends LDAPUtility {
         * @throws \Exception
         */
        public function guessPortAndTLS() {
-               if(!$this->checkRequirements(array('ldapHost',
-                                                                                  ))) {
+               if(!$this->checkRequirements(['ldapHost',
+                                                                                  ])) {
                        return false;
                }
                $this->checkHost();
@@ -698,10 +698,10 @@ class Wizard extends LDAPUtility {
                        }
 
                        if ($settingsFound === true) {
-                               $config = array(
+                               $config = [
                                        'ldapPort' => $p,
                                        'ldapTLS' => (int)$t
-                               );
+                               ];
                                $this->configuration->setConfiguration($config);
                                \OCP\Util::writeLog('user_ldap', 'Wiz: detected Port ' . $p, ILogger::DEBUG);
                                $this->result->addChange('ldap_port', $p);
@@ -718,9 +718,9 @@ class Wizard extends LDAPUtility {
         * @return WizardResult|false WizardResult on success, false otherwise
         */
        public function guessBaseDN() {
-               if(!$this->checkRequirements(array('ldapHost',
+               if(!$this->checkRequirements(['ldapHost',
                                                                                   'ldapPort',
-                                                                                  ))) {
+                                                                                  ])) {
                        return false;
                }
 
@@ -766,7 +766,7 @@ class Wizard extends LDAPUtility {
         */
        private function applyFind($key, $value) {
                $this->result->addChange($key, $value);
-               $this->configuration->setConfiguration(array($key => $value));
+               $this->configuration->setConfiguration([$key => $value]);
        }
 
        /**
@@ -844,7 +844,7 @@ class Wizard extends LDAPUtility {
 
                //base is there, let's validate it. If we search for anything, we should
                //get a result set > 0 on a proper base
-               $rr = $this->ldap->search($cr, $base, 'objectClass=*', array('dn'), 0, 1);
+               $rr = $this->ldap->search($cr, $base, 'objectClass=*', ['dn'], 0, 1);
                if(!$this->ldap->isResource($rr)) {
                        $errorNo  = $this->ldap->errno($cr);
                        $errorMsg = $this->ldap->error($cr);
@@ -870,7 +870,7 @@ class Wizard extends LDAPUtility {
                if(!$cr) {
                        throw new \Exception('Could not connect to LDAP');
                }
-               $result = $this->access->countUsers('memberOf=*', array('memberOf'), 1);
+               $result = $this->access->countUsers('memberOf=*', ['memberOf'], 1);
                if(is_int($result) &&  $result > 0) {
                        return true;
                }
@@ -911,7 +911,7 @@ class Wizard extends LDAPUtility {
                                                }
                                                $base = $this->configuration->ldapBase[0];
                                                foreach($cns as $cn) {
-                                                       $rr = $this->ldap->search($cr, $base, 'cn=' . $cn, array('dn', 'primaryGroupToken'));
+                                                       $rr = $this->ldap->search($cr, $base, 'cn=' . $cn, ['dn', 'primaryGroupToken']);
                                                        if(!$this->ldap->isResource($rr)) {
                                                                continue;
                                                        }
@@ -1132,8 +1132,8 @@ class Wizard extends LDAPUtility {
         * @return array|false an array with the values on success, false otherwise
         */
        public function cumulativeSearchOnAttribute($filters, $attr, $dnReadLimit = 3, &$maxF = null) {
-               $dnRead = array();
-               $foundItems = array();
+               $dnRead = [];
+               $foundItems = [];
                $maxEntries = 0;
                if(!is_array($this->configuration->ldapBase)
                   || !isset($this->configuration->ldapBase[0])) {
@@ -1154,7 +1154,7 @@ class Wizard extends LDAPUtility {
                                continue;
                        }
                        // 20k limit for performance and reason
-                       $rr = $this->ldap->search($cr, $base, $filter, array($attr), 0, 20000);
+                       $rr = $this->ldap->search($cr, $base, $filter, [$attr], 0, 20000);
                        if(!$this->ldap->isResource($rr)) {
                                continue;
                        }
@@ -1178,7 +1178,7 @@ class Wizard extends LDAPUtility {
                                        if($dn === false || in_array($dn, $dnRead)) {
                                                continue;
                                        }
-                                       $newItems = array();
+                                       $newItems = [];
                                        $state = $this->getAttributeValuesFromEntry($attributes,
                                                                                                                                $attr,
                                                                                                                                $newItems);
@@ -1317,14 +1317,14 @@ class Wizard extends LDAPUtility {
         * @return array
         */
        private function getDefaultLdapPortSettings() {
-               static $settings = array(
-                                                               array('port' => 7636, 'tls' => false),
-                                                               array('port' =>  636, 'tls' => false),
-                                                               array('port' => 7389, 'tls' => true),
-                                                               array('port' =>  389, 'tls' => true),
-                                                               array('port' => 7389, 'tls' => false),
-                                                               array('port' =>  389, 'tls' => false),
-                                                 );
+               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],
+                                                 ];
                return $settings;
        }
 
@@ -1337,7 +1337,7 @@ class Wizard extends LDAPUtility {
                //7xxx ← UCS. need to be checked first, because both ports may be open
                $host = $this->configuration->ldapHost;
                $port = (int)$this->configuration->ldapPort;
-               $portSettings = array();
+               $portSettings = [];
 
                //In case the port is already provided, we will check this first
                if($port > 0) {
@@ -1345,9 +1345,9 @@ class Wizard extends LDAPUtility {
                        if(!(is_array($hostInfo)
                                && isset($hostInfo['scheme'])
                                && stripos($hostInfo['scheme'], 'ldaps') !== false)) {
-                               $portSettings[] = array('port' => $port, 'tls' => true);
+                               $portSettings[] = ['port' => $port, 'tls' => true];
                        }
-                       $portSettings[] =array('port' => $port, 'tls' => false);
+                       $portSettings[] =['port' => $port, 'tls' => false];
                }
 
                //default ports
index 74bb1171d488593834bcd779ded43443d3cdc334..ae90cfe437a17004cd1d7f56d5b47715d8441327 100644 (file)
@@ -29,8 +29,8 @@
 namespace OCA\User_LDAP;
 
 class WizardResult {
-       protected $changes = array();
-       protected $options = array();
+       protected $changes = [];
+       protected $options = [];
        protected $markedChange = false;
 
        /**
@@ -52,7 +52,7 @@ class WizardResult {
         */
        public function addOptions($key, $values) {
                if(!is_array($values)) {
-                       $values = array($values);
+                       $values = [$values];
                }
                $this->options[$key] = $values;
        }
@@ -68,7 +68,7 @@ class WizardResult {
         * @return array
         */
        public function getResultArray() {
-               $result = array();
+               $result = [];
                $result['changes'] = $this->changes;
                if(count($this->options) > 0) {
                        $result['options'] = $this->options;
index 5b607f7be864a618017c19e93cc7627c8d51cb15..56194bafecd567bb5696ef9cce40fad8484877ba 100644 (file)
@@ -6,7 +6,7 @@
                $sel = ' selected';
                foreach($_['serverConfigurationPrefixes'] as $prefix) {
                        ?>
-                       <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', array($i++)));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
+                       <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++]));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
                        <?php
                }
                ?>
index e8fa47c6ab9918cbf6c4eb6ea22deded48469ed7..0397a851557fe5e22d0ba74de816c0b2b593064b 100644 (file)
@@ -116,7 +116,7 @@ class AccessTest extends TestCase {
                        ->getMock();
                $helper = new Helper(\OC::$server->getConfig());
 
-               return array($lw, $connector, $um, $helper);
+               return [$lw, $connector, $um, $helper];
        }
 
        public function testEscapeFilterPartValidChars() {
@@ -147,9 +147,9 @@ class AccessTest extends TestCase {
        }
 
        public function convertSID2StrSuccessData() {
-               return array(
-                       array(
-                               array(
+               return [
+                       [
+                               [
                                        "\x01",
                                        "\x04",
                                        "\x00\x00\x00\x00\x00\x05",
@@ -157,20 +157,20 @@ class AccessTest extends TestCase {
                                        "\xa6\x81\xe5\x0e",
                                        "\x4d\x6c\x6c\x2b",
                                        "\xca\x32\x05\x5f",
-                               ),
+                               ],
                                'S-1-5-21-249921958-728525901-1594176202',
-                       ),
-                       array(
-                               array(
+                       ],
+                       [
+                               [
                                        "\x01",
                                        "\x02",
                                        "\xFF\xFF\xFF\xFF\xFF\xFF",
                                        "\xFF\xFF\xFF\xFF",
                                        "\xFF\xFF\xFF\xFF",
-                               ),
+                               ],
                                'S-1-281474976710655-4294967295-4294967295',
-                       ),
-               );
+                       ],
+               ];
        }
 
        public function testConvertSID2StrInputError() {
@@ -208,12 +208,12 @@ class AccessTest extends TestCase {
                return  [[
                        [
                                'input' => 'foo=bar,bar=foo,dc=foobar',
-                               'interResult' => array(
+                               'interResult' => [
                                        'count' => 3,
                                        0 => 'foo=bar',
                                        1 => 'bar=foo',
                                        2 => 'dc=foobar'
-                               ),
+                               ],
                                'expectedResult' => true
                        ],
                        [
@@ -408,12 +408,12 @@ class AccessTest extends TestCase {
 
        public function dNAttributeProvider() {
                // corresponds to Access::resemblesDN()
-               return array(
-                       'dn' => array('dn'),
-                       'uniqueMember' => array('uniquemember'),
-                       'member' => array('member'),
-                       'memberOf' => array('memberof')
-               );
+               return [
+                       'dn' => ['dn'],
+                       'uniqueMember' => ['uniquemember'],
+                       'member' => ['member'],
+                       'memberOf' => ['memberof']
+               ];
        }
 
        /**
@@ -432,9 +432,9 @@ class AccessTest extends TestCase {
                        ->willReturn(true);
                $lw->expects($this->any())
                        ->method('getAttributes')
-                       ->willReturn(array(
-                               $attribute => array('count' => 1, $dnFromServer)
-                       ));
+                       ->willReturn([
+                               $attribute => ['count' => 1, $dnFromServer]
+                       ]);
 
                $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager);
                $values = $access->readAttribute('uid=whoever,dc=example,dc=org', $attribute);
index 1c757aa5a47fb249392fa432dbd19d7f1a240255..c44f8a0177a597605e52a4fed59ecce29c15f4f4 100644 (file)
@@ -36,71 +36,71 @@ class ConfigurationTest extends \Test\TestCase {
        }
 
        public function configurationDataProvider() {
-               $inputWithDN = array(
+               $inputWithDN = [
                        'cn=someUsers,dc=example,dc=org',
                        '  ',
                        ' cn=moreUsers,dc=example,dc=org '
-               );
-               $expectWithDN = array(
+               ];
+               $expectWithDN = [
                        'cn=someUsers,dc=example,dc=org',
                        'cn=moreUsers,dc=example,dc=org'
-               );
+               ];
 
-               $inputNames = array(
+               $inputNames = [
                        '  uid  ',
                        'cn ',
                        ' ',
                        '',
                        ' whats my name',
                    '   '
-               );
-               $expectedNames = array('uid', 'cn', 'whats my name');
+               ];
+               $expectedNames = ['uid', 'cn', 'whats my name'];
 
                $inputString = ' alea iacta est ';
                $expectedString = 'alea iacta est';
 
-               $inputHomeFolder = array(
+               $inputHomeFolder = [
                        ' homeDirectory ',
                        ' attr:homeDirectory ',
                        ' '
-               );
+               ];
 
-               $expectedHomeFolder = array(
+               $expectedHomeFolder = [
                        'attr:homeDirectory', 'attr:homeDirectory', ''
-               );
+               ];
 
                $password = ' such a passw0rd ';
 
-               return array(
-                       'set general base' => array('ldapBase', $inputWithDN, $expectWithDN),
-                       'set user base'    => array('ldapBaseUsers', $inputWithDN, $expectWithDN),
-                       'set group base'   => array('ldapBaseGroups', $inputWithDN, $expectWithDN),
+               return [
+                       'set general base' => ['ldapBase', $inputWithDN, $expectWithDN],
+                       'set user base'    => ['ldapBaseUsers', $inputWithDN, $expectWithDN],
+                       'set group base'   => ['ldapBaseGroups', $inputWithDN, $expectWithDN],
 
-                       'set search attributes users'  => array('ldapAttributesForUserSearch', $inputNames, $expectedNames),
-                       'set search attributes groups' => array('ldapAttributesForGroupSearch', $inputNames, $expectedNames),
+                       'set search attributes users'  => ['ldapAttributesForUserSearch', $inputNames, $expectedNames],
+                       'set search attributes groups' => ['ldapAttributesForGroupSearch', $inputNames, $expectedNames],
 
-                       'set user filter objectclasses'  => array('ldapUserFilterObjectclass', $inputNames, $expectedNames),
-                       'set user filter groups'         => array('ldapUserFilterGroups', $inputNames, $expectedNames),
-                       'set group filter objectclasses' => array('ldapGroupFilterObjectclass', $inputNames, $expectedNames),
-                       'set group filter groups'        => array('ldapGroupFilterGroups', $inputNames, $expectedNames),
-                       'set login filter attributes'    => array('ldapLoginFilterAttributes', $inputNames, $expectedNames),
+                       'set user filter objectclasses'  => ['ldapUserFilterObjectclass', $inputNames, $expectedNames],
+                       'set user filter groups'         => ['ldapUserFilterGroups', $inputNames, $expectedNames],
+                       'set group filter objectclasses' => ['ldapGroupFilterObjectclass', $inputNames, $expectedNames],
+                       'set group filter groups'        => ['ldapGroupFilterGroups', $inputNames, $expectedNames],
+                       'set login filter attributes'    => ['ldapLoginFilterAttributes', $inputNames, $expectedNames],
 
-                       'set agent password' => array('ldapAgentPassword', $password, $password),
+                       'set agent password' => ['ldapAgentPassword', $password, $password],
 
-                       'set home folder, variant 1' => array('homeFolderNamingRule', $inputHomeFolder[0], $expectedHomeFolder[0]),
-                       'set home folder, variant 2' => array('homeFolderNamingRule', $inputHomeFolder[1], $expectedHomeFolder[1]),
-                       'set home folder, empty'     => array('homeFolderNamingRule', $inputHomeFolder[2], $expectedHomeFolder[2]),
+                       'set home folder, variant 1' => ['homeFolderNamingRule', $inputHomeFolder[0], $expectedHomeFolder[0]],
+                       'set home folder, variant 2' => ['homeFolderNamingRule', $inputHomeFolder[1], $expectedHomeFolder[1]],
+                       'set home folder, empty'     => ['homeFolderNamingRule', $inputHomeFolder[2], $expectedHomeFolder[2]],
 
                        // default behaviour, one case is enough, special needs must be tested
                        // individually
-                       'set string value' => array('ldapHost', $inputString, $expectedString),
+                       'set string value' => ['ldapHost', $inputString, $expectedString],
 
                        'set avatar rule, default' => ['ldapUserAvatarRule', 'default', 'default'],
                        'set avatar rule, none' => ['ldapUserAvatarRule', 'none', 'none'],
                        'set avatar rule, data attribute' => ['ldapUserAvatarRule', 'data:jpegPhoto', 'data:jpegPhoto'],
 
                        'set external storage home attribute' => ['ldapExtStorageHomeAttribute', 'homePath', 'homePath'],
-               );
+               ];
        }
 
        /**
index 82e6f85952d09591e4650218e45487cdd8f22d4c..778a666317b522d3829a4fa3191fd6d4cd5b6c7d 100644 (file)
@@ -67,17 +67,17 @@ class ConnectionTest extends \Test\TestCase {
                $lw  = $this->createMock(ILDAPWrapper::class);
 
                $connection = new Connection($lw, '', null);
-               $agent = array(
+               $agent = [
                        'ldapAgentName' => 'agent',
                        'ldapAgentPassword' => '123456',
-               );
+               ];
                $connection->setConfiguration($agent);
 
                $testConnection = clone $connection;
-               $user = array(
+               $user = [
                        'ldapAgentName' => 'user',
                        'ldapAgentPassword' => 'password',
-               );
+               ];
                $testConnection->setConfiguration($user);
 
                $agentName = $connection->ldapAgentName;
index 5fdc3c5862c6c5380a7f098577224a2346e481e2..d5a6f3b712cbcd01056f0a72001ee2a75cae5e0c 100644 (file)
@@ -229,7 +229,7 @@ class Group_LDAPTest extends TestCase {
 
                $access->expects($this->once())
                        ->method('searchGroups')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $access->expects($this->never())
                        ->method('dn2groupname');
@@ -276,7 +276,7 @@ class Group_LDAPTest extends TestCase {
                $access->expects($this->once())
                        ->method('readAttribute')
                        ->with($dn, $attr)
-                       ->willReturn(array('3117'));
+                       ->willReturn(['3117']);
 
                $groupBackend = new GroupLDAP($access, $pluginManager);
 
@@ -376,7 +376,7 @@ class Group_LDAPTest extends TestCase {
 
                $access->expects($this->once())
                        ->method('searchGroups')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $access->expects($this->never())
                        ->method('dn2groupname');
@@ -430,7 +430,7 @@ class Group_LDAPTest extends TestCase {
                $access->expects($this->once())
                        ->method('readAttribute')
                        ->with($dn, $attr)
-                       ->willReturn(array('3117'));
+                       ->willReturn(['3117']);
 
                $groupBackend = new GroupLDAP($access, $pluginManager);
 
@@ -496,7 +496,7 @@ class Group_LDAPTest extends TestCase {
 
                $access->expects($this->once())
                        ->method('nextcloudGroupNames')
-                       ->willReturn(array('group1', 'group2'));
+                       ->willReturn(['group1', 'group2']);
 
                $groupBackend = new GroupLDAP($access, $pluginManager);
                $groups = $groupBackend->getGroups('', 2, 2);
@@ -521,11 +521,11 @@ class Group_LDAPTest extends TestCase {
                        ->method('readAttribute')
                        ->willReturnCallback(function($dn, $attr) {
                                if($attr === 'primaryGroupToken') {
-                                       return array(1337);
+                                       return [1337];
                                } else if($attr === 'gidNumber') {
                                        return [4211];
                                }
-                               return array();
+                               return [];
                        });
                $access->expects($this->any())
                        ->method('groupname2dn')
@@ -558,16 +558,16 @@ class Group_LDAPTest extends TestCase {
                        ->method('readAttribute')
                        ->willReturnCallback(function($dn, $attr) {
                                if($attr === 'primaryGroupToken') {
-                                       return array(1337);
+                                       return [1337];
                                }
-                               return array();
+                               return [];
                        });
                $access->expects($this->any())
                        ->method('groupname2dn')
                        ->willReturn('cn=foobar,dc=foo,dc=bar');
                $access->expects($this->once())
                        ->method('nextcloudUserNames')
-                       ->willReturn(array('lisa', 'bart', 'kira', 'brad'));
+                       ->willReturn(['lisa', 'bart', 'kira', 'brad']);
                $access->userManager = $this->createMock(Manager::class);
 
                $groupBackend = new GroupLDAP($access, $pluginManager);
@@ -594,9 +594,9 @@ class Group_LDAPTest extends TestCase {
                        ->method('readAttribute')
                        ->willReturnCallback(function($dn, $attr) {
                                if($attr === 'primaryGroupToken') {
-                                       return array(1337);
+                                       return [1337];
                                }
-                               return array();
+                               return [];
                        });
 
                $access->expects($this->any())
index e652b7a644c3d907673e566892becdb7001aa073..6912fc2d9a70c21a80a40aa2b482678fe1919828 100644 (file)
@@ -129,12 +129,12 @@ class ExceptionOnLostConnection {
                //host contains port, 2nd parameter will be ignored
                $cr = $this->ldap->connect($this->ldapHost, 0);
                $this->ldap->bind($cr, $this->ldapBindDN, $this->ldapBindPwd);
-               $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', array('dn'), true, 5);
+               $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', ['dn'], true, 5);
 
                // disable LDAP, will cause lost connection
                $this->setProxyState(false);
                try {
-                       $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', array('dn'), true, 5);
+                       $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', ['dn'], true, 5);
                } catch (ServerNotAvailableException $e) {
                        print("Test PASSED" . PHP_EOL);
                        exit(0);
@@ -173,9 +173,9 @@ class ExceptionOnLostConnection {
                $ch = $this->getCurl();
                curl_setopt($ch, CURLOPT_POST, true);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
-               curl_setopt($ch, CURLOPT_HTTPHEADER, array(
+               curl_setopt($ch, CURLOPT_HTTPHEADER, [
                                'Content-Type: application/json',
-                               'Content-Length: ' . strlen($postData))
+                               'Content-Length: ' . strlen($postData)]
                );
                $recvd = curl_exec($ch);
                $this->checkCurlResult($ch, $recvd);
index 22065d14b2ce385b87fe47212934ab78de654172..f08a5440c4feff4d36f3c6ba19ab5771506bda9a 100644 (file)
@@ -31,7 +31,7 @@ use OCP\IDBConnection;
 
 class CleanUpTest extends \Test\TestCase {
        public function getMocks() {
-               $mocks = array();
+               $mocks = [];
                $mocks['userBackend'] =
                        $this->getMockBuilder('\OCA\User_LDAP\User_Proxy')
                                ->disableOriginalConstructor()
index b6e63f4a7ae56317eefaccd52980b25fd744d911..71e08654893694974ff3b1ad14c6b00c437e92db 100644 (file)
@@ -601,7 +601,7 @@ class LDAPProviderTest extends \Test\TestCase {
                        ->willReturn(true);
                $userBackend->expects($this->at(3))
                        ->method('getConfiguration')
-                       ->willReturn(array('ldap_display_name'=>'displayName'));
+                       ->willReturn(['ldap_display_name'=>'displayName']);
                $userBackend->expects($this->any())
                        ->method($this->anything())
                        ->willReturnSelf();
@@ -639,7 +639,7 @@ class LDAPProviderTest extends \Test\TestCase {
                        ->willReturn(true);
                $userBackend->expects($this->at(3))
                        ->method('getConfiguration')
-                       ->willReturn(array('ldap_email_attr'=>'mail'));
+                       ->willReturn(['ldap_email_attr'=>'mail']);
                $userBackend->expects($this->any())
                        ->method($this->anything())
                        ->willReturnSelf();
@@ -687,7 +687,7 @@ class LDAPProviderTest extends \Test\TestCase {
                        ->willReturn(true);
                $groupBackend->expects($this->any())
                        ->method('getConfiguration')
-                       ->willReturn(array('ldap_group_member_assoc_attribute'=>'assoc_type'));
+                       ->willReturn(['ldap_group_member_assoc_attribute'=>'assoc_type']);
                $groupBackend->expects($this->any())
                        ->method($this->anything())
                        ->willReturnSelf();
index 9821336df75a278f63b6cb2b9bc9707a407a9f61..c06017f4be47164fa64b551fb84471425a3f1e7b 100644 (file)
@@ -86,7 +86,7 @@ class LDAPTest extends TestCase  {
                $this->ldap
                        ->expects($this->once())
                        ->method('invokeLDAPMethod')
-                       ->with('mod_replace', $link, $userDN, array('userPassword' => $password))
+                       ->with('mod_replace', $link, $userDN, ['userPassword' => $password])
                        ->willReturn(true);
 
                $this->assertTrue($this->ldap->modReplace($link, $userDN, $password));
index 57177819c2dbbf9ef2ffdc450eab99cfac5ab821..e4aadb3ea975a8e77ecdb14c9612519a24cfe820 100644 (file)
@@ -49,23 +49,23 @@ abstract class AbstractMappingTest extends \Test\TestCase {
         * @return array
         */
        protected function getTestData() {
-               $data = array(
-                       array(
+               $data = [
+                       [
                                'dn' => 'uid=foobar,dc=example,dc=org',
                                'name' => 'Foobar',
                                'uuid' => '1111-AAAA-1234-CDEF',
-                       ),
-                       array(
+                       ],
+                       [
                                'dn' => 'uid=barfoo,dc=example,dc=org',
                                'name' => 'Barfoo',
                                'uuid' => '2222-BBBB-1234-CDEF',
-                       ),
-                       array(
+                       ],
+                       [
                                'dn' => 'uid=barabara,dc=example,dc=org',
                                'name' => 'BaraBara',
                                'uuid' => '3333-CCCC-1234-CDEF',
-                       )
-               );
+                       ]
+               ];
 
                return $data;
        }
@@ -97,7 +97,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
                $mapper->clear();
                $this->mapEntries($mapper, $data);
 
-               return array($mapper, $data);
+               return [$mapper, $data];
        }
 
        /**
@@ -109,7 +109,7 @@ abstract class AbstractMappingTest extends \Test\TestCase {
 
                // test that mapping will not happen when it shall not
                $tooLongDN = 'uid=joann,ou=Secret Small Specialized Department,ou=Some Tremendously Important Department,ou=Another Very Important Department,ou=Pretty Meaningful Derpartment,ou=Quite Broad And General Department,ou=The Topmost Department,dc=hugelysuccessfulcompany,dc=com';
-               $paramKeys = array('', 'dn', 'name', 'uuid', $tooLongDN);
+               $paramKeys = ['', 'dn', 'name', 'uuid', $tooLongDN];
                foreach($paramKeys as $key) {
                        $failEntry = $data[0];
                        if(!empty($key)) {
index cb9df7037b986d83f65f6f5286a3bf29858e6406..54a35f032b458c1803c939c9230d01b79de626b7 100644 (file)
@@ -1032,9 +1032,9 @@ class UserTest extends \Test\TestCase {
                        ->setMethods($requiredMethods)
                        ->getMock();
 
-               $this->connection->setConfiguration(array(
+               $this->connection->setConfiguration([
                        'homeFolderNamingRule' => 'homeDirectory'
-               ));
+               ]);
                $this->connection->expects($this->any())
                        ->method('__get')
                        ->willReturnCallback(function($name) {
@@ -1070,10 +1070,10 @@ class UserTest extends \Test\TestCase {
        }
 
        public function emptyHomeFolderAttributeValueProvider() {
-               return array(
+               return [
                        'empty' => [''],
                        'prefixOnly' => ['attr:'],
-               );
+               ];
        }
 
        /**
index f3052b1932748c2cffacae72c5414852927e7adb..baa307b2e6b0282176e48f7e277b3cb428ae3da9 100644 (file)
@@ -149,17 +149,17 @@ class User_LDAPTest extends TestCase {
                           ->method('fetchListOfUsers')
                           ->willReturnCallback(function($filter) {
                                        if($filter === 'roland') {
-                                               return array(array('dn' => ['dnOfRoland,dc=test']));
+                                               return [['dn' => ['dnOfRoland,dc=test']]];
                                        }
-                                       return array();
+                                       return [];
                           });
                $this->access->expects($this->any())
                        ->method('fetchUsersByLoginName')
                        ->willReturnCallback(function($uid) {
                                if($uid === 'roland') {
-                                       return array(array('dn' => ['dnOfRoland,dc=test']));
+                                       return [['dn' => ['dnOfRoland,dc=test']]];
                                }
-                               return array();
+                               return [];
                        });
 
                $retVal = 'gunslinger';
@@ -378,11 +378,11 @@ class User_LDAPTest extends TestCase {
                $this->access->expects($this->any())
                           ->method('fetchListOfUsers')
                           ->willReturnCallback(function($search, $a, $l, $o) {
-                                       $users = array('gunslinger', 'newyorker', 'ladyofshadows');
+                                       $users = ['gunslinger', 'newyorker', 'ladyofshadows'];
                                        if(empty($search)) {
                                                $result = $users;
                                        } else {
-                                               $result = array();
+                                               $result = [];
                                                foreach($users as $user) {
                                                        if(stripos($user,  $search) !== false) {
                                                                $result[] = $user;
@@ -545,7 +545,7 @@ class User_LDAPTest extends TestCase {
                        ->method('readAttribute')
                        ->willReturnCallback(function($dn) {
                                if($dn === 'dnOfRoland,dc=test') {
-                                       return array();
+                                       return [];
                                }
                                return false;
                        });
@@ -570,7 +570,7 @@ class User_LDAPTest extends TestCase {
                        ->method('readAttribute')
                        ->willReturnCallback(function($dn) {
                                if($dn === 'dnOfRoland,dc=test') {
-                                       return array();
+                                       return [];
                                }
                                return false;
                        });
@@ -613,9 +613,9 @@ class User_LDAPTest extends TestCase {
                                switch ($dn) {
                                        case 'dnOfRoland,dc=test':
                                                if($attr === 'testAttribute') {
-                                                       return array('/tmp/rolandshome/');
+                                                       return ['/tmp/rolandshome/'];
                                                }
-                                               return array();
+                                               return [];
                                                break;
                                        default:
                                                return false;
@@ -665,9 +665,9 @@ class User_LDAPTest extends TestCase {
                                switch ($dn) {
                                        case 'dnOfLadyOfShadows,dc=test':
                                                if($attr === 'testAttribute') {
-                                                       return array('susannah/');
+                                                       return ['susannah/'];
                                                }
-                                               return array();
+                                               return [];
                                                break;
                                        default:
                                                return false;
@@ -821,9 +821,9 @@ class User_LDAPTest extends TestCase {
                                        switch ($dn) {
                                                case 'dnOfRoland,dc=test':
                                                        if($attr === 'displayname') {
-                                                               return array('Roland Deschain');
+                                                               return ['Roland Deschain'];
                                                        }
-                                                       return array();
+                                                       return [];
                                                        break;
 
                                                default:
@@ -1156,17 +1156,17 @@ class User_LDAPTest extends TestCase {
                           ->method('fetchListOfUsers')
                           ->willReturnCallback(function($filter) {
                                        if($filter === 'roland') {
-                                               return array(array('dn' => ['dnOfRoland,dc=test']));
+                                               return [['dn' => ['dnOfRoland,dc=test']]];
                                        }
-                                       return array();
+                                       return [];
                           });
                $this->access->expects($this->any())
                        ->method('fetchUsersByLoginName')
                        ->willReturnCallback(function($uid) {
                                if($uid === 'roland') {
-                                       return array(array('dn' => ['dnOfRoland,dc=test']));
+                                       return [['dn' => ['dnOfRoland,dc=test']]];
                                }
-                               return array();
+                               return [];
                        });
                $this->access->expects($this->any())
                           ->method('dn2username')
index db23fc1ed4091e7d643f40a102c28b84533fe591..50931c75ff6dce925f48ad8252f94764dfe8c20b 100644 (file)
@@ -47,8 +47,8 @@ class WizardTest extends TestCase {
                parent::setUp();
                //we need to make sure the consts are defined, otherwise tests will fail
                //on systems without php5_ldap
-               $ldapConsts = array('LDAP_OPT_PROTOCOL_VERSION',
-                                                       'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT');
+               $ldapConsts = ['LDAP_OPT_PROTOCOL_VERSION',
+                                                       'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT'];
                foreach($ldapConsts as $const) {
                        if(!defined($const)) {
                                define($const, 42);
@@ -78,7 +78,7 @@ class WizardTest extends TestCase {
                /** @var Access|\PHPUnit_Framework_MockObject_MockObject $access */
                $access = $this->createMock(Access::class);
 
-               return array(new Wizard($conf, $lw, $access), $conf, $lw, $access);
+               return [new Wizard($conf, $lw, $access), $conf, $lw, $access];
        }
 
        private function prepareLdapWrapperForConnections(MockObject &$ldap) {
@@ -104,7 +104,7 @@ class WizardTest extends TestCase {
                        ->method('__get')
                        ->willReturnCallback(function($name) {
                                        if($name === 'ldapBase') {
-                                               return array('base');
+                                               return ['base'];
                                        }
                                        return null;
                           });
@@ -139,7 +139,7 @@ class WizardTest extends TestCase {
                $ldap->expects($this->exactly(10))
                        ->method('getAttributes')
                        //dummy value, usually invalid
-                       ->willReturn(array('cn' => array('foo'), 'count' => 1));
+                       ->willReturn(['cn' => ['foo'], 'count' => 1]);
 
                global $uidnumber;
                $uidnumber = 1;
@@ -152,7 +152,7 @@ class WizardTest extends TestCase {
                        });
 
                // The following expectations are the real test
-               $filters = array('f1', 'f2', '*');
+               $filters = ['f1', 'f2', '*'];
                $wizard->cumulativeSearchOnAttribute($filters, 'cn', 5);
                unset($uidnumber);
        }
@@ -164,7 +164,7 @@ class WizardTest extends TestCase {
                        ->method('__get')
                        ->willReturnCallback(function($name) {
                                        if($name === 'ldapBase') {
-                                               return array('base');
+                                               return ['base'];
                                        }
                                        return null;
                           });
@@ -215,7 +215,7 @@ class WizardTest extends TestCase {
                $ldap->expects($this->exactly(46))
                        ->method('getAttributes')
                        //dummy value, usually invalid
-                       ->willReturn(array('cn' => array('foo'), 'count' => 1));
+                       ->willReturn(['cn' => ['foo'], 'count' => 1]);
 
                global $uidnumber;
                $uidnumber = 1;
@@ -228,7 +228,7 @@ class WizardTest extends TestCase {
                        });
 
                // The following expectations are the real test
-               $filters = array('f1', 'f2', '*');
+               $filters = ['f1', 'f2', '*'];
                $wizard->cumulativeSearchOnAttribute($filters, 'cn', 0);
                unset($uidnumber);
        }
@@ -380,7 +380,7 @@ class WizardTest extends TestCase {
                        ->method('__get')
                        ->willReturnCallback(function($name) {
                                        if($name === 'ldapBase') {
-                                               return array('base');
+                                               return ['base'];
                                        }
                                        return null;
                           });
@@ -432,7 +432,7 @@ class WizardTest extends TestCase {
                        ->method('getAttributes')
                        //dummy value, usually invalid
                        ->willReturnCallback(function($a, $entry) {
-                               return array('cn' => array($entry), 'count' => 1);
+                               return ['cn' => [$entry], 'count' => 1];
                        });
 
                $ldap->expects($this->any())
@@ -443,7 +443,7 @@ class WizardTest extends TestCase {
                        });
 
                // The following expectations are the real test
-               $filters = array('f1', 'f2', '*');
+               $filters = ['f1', 'f2', '*'];
                $resultArray = $wizard->cumulativeSearchOnAttribute($filters, 'cn', 0);
                $this->assertSame(6, count($resultArray));
                unset($mark);
index 0e3a1c7873d1d879c490f08ab4b5692402ee5cb9..cbf09fcda84129726cdabde0f20f31f795d00b61 100644 (file)
@@ -76,8 +76,8 @@ class CommentsContext implements \Behat\Behat\Context\Context {
         */
        private function getFileIdForPath($path) {
                $url = $this->baseUrl . '/remote.php/webdav/' . $path;
-               $context = stream_context_create(array(
-                       'http' => array(
+               $context = stream_context_create([
+                       'http' => [
                                'method' => 'PROPFIND',
                                'header' => "Authorization: Basic dXNlcjA6MTIzNDU2\r\nContent-Type: application/x-www-form-urlencoded",
                                'content' => '<?xml version="1.0"?>
@@ -86,8 +86,8 @@ class CommentsContext implements \Behat\Behat\Context\Context {
     <oc:fileid />
   </d:prop>
 </d:propfind>'
-                       )
-               ));
+                       ]
+               ]);
 
                $response = file_get_contents($url, false, $context);
                preg_match_all('/\<oc:fileid\>(.*)\<\/oc:fileid\>/', $response, $matches);
index 4339c9a01af7bc36a4b4b30ca9f0ec7d200575bd..73354d3b769c120024b81eaa69407163bd5dc551 100644 (file)
@@ -274,7 +274,7 @@ trait Provisioning {
                ];
 
                $this->response = $client->get($fullUrl, $options);
-               $groups = array($group);
+               $groups = [$group];
                $respondedArray = $this->getArrayOfGroupsResponded($this->response);
                Assert::assertNotEquals($groups, $respondedArray, "", 0.0, 10, true);
                Assert::assertEquals(200, $this->response->getStatusCode());
index 8f423244018d1cf8595bae573f287aefd20e5b64..6f3d8008a20b140a9e5e2128033cbbe1569f155e 100644 (file)
@@ -500,8 +500,8 @@ class TagsContext implements \Behat\Behat\Context\Context {
        private function getFileIdForPath($path, $user) {
                $url = $this->baseUrl . '/remote.php/webdav/' . $path;
                $credentials = base64_encode($user . ':' . $this->getPasswordForUser($user));
-               $context = stream_context_create(array(
-                       'http' => array(
+               $context = stream_context_create([
+                       'http' => [
                                'method' => 'PROPFIND',
                                'header' => "Authorization: Basic $credentials\r\nContent-Type: application/x-www-form-urlencoded",
                                'content' => '<?xml version="1.0"?>
@@ -510,8 +510,8 @@ class TagsContext implements \Behat\Behat\Context\Context {
     <oc:fileid />
   </d:prop>
 </d:propfind>'
-                       )
-               ));
+                       ]
+               ]);
                $response = file_get_contents($url, false, $context);
                preg_match_all('/\<oc:fileid\>(.*?)\<\/oc:fileid\>/', $response, $matches);
                return (int)$matches[1][0];
index 3dc168706758da73f1fb17b7d5a08b66e44e1c29..0e19f69826149812dbeb13248bcd21b42c8649db 100644 (file)
@@ -20,7 +20,7 @@
  *  * use RST syntax
  */
 
-$CONFIG = array(
+$CONFIG = [
 
 
 /**
@@ -69,12 +69,12 @@ $CONFIG = array(
  *   Using TLS certificates where commonName=<IP address> is deprecated
  */
 'trusted_domains' =>
-  array (
+   [
     'demo.example.org',
     'otherdomain.example.org',
     '10.111.112.113',
     '[2001:db8::1]'
-  ),
+  ],
 
 
 /**
@@ -418,7 +418,7 @@ $CONFIG = array(
  * will be passed to underlying Swift mailer implementation.
  * Defaults to an empty array.
  */
-'mail_smtpstreamoptions' => array(),
+'mail_smtpstreamoptions' => [],
 
 /**
  * Which mode is used for sendmail/qmail: ``smtp`` or ``pipe``.
@@ -696,12 +696,12 @@ $CONFIG = array(
  *  - www.eff.org
  *  - www.edri.org
  */
-'connectivity_check_domains' => array(
+'connectivity_check_domains' => [
        'www.nextcloud.com',
        'www.startpage.com',
        'www.eff.org',
        'www.edri.org'
-),
+],
 
 /**
  * Allows Nextcloud to verify a working .well-known URL redirects. This is done
@@ -900,13 +900,13 @@ $CONFIG = array(
  * to that folder, starting from the Nextcloud webroot. The key ``writable``
  * indicates if a Web server can write files to that folder.
  */
-'apps_paths' => array(
-       array(
+'apps_paths' => [
+       [
                'path'=> '/var/www/nextcloud/apps',
                'url' => '/apps',
                'writable' => true,
-       ),
-),
+       ],
+],
 
 /**
  * @see appcodechecker
@@ -1014,7 +1014,7 @@ $CONFIG = array(
  *  - OC\Preview\TXT
  *  - OC\Preview\XBitmap
  */
-'enabledPreviewProviders' => array(
+'enabledPreviewProviders' => [
        'OC\Preview\PNG',
        'OC\Preview\JPEG',
        'OC\Preview\GIF',
@@ -1024,7 +1024,7 @@ $CONFIG = array(
        'OC\Preview\MP3',
        'OC\Preview\TXT',
        'OC\Preview\MarkDown'
-),
+],
 
 /**
  * LDAP
@@ -1102,9 +1102,9 @@ $CONFIG = array(
   *
  * Defaults to an empty array.
  */
-'openssl' => array(
+'openssl' => [
        'config' => '/absolute/location/of/openssl.cnf',
-),
+],
 
 /**
  * Memory caching backend configuration
@@ -1198,18 +1198,18 @@ $CONFIG = array(
 /**
  * Server details for one or more memcached servers to use for memory caching.
  */
-'memcached_servers' => array(
+'memcached_servers' => [
        // hostname, port and optional weight. Also see:
        // http://www.php.net/manual/en/memcached.addservers.php
        // http://www.php.net/manual/en/memcached.addserver.php
-       array('localhost', 11211),
+       ['localhost', 11211],
        //array('other.host.local', 11211),
-),
+],
 
 /**
  * Connection options for memcached
  */
-'memcached_options' => array(
+'memcached_options' => [
        // Set timeouts to 50ms
        \Memcached::OPT_CONNECT_TIMEOUT => 50,
        \Memcached::OPT_RETRY_TIMEOUT =>   50,
@@ -1228,7 +1228,7 @@ $CONFIG = array(
 
        // Binary serializer vill be enabled if the igbinary PECL module is available
        //\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY,
-),
+],
 
 
 /**
@@ -1378,10 +1378,10 @@ $CONFIG = array(
  * Additional driver options for the database connection, eg. to enable SSL
  * encryption in MySQL or specify a custom wait timeout on a cheap hoster.
  */
-'dbdriveroptions' => array(
+'dbdriveroptions' => [
        PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem',
        PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800'
-),
+],
 
 /**
  * sqlite3 journal mode can be specified using this configuration parameter -
@@ -1436,12 +1436,12 @@ $CONFIG = array(
  *  - mysql (MySQL)
  *  - pgsql (PostgreSQL)
  */
-'supportedDatabases' => array(
+'supportedDatabases' => [
        'sqlite',
        'mysql',
        'pgsql',
        'oci',
-),
+],
 
 /**
  * Override where Nextcloud stores temporary files. Useful in situations where
@@ -1507,7 +1507,7 @@ $CONFIG = array(
  *
  * Defaults to ``array('.htaccess')``
  */
-'blacklisted_files' => array('.htaccess'),
+'blacklisted_files' => ['.htaccess'],
 
 /**
  * Define a default folder for shared files and folders other than root.
@@ -1634,7 +1634,7 @@ $CONFIG = array(
  *
  * Defaults to an empty array.
  */
-'trusted_proxies' => array('203.0.113.45', '198.51.100.128', '192.168.2.0/24'),
+'trusted_proxies' => ['203.0.113.45', '198.51.100.128', '192.168.2.0/24'],
 
 /**
  * Headers that should be trusted as client IP address in combination with
@@ -1646,7 +1646,7 @@ $CONFIG = array(
  *
  * Defaults to ``'HTTP_X_FORWARDED_FOR'``
  */
-'forwarded_for_headers' => array('HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR'),
+'forwarded_for_headers' => ['HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR'],
 
 /**
  * max file size for animating gifs on public-sharing-site.
@@ -1767,10 +1767,10 @@ $CONFIG = array(
  *
  * WARNING: only use this if you know what you are doing
  */
-'csrf.optout' => array(
+'csrf.optout' => [
        '/^WebDAVFS/', // OS X Finder
        '/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive
-),
+],
 
 /**
  * By default there is on public pages a link shown that allows users to
@@ -1789,4 +1789,4 @@ $CONFIG = array(
  */
 
 'login_form_autocomplete' => true,
-);
+];
index f02da1c66ba88df03eabf4ef1e7eaa4006f8ff5d..19d0251d82481b5f2ea0e74a4a6f2dbda5f56092 100644 (file)
@@ -83,7 +83,7 @@ class Update extends Command {
                $singleAppId = $input->getArgument('app-id');
 
                if ($singleAppId) {
-                       $apps = array($singleAppId);
+                       $apps = [$singleAppId];
                        try {
                                $this->manager->getAppPath($singleAppId);
                        } catch (\OCP\App\AppPathNotFoundException $e) {
index c38571d7c62905c79e6bfc0254c79438e2063d76..dd9290eea81d23d8708cfcfc150b00e9671d2f41 100644 (file)
@@ -69,7 +69,7 @@ class ListModules extends Base {
                $encryptionModules = $this->encryptionManager->getEncryptionModules();
                $defaultEncryptionModuleId = $this->encryptionManager->getDefaultEncryptionModuleId();
 
-               $encModules = array();
+               $encModules = [];
                foreach ($encryptionModules as $module) {
                        $encModules[$module['id']]['displayName'] = $module['displayName'];
                        $encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId;
index f2b833fe9144e7807600cdf7bc599bc0b957f768..3e67e1329f03cca493e973db15b42e0683b18adf 100644 (file)
@@ -72,7 +72,7 @@ class CreateJs extends Command implements CompletionAwareInterface {
        }
 
        private function getAllLanguages($path) {
-               $result = array();
+               $result = [];
                foreach (new DirectoryIterator("$path/l10n") as $fileInfo) {
                        if($fileInfo->isDot()) {
                                continue;
@@ -102,7 +102,7 @@ class CreateJs extends Command implements CompletionAwareInterface {
                        return;
                }
                $content = "OC.L10N.register(\n    \"$app\",\n    {\n    ";
-               $jsTrans = array();
+               $jsTrans = [];
                foreach ($translations as $id => $val) {
                        if (is_array($val)) {
                                $val = '[ ' . implode(',', $val) . ']';
@@ -122,21 +122,21 @@ class CreateJs extends Command implements CompletionAwareInterface {
                        $output->writeln("File already exists: $jsFile");
                        return;
                }
-               $content = array('translations' => $translations, 'pluralForm' => $plurals);
+               $content = ['translations' => $translations, 'pluralForm' => $plurals];
                file_put_contents($jsFile, json_encode($content));
                $output->writeln("Json translation file generated: $jsFile");
        }
 
        private function loadTranslations($path, $lang) {
                $phpFile = "$path/l10n/$lang.php";
-               $TRANSLATIONS = array();
+               $TRANSLATIONS = [];
                $PLURAL_FORMS = '';
                if (!file_exists($phpFile)) {
                        throw new UnexpectedValueException("PHP translation file <$phpFile> does not exist.");
                }
                require $phpFile;
 
-               return array($TRANSLATIONS, $PLURAL_FORMS);
+               return [$TRANSLATIONS, $PLURAL_FORMS];
        }
 
        /**
index 8f615004f3c8a600ea963f5b069c1bb0964d98ff..25632a313f36bb166879e5d91b492e8671064e51 100644 (file)
@@ -38,12 +38,12 @@ class Status extends Base {
        }
 
        protected function execute(InputInterface $input, OutputInterface $output) {
-               $values = array(
+               $values = [
                        'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
                        'version' => implode('.', \OCP\Util::getVersion()),
                        'versionstring' => \OC_Util::getVersionString(),
                        'edition' => '',
-               );
+               ];
 
                $this->writeArrayInOutputFormat($input, $output, $values);
        }
index 944b1da9f26559266b33a4c0188f26c803885921..0a66d63fd3215e6f8167ac48ed1d715d091f1b93 100644 (file)
@@ -285,7 +285,7 @@ class Upgrade extends Command {
         * @param OutputInterface $output output interface
         */
        protected function postUpgradeCheck(InputInterface $input, OutputInterface $output) {
-               $trustedDomains = $this->config->getSystemValue('trusted_domains', array());
+               $trustedDomains = $this->config->getSystemValue('trusted_domains', []);
                if (empty($trustedDomains)) {
                        $output->write(
                                '<warning>The setting "trusted_domains" could not be ' .
index 3f15d40dba7e011a362e7ca5d3326fcd65ecfa3a..77fbcc124faaa69ffc6dffcfcc31b7aafa3966e0 100644 (file)
@@ -52,25 +52,25 @@ class Report extends Command {
 
        protected function execute(InputInterface $input, OutputInterface $output) {
                $table = new Table($output);
-               $table->setHeaders(array('User Report', ''));
+               $table->setHeaders(['User Report', '']);
                $userCountArray = $this->countUsers();
                if(!empty($userCountArray)) {
                        $total = 0;
-                       $rows = array();
+                       $rows = [];
                        foreach($userCountArray as $classname => $users) {
                                $total += $users;
-                               $rows[] = array($classname, $users);
+                               $rows[] = [$classname, $users];
                        }
 
-                       $rows[] = array(' ');
-                       $rows[] = array('total users', $total);
+                       $rows[] = [' '];
+                       $rows[] = ['total users', $total];
                } else {
-                       $rows[] = array('No backend enabled that supports user counting', '');
+                       $rows[] = ['No backend enabled that supports user counting', ''];
                }
 
                $userDirectoryCount = $this->countUserDirectories();
-               $rows[] = array(' ');
-               $rows[] = array('user directories', $userDirectoryCount);
+               $rows[] = [' '];
+               $rows[] = ['user directories', $userDirectoryCount];
 
                $table->setRows($rows);
                $table->render();
index e8d9b8675b6570c89ec1440612eccaa42fd24019..cdeec469e046a7ca67c4947b41bc14073bc9d89e 100644 (file)
@@ -170,7 +170,7 @@ class LostController extends Controller {
                } catch (\Exception $e) {
                        return new TemplateResponse(
                                'core', 'error', [
-                                       "errors" => array(array("error" => $e->getMessage()))
+                                       "errors" => [["error" => $e->getMessage()]]
                                ],
                                'guest'
                        );
@@ -231,8 +231,8 @@ class LostController extends Controller {
         * @param array $additional
         * @return array
         */
-       private function error($message, array $additional=array()) {
-               return array_merge(array('status' => 'error', 'msg' => $message), $additional);
+       private function error($message, array $additional=[]) {
+               return array_merge(['status' => 'error', 'msg' => $message], $additional);
        }
 
        /**
@@ -297,7 +297,7 @@ class LostController extends Controller {
                                $instance = call_user_func($module['callback']);
                                // this way we can find out whether per-user keys are used or a system wide encryption key
                                if ($instance->needDetailedAccessList()) {
-                                       return $this->error('', array('encryption' => true));
+                                       return $this->error('', ['encryption' => true]);
                                }
                        }
                }
@@ -306,13 +306,13 @@ class LostController extends Controller {
                        $this->checkPasswordResetToken($token, $userId);
                        $user = $this->userManager->get($userId);
 
-                       \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', array('uid' => $userId, 'password' => $password));
+                       \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', ['uid' => $userId, 'password' => $password]);
 
                        if (!$user->setPassword($password)) {
                                throw new \Exception();
                        }
 
-                       \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', array('uid' => $userId, 'password' => $password));
+                       \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', ['uid' => $userId, 'password' => $password]);
 
                        $this->twoFactorManager->clearTwoFactorPending($userId);
 
@@ -354,7 +354,7 @@ class LostController extends Controller {
                $encryptedValue = $this->crypto->encrypt($tokenValue, $email . $this->config->getSystemValue('secret'));
                $this->config->setUserValue($user->getUID(), 'core', 'lostpassword', $encryptedValue);
 
-               $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', array('userId' => $user->getUID(), 'token' => $token));
+               $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $user->getUID(), 'token' => $token]);
 
                $emailTemplate = $this->mailer->createEMailTemplate('core.ResetPassword', [
                        'link' => $link,
index 664909b0fb946b4830668c3bce39c8b803e14d4c..60ea12f017c13524c13526a65baf8a9eadbba27e 100644 (file)
@@ -92,14 +92,14 @@ class OCSController extends \OCP\AppFramework\OCSController {
        public function getCapabilities() {
                $result = [];
                list($major, $minor, $micro) = \OCP\Util::getVersion();
-               $result['version'] = array(
+               $result['version'] = [
                        'major' => $major,
                        'minor' => $minor,
                        'micro' => $micro,
                        'string' => \OC_Util::getVersionString(),
                        'edition' => '',
                        'extendedSupport' => \OCP\Util::hasExtendedSupport()
-               );
+               ];
 
                if($this->userSession->isLoggedIn()) {
                        $result['capabilities'] = $this->capabilitiesManager->getCapabilities();
index 302edccf7a64df7fec97c2dc2d8d912a5c0f569c..0135e01f1487e1bdfc8b113d659774a871fc3a95 100644 (file)
@@ -74,7 +74,7 @@ class SetupController {
                if(isset($post['install']) AND $post['install']=='true') {
                        // We have to launch the installation process :
                        $e = $this->setupHelper->install($post);
-                       $errors = array('errors' => $e);
+                       $errors = ['errors' => $e];
 
                        if(count($e) > 0) {
                                $options = array_merge($opts, $post, $errors);
@@ -93,7 +93,7 @@ class SetupController {
        }
 
        public function display($post) {
-               $defaults = array(
+               $defaults = [
                        'adminlogin' => '',
                        'adminpass' => '',
                        'dbuser' => '',
@@ -102,7 +102,7 @@ class SetupController {
                        'dbtablespace' => '',
                        'dbhost' => 'localhost',
                        'dbtype' => '',
-               );
+               ];
                $parameters = array_merge($defaults, $post);
 
                \OC_Util::addScript('setup');
@@ -133,7 +133,7 @@ class SetupController {
        public function loadAutoConfig($post) {
                if( file_exists($this->autoConfigFile)) {
                        \OCP\Util::writeLog('core', 'Autoconfig file found, setting up Nextcloud…', ILogger::INFO);
-                       $AUTOCONFIG = array();
+                       $AUTOCONFIG = [];
                        include $this->autoConfigFile;
                        $post = array_merge ($post, $AUTOCONFIG);
                }
index 23b2eda4e26843771f249d71cbf9f896c23e3cfa..54c5202a59f3f5f52d209a3be41659a1fb63752e 100644 (file)
@@ -53,7 +53,7 @@ class UserController extends Controller {
         * @return JSONResponse
         */
        public function getDisplayNames($users) {
-               $result = array();
+               $result = [];
 
                foreach ($users as $user) {
                        $userObject = $this->userManager->get($user);
@@ -64,10 +64,10 @@ class UserController extends Controller {
                        }
                }
 
-               $json = array(
+               $json = [
                        'users' => $result,
                        'status' => 'success'
-               );
+               ];
 
                return new JSONResponse($json);
 
index 1744e2db18cc910158102d727002f042dec24f3b..fd0e2c80d645ae639d64dd6a8b3993c11483b5f0 100644 (file)
@@ -186,7 +186,7 @@ if (\OCP\Util::needUpgrade()) {
                $eventSource->send('success', (string)$l->t('Checked database schema update for apps'));
        });
        $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) {
-               $eventSource->send('success', (string)$l->t('Updated "%1$s" to %2$s', array($app, $version)));
+               $eventSource->send('success', (string)$l->t('Updated "%1$s" to %2$s', [$app, $version]));
        });
        $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) {
                $incompatibleApps[]= $app;
index 071d57b1b68a16d68b66f783601890cdcef8eb55..925059d47500b68f6f8d248ed5c9ffa4a1ff31e9 100644 (file)
@@ -20,7 +20,7 @@ if(!isset($_)) {//standalone  page is not supported anymore - redirect to /
                <h2><?php p($l->t('File not found')); ?></h2>
                <p class="infogroup"><?php p($l->t('The document could not be found on the server. Maybe the share was deleted or has expired?')); ?></p>
                <p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>">
-                       <?php p($l->t('Back to %s', array($theme->getName()))); ?>
+                       <?php p($l->t('Back to %s', [$theme->getName()])); ?>
                </a></p>
        </div>
 <?php endif; ?>
index 5a351e97416c9160a56b8d2c9d6056f60b0a216a..25052782e6fcca7aaf839b888705016c7a716822 100644 (file)
@@ -81,7 +81,7 @@ script('core', [
                <?php foreach($_['databases'] as $type => $label): ?>
                <?php if(count($_['databases']) === 1): ?>
                <p class="info">
-                       <?php p($l->t( 'Only %s is available.', array($label) )); ?>
+                       <?php p($l->t( 'Only %s is available.', [$label] )); ?>
                        <?php p($l->t( 'Install and activate additional PHP modules to choose other database types.' )); ?><br>
                        <a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer noopener">
                                <?php p($l->t( 'For more details check out the documentation.' )); ?> ↗</a>
index f4a1c72ae8d8f8e5a85062ecd088c9c599e6c0a5..4a010c025be6256cd9da3efec5780ac192f8f061 100644 (file)
@@ -4,7 +4,7 @@
                <h2 class="title"><?php p($l->t('App update required')); ?></h2>
                <?php } else { ?>
                <h2 class="title"><?php p($l->t('%1$s will be updated to version %2$s',
-                       array($_['productName'], $_['version']))); ?></h2>
+                       [$_['productName'], $_['version']])); ?></h2>
                <?php } ?>
                <?php if (!empty($_['appsToUpgrade'])) { ?>
                <div class="infogroup">
@@ -28,7 +28,7 @@
                <?php } ?>
                <?php if (!empty($_['oldTheme'])) { ?>
                <div class="infogroup">
-                       <?php p($l->t('The theme %s has been disabled.', array($_['oldTheme']))) ?>
+                       <?php p($l->t('The theme %s has been disabled.', [$_['oldTheme']])) ?>
                </div>
                <?php } ?>
                <div class="infogroup bold">
index 661d7d45a3070e8e5a0f71aee1a111657e6b259e..2c6ffd4344468857712434b538b8565cea09da74 100644 (file)
@@ -1,6 +1,6 @@
 <div class="body-login-container">
        <div class="icon-big icon-error-white"></div>
-       <h2><?php p($l->t('Maintenance mode', array($theme->getName()))) ?></h2>
-       <p><?php p($l->t('This %s instance is currently in maintenance mode, which may take a while.', array($theme->getName()))) ?> <?php p($l->t('This page will refresh itself when the instance is available again.')) ?></p>
+       <h2><?php p($l->t('Maintenance mode', [$theme->getName()])) ?></h2>
+       <p><?php p($l->t('This %s instance is currently in maintenance mode, which may take a while.', [$theme->getName()])) ?> <?php p($l->t('This page will refresh itself when the instance is available again.')) ?></p>
        <p><?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?></p>
 </div>
index 626e9a777d676f44818989f9277493b2dff97aba..7822c8e8ba36919c2090d2078795e03469c47823 100644 (file)
--- a/cron.php
+++ b/cron.php
@@ -77,7 +77,7 @@ try {
                if (OC::$CLI) {
                        echo 'Background Jobs are disabled!' . PHP_EOL;
                } else {
-                       OC_JSON::error(array('data' => array('message' => 'Background jobs disabled!')));
+                       OC_JSON::error(['data' => ['message' => 'Background jobs disabled!']]);
                }
                exit(1);
        }
@@ -140,7 +140,7 @@ try {
                // We call cron.php from some website
                if ($appMode === 'cron') {
                        // Cron is cron :-P
-                       OC_JSON::error(array('data' => array('message' => 'Backgroundjobs are using system cron!')));
+                       OC_JSON::error(['data' => ['message' => 'Backgroundjobs are using system cron!']]);
                } else {
                        // Work and success :-)
                        $jobList = \OC::$server->getJobList();
index 1b3a8c04bdebff441871da98bbe7096f39e45264..76a414d9c5a37453aac2a89e7b602637a9c0882a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -38,7 +38,7 @@ try {
        OC::handleRequest();
 
 } catch(\OC\ServiceUnavailableException $ex) {
-       \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
+       \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
 
        //show the user a detailed error page
        OC_Template::printExceptionErrorPage($ex, 503);
@@ -47,8 +47,8 @@ try {
                OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
        } catch (Exception $ex2) {
                try {
-                       \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
-                       \OC::$server->getLogger()->logException($ex2, array('app' => 'index'));
+                       \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
+                       \OC::$server->getLogger()->logException($ex2, ['app' => 'index']);
                } catch (Throwable $e) {
                        // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here
                }
@@ -59,13 +59,13 @@ try {
 } catch (\OC\User\LoginException $ex) {
        OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403);
 } catch (Exception $ex) {
-       \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
+       \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
 
        //show the user a detailed error page
        OC_Template::printExceptionErrorPage($ex, 500);
 } catch (Error $ex) {
        try {
-               \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
+               \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
        } catch (Error $e) {
                http_response_code(500);
                header('Content-Type: text/plain; charset=utf-8');
index 5a62cd5c7c0d8787b53510edc91e649b5009a7bb..07e81f37ae9520e9cf4556a83133dd4ee9399ec3 100644 (file)
@@ -158,7 +158,7 @@ class Autoloader {
 
                if (!is_array($pathsToRequire)) {
                        // No cache or cache miss
-                       $pathsToRequire = array();
+                       $pathsToRequire = [];
                        foreach ($this->findClass($class) as $path) {
                                $fullPath = stream_resolve_include_path($path);
                                if ($fullPath && $this->isValidPath($fullPath)) {
index c0feee3d1e73591f3eeb619dc96ba32004ee8667..d3b0c42f1bbaceb8999472b0a0a9df68f2859a8c 100644 (file)
@@ -76,7 +76,7 @@ class OC {
        /**
         * Associative array for autoloading. classname => filename
         */
-       public static $CLASSPATH = array();
+       public static $CLASSPATH = [];
        /**
         * The installation path for Nextcloud  on the server (e.g. /srv/http/nextcloud)
         */
@@ -93,7 +93,7 @@ class OC {
         * The installation path array of the apps folder on the server (e.g. /srv/http/nextcloud) 'path' and
         * web path in 'url'
         */
-       public static $APPSROOTS = array();
+       public static $APPSROOTS = [];
 
        /**
         * @var string
@@ -196,7 +196,7 @@ class OC {
                }
 
                // search the apps folder
-               $config_paths = self::$config->getValue('apps_paths', array());
+               $config_paths = self::$config->getValue('apps_paths', []);
                if (!empty($config_paths)) {
                        foreach ($config_paths as $paths) {
                                if (isset($paths['url']) && isset($paths['path'])) {
@@ -206,20 +206,20 @@ class OC {
                                }
                        }
                } elseif (file_exists(OC::$SERVERROOT . '/apps')) {
-                       OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true);
+                       OC::$APPSROOTS[] = ['path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true];
                } elseif (file_exists(OC::$SERVERROOT . '/../apps')) {
-                       OC::$APPSROOTS[] = array(
+                       OC::$APPSROOTS[] = [
                                'path' => rtrim(dirname(OC::$SERVERROOT), '/') . '/apps',
                                'url' => '/apps',
                                'writable' => true
-                       );
+                       ];
                }
 
                if (empty(OC::$APPSROOTS)) {
                        throw new \RuntimeException('apps directory not found! Please put the Nextcloud apps folder in the Nextcloud folder'
                                . ' or the folder above. You can also configure the location in the config.php file.');
                }
-               $paths = array();
+               $paths = [];
                foreach (OC::$APPSROOTS as $path) {
                        $paths[] = $path['path'];
                        if (!is_dir($path['path'])) {
@@ -423,7 +423,7 @@ class OC {
                        // Allow session apps to create a custom session object
                        $useCustomSession = false;
                        $session = self::$server->getSession();
-                       OC_Hook::emit('OC', 'initSession', array('session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession));
+                       OC_Hook::emit('OC', 'initSession', ['session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession]);
                        if (!$useCustomSession) {
                                // set the session name to the instance id - which is unique
                                $session = new \OC\Session\Internal($sessionName);
@@ -570,7 +570,7 @@ class OC {
                if (defined('PHPUNIT_RUN')) {
                        self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
                }
-               spl_autoload_register(array(self::$loader, 'load'));
+               spl_autoload_register([self::$loader, 'load']);
                $loaderEnd = microtime(true);
 
                self::$CLI = (php_sapi_name() == 'cli');
@@ -646,7 +646,7 @@ class OC {
                }
 
                \OC::$server->getEventLogger()->start('init_session', 'Initialize session');
-               OC_App::loadApps(array('session'));
+               OC_App::loadApps(['session']);
                if (!self::$CLI) {
                        self::initSession();
                }
@@ -665,7 +665,7 @@ class OC {
                                        http_response_code(503);
                                        OC_Util::addStyle('guest');
                                        try {
-                                               OC_Template::printGuestPage('', 'error', array('errors' => $errors));
+                                               OC_Template::printGuestPage('', 'error', ['errors' => $errors]);
                                                exit;
                                        } catch (\Exception $e) {
                                                // In case any error happens when showing the error page, we simply fall back to posting the text.
@@ -742,9 +742,9 @@ class OC {
 
                //make sure temporary files are cleaned up
                $tmpManager = \OC::$server->getTempManager();
-               register_shutdown_function(array($tmpManager, 'clean'));
+               register_shutdown_function([$tmpManager, 'clean']);
                $lockProvider = \OC::$server->getLockingProvider();
-               register_shutdown_function(array($lockProvider, 'releaseAll'));
+               register_shutdown_function([$lockProvider, 'releaseAll']);
 
                // Check whether the sample configuration has been copied
                if($systemConfig->getValue('copied_sample_config', false)) {
@@ -997,7 +997,7 @@ class OC {
                                OC_App::loadApps();
                        } else {
                                // For guests: Load only filesystem and logging
-                               OC_App::loadApps(array('filesystem', 'logging'));
+                               OC_App::loadApps(['filesystem', 'logging']);
                                self::handleLogin($request);
                        }
                }
@@ -1005,7 +1005,7 @@ class OC {
                if (!self::$CLI) {
                        try {
                                if (!((bool) $systemConfig->getValue('maintenance', false)) && !\OCP\Util::needUpgrade()) {
-                                       OC_App::loadApps(array('filesystem', 'logging'));
+                                       OC_App::loadApps(['filesystem', 'logging']);
                                        OC_App::loadApps();
                                }
                                OC_Util::setupFS();
@@ -1075,10 +1075,10 @@ class OC {
                }
 
                // Extract PHP_AUTH_USER/PHP_AUTH_PW from other headers if necessary.
-               $vars = array(
+               $vars = [
                        'HTTP_AUTHORIZATION', // apache+php-cgi work around
                        'REDIRECT_HTTP_AUTHORIZATION', // apache+php-cgi alternative
-               );
+               ];
                foreach ($vars as $var) {
                        if (isset($_SERVER[$var]) && preg_match('/Basic\s+(.*)$/i', $_SERVER[$var], $matches)) {
                                $credentials = explode(':', base64_decode($matches[1]), 2);
index 8a3c5b8142733c55a2397ad8ba74558cfbd0e044..6d9b6b3cd2fe5a5c404e3073643371f62ba03224 100644 (file)
@@ -76,10 +76,10 @@ class Manager implements IManager {
        }
 
        /** @var \Closure[] */
-       private $consumersClosures = array();
+       private $consumersClosures = [];
 
        /** @var IConsumer[] */
-       private $consumers = array();
+       private $consumers = [];
 
        /**
         * @return \OCP\Activity\IConsumer[]
index 2eca9d55b2859f6575d9385fa2559d55a97809a7..0111fad246f7aa259b5ffbcd8fdecdbefd7f35dc 100644 (file)
@@ -297,7 +297,7 @@ class AllConfig implements \OCP\IConfig {
                // only add to the cache if we already loaded data for the user
                if (isset($this->userCache[$userId])) {
                        if (!isset($this->userCache[$userId][$appName])) {
-                               $this->userCache[$userId][$appName] = array();
+                               $this->userCache[$userId][$appName] = [];
                        }
                        $this->userCache[$userId][$appName][$key] = (string)$value;
                }
@@ -333,7 +333,7 @@ class AllConfig implements \OCP\IConfig {
                if (isset($data[$appName])) {
                        return array_keys($data[$appName]);
                } else {
-                       return array();
+                       return [];
                }
        }
 
@@ -350,7 +350,7 @@ class AllConfig implements \OCP\IConfig {
 
                $sql  = 'DELETE FROM `*PREFIX*preferences` '.
                                'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?';
-               $this->connection->executeUpdate($sql, array($userId, $appName, $key));
+               $this->connection->executeUpdate($sql, [$userId, $appName, $key]);
 
                if (isset($this->userCache[$userId]) and isset($this->userCache[$userId][$appName])) {
                        unset($this->userCache[$userId][$appName][$key]);
@@ -368,7 +368,7 @@ class AllConfig implements \OCP\IConfig {
 
                $sql  = 'DELETE FROM `*PREFIX*preferences` '.
                        'WHERE `userid` = ?';
-               $this->connection->executeUpdate($sql, array($userId));
+               $this->connection->executeUpdate($sql, [$userId]);
 
                unset($this->userCache[$userId]);
        }
@@ -384,7 +384,7 @@ class AllConfig implements \OCP\IConfig {
 
                $sql  = 'DELETE FROM `*PREFIX*preferences` '.
                                'WHERE `appid` = ?';
-               $this->connection->executeUpdate($sql, array($appName));
+               $this->connection->executeUpdate($sql, [$appName]);
 
                foreach ($this->userCache as &$userCache) {
                        unset($userCache[$appName]);
@@ -405,20 +405,20 @@ class AllConfig implements \OCP\IConfig {
                        return $this->userCache[$userId];
                }
                if ($userId === null || $userId === '') {
-                       $this->userCache[$userId]=array();
+                       $this->userCache[$userId]=[];
                        return $this->userCache[$userId];
                }
 
                // TODO - FIXME
                $this->fixDIInit();
 
-               $data = array();
+               $data = [];
                $query = 'SELECT `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?';
-               $result = $this->connection->executeQuery($query, array($userId));
+               $result = $this->connection->executeQuery($query, [$userId]);
                while ($row = $result->fetch()) {
                        $appId = $row['appid'];
                        if (!isset($data[$appId])) {
-                               $data[$appId] = array();
+                               $data[$appId] = [];
                        }
                        $data[$appId][$row['configkey']] = $row['configvalue'];
                }
@@ -439,13 +439,13 @@ class AllConfig implements \OCP\IConfig {
                $this->fixDIInit();
 
                if (empty($userIds) || !is_array($userIds)) {
-                       return array();
+                       return [];
                }
 
                $chunkedUsers = array_chunk($userIds, 50, true);
                $placeholders50 = implode(',', array_fill(0, 50, '?'));
 
-               $userValues = array();
+               $userValues = [];
                foreach ($chunkedUsers as $chunk) {
                        $queryParams = $chunk;
                        // create [$app, $key, $chunkedUsers]
@@ -490,9 +490,9 @@ class AllConfig implements \OCP\IConfig {
                        $sql .= 'AND `configvalue` = ?';
                }
 
-               $result = $this->connection->executeQuery($sql, array($appName, $key, $value));
+               $result = $this->connection->executeQuery($sql, [$appName, $key, $value]);
 
-               $userIDs = array();
+               $userIDs = [];
                while ($row = $result->fetch()) {
                        $userIDs[] = $row['userid'];
                }
@@ -522,9 +522,9 @@ class AllConfig implements \OCP\IConfig {
                        $sql .= 'AND LOWER(`configvalue`) = LOWER(?)';
                }
 
-               $result = $this->connection->executeQuery($sql, array($appName, $key, $value));
+               $result = $this->connection->executeQuery($sql, [$appName, $key, $value]);
 
-               $userIDs = array();
+               $userIDs = [];
                while ($row = $result->fetch()) {
                        $userIDs[] = $row['userid'];
                }
index 937cc511985c4acfae7bafb087ad85771be4138f..1fcf4e8281fc1e2ebd10fa54acc0d212673a10d6 100644 (file)
@@ -540,7 +540,7 @@ class AppManager implements IAppManager {
         */
        public function getIncompatibleApps(string $version): array {
                $apps = $this->getInstalledApps();
-               $incompatibleApps = array();
+               $incompatibleApps = [];
                foreach ($apps as $appId) {
                        $info = $this->getAppInfo($appId);
                        if ($info === null) {
index a59e8c21735e00b516f84dff5d87aa9ab53f9051..81ae6e7a168d1f442243c7f1ee6615d2714240c9 100644 (file)
@@ -188,7 +188,7 @@ class DependencyAnalyzer {
                        return $missing;
                }
                if (!is_array($supportedDatabases)) {
-                       $supportedDatabases = array($supportedDatabases);
+                       $supportedDatabases = [$supportedDatabases];
                }
                $supportedDatabases = array_map(function ($db) {
                        return $this->getValue($db);
@@ -212,7 +212,7 @@ class DependencyAnalyzer {
 
                $commands = $dependencies['command'];
                if (!is_array($commands)) {
-                       $commands = array($commands);
+                       $commands = [$commands];
                }
                if (isset($commands['@value'])) {
                        $commands = [$commands];
@@ -242,7 +242,7 @@ class DependencyAnalyzer {
 
                $libs = $dependencies['lib'];
                if (!is_array($libs)) {
-                       $libs = array($libs);
+                       $libs = [$libs];
                }
                if (isset($libs['@value'])) {
                        $libs = [$libs];
@@ -294,7 +294,7 @@ class DependencyAnalyzer {
                                return $this->getValue($os);
                        }, $oss);
                } else {
-                       $oss = array($oss);
+                       $oss = [$oss];
                }
                $currentOS = $this->platform->getOS();
                if (!in_array($currentOS, $oss)) {
index c285554ae1c12bdcb7dcc578394348816a443040..61def8ff4343122d90079907ae2d705627c07060 100644 (file)
@@ -38,11 +38,11 @@ class PlatformRepository {
 
        protected function initialize() {
                $loadedExtensions = get_loaded_extensions();
-               $packages = array();
+               $packages = [];
 
                // Extensions scanning
                foreach ($loadedExtensions as $name) {
-                       if (in_array($name, array('standard', 'Core'))) {
+                       if (in_array($name, ['standard', 'Core'])) {
                                continue;
                        }
 
index 1dbccf7590b909348907144cebc1ead5bbf63029..6f4a48d89072347e88b2a4713bf2bac7f3c1fec2 100644 (file)
@@ -83,7 +83,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
         * @param array $urlParams
         * @param ServerContainer|null $server
         */
-       public function __construct($appName, $urlParams = array(), ServerContainer $server = null){
+       public function __construct($appName, $urlParams = [], ServerContainer $server = null){
                parent::__construct();
                $this['AppName'] = $appName;
                $this['urlParams'] = $urlParams;
index 383dffb63d31d405393b381e3809b577bc3f94af..05eae742641ecf2d63d596be499c1b70702c531e 100644 (file)
@@ -45,7 +45,7 @@ class Http extends BaseHttp {
                $this->server = $server;
                $this->protocolVersion = $protocolVersion;
 
-               $this->headers = array(
+               $this->headers = [
                        self::STATUS_CONTINUE => 'Continue',
                        self::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols',
                        self::STATUS_PROCESSING => 'Processing',
@@ -105,7 +105,7 @@ class Http extends BaseHttp {
                        self::STATUS_BANDWIDTH_LIMIT_EXCEEDED => 'Bandwidth Limit Exceeded', // non-standard
                        self::STATUS_NOT_EXTENDED => 'Not extended',
                        self::STATUS_NETWORK_AUTHENTICATION_REQUIRED => 'Network Authentication Required', // draft-nottingham-http-new-status
-               );
+               ];
        }
 
 
index 20bab49adf8903d1f38fae350f01217ebfed4f9a..08c9d23863e27f09dd869a5b89aaadb22a3177ba 100644 (file)
@@ -52,7 +52,7 @@ class TAR extends Archive {
         * @param string $source
         */
        public function __construct($source) {
-               $types = array(null, 'gz', 'bz2');
+               $types = [null, 'gz', 'bz2'];
                $this->path = $source;
                $this->tar = new \Archive_Tar($source, $types[self::getTarType($source)]);
        }
@@ -103,7 +103,7 @@ class TAR extends Archive {
                                mkdir($folder);
                        }
                }
-               $result = $this->tar->addModify(array($tmpBase . $path), '', $tmpBase);
+               $result = $this->tar->addModify([$tmpBase . $path], '', $tmpBase);
                rmdir($tmpBase . $path);
                $this->fileList = false;
                $this->cachedHeaders = false;
@@ -144,9 +144,9 @@ class TAR extends Archive {
                rename($tmp . $source, $tmp . $dest);
                $this->tar = null;
                unlink($this->path);
-               $types = array(null, 'gz', 'bz');
+               $types = [null, 'gz', 'bz'];
                $this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]);
-               $this->tar->createModify(array($tmp), '', $tmp . '/');
+               $this->tar->createModify([$tmp], '', $tmp . '/');
                $this->fileList = false;
                $this->cachedHeaders = false;
                return true;
@@ -201,7 +201,7 @@ class TAR extends Archive {
         */
        public function getFolder($path) {
                $files = $this->getFiles();
-               $folderContent = array();
+               $folderContent = [];
                $pathLength = strlen($path);
                foreach ($files as $file) {
                        if ($file[0] == '/') {
@@ -232,7 +232,7 @@ class TAR extends Archive {
                if (!$this->cachedHeaders) {
                        $this->cachedHeaders = $this->tar->listContent();
                }
-               $files = array();
+               $files = [];
                foreach ($this->cachedHeaders as $header) {
                        $files[] = $header['filename'];
                }
@@ -263,9 +263,9 @@ class TAR extends Archive {
                        return false;
                }
                if ($this->fileExists('/' . $path)) {
-                       $success = $this->tar->extractList(array('/' . $path), $tmp);
+                       $success = $this->tar->extractList(['/' . $path], $tmp);
                } else {
-                       $success = $this->tar->extractList(array($path), $tmp);
+                       $success = $this->tar->extractList([$path], $tmp);
                }
                if ($success) {
                        rename($tmp . $path, $dest);
@@ -329,7 +329,7 @@ class TAR extends Archive {
                $this->tar = null;
                unlink($this->path);
                $this->reopen();
-               $this->tar->createModify(array($tmp), '', $tmp);
+               $this->tar->createModify([$tmp], '', $tmp);
                return true;
        }
 
@@ -378,7 +378,7 @@ class TAR extends Archive {
                        $this->tar->_close();
                        $this->tar = null;
                }
-               $types = array(null, 'gz', 'bz');
+               $types = [null, 'gz', 'bz'];
                $this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]);
        }
 }
index 2c3df550f719820c493a3c119ca5e22308d5ab1e..cb04b572c030f1dbae8ec264194bd031eae82cb7 100644 (file)
@@ -113,7 +113,7 @@ class ZIP extends Archive{
         */
        public function getFolder($path) {
                $files=$this->getFiles();
-               $folderContent=array();
+               $folderContent=[];
                $pathLength=strlen($path);
                foreach($files as $file) {
                        if(substr($file, 0, $pathLength)==$path and $file!=$path) {
@@ -130,7 +130,7 @@ class ZIP extends Archive{
         */
        public function getFiles() {
                $fileCount=$this->zip->numFiles;
-               $files=array();
+               $files=[];
                for($i=0;$i<$fileCount;$i++) {
                        $files[]=$this->zip->getNameIndex($i);
                }
index 8f8e5e449cc67cf7aa67b4900914a7c57daeea71..86df8aada730bfa32e661e7d74237cd4c5c1a12f 100644 (file)
@@ -232,7 +232,7 @@ abstract class Avatar implements IAvatar {
                $x = intval(($xi - $xr) / 2);
                $y = intval(($yi + $yr) / 2);
 
-               return array($x, $y);
+               return [$x, $y];
        }
 
        /**
@@ -242,7 +242,7 @@ abstract class Avatar implements IAvatar {
         * @return array [r,g,b] steps for each color to go from $steps to $ends
         */
        private function stepCalc($steps, $ends) {
-               $step = array();
+               $step = [];
                $step[0] = ($ends[1]->r - $ends[0]->r) / $steps;
                $step[1] = ($ends[1]->g - $ends[0]->g) / $steps;
                $step[2] = ($ends[1]->b - $ends[0]->b) / $steps;
@@ -256,7 +256,7 @@ abstract class Avatar implements IAvatar {
         * @return int[] between 0 and $maximum
         */
        private function mixPalette($steps, $color1, $color2) {
-               $palette = array($color1);
+               $palette = [$color1];
                $step = $this->stepCalc($steps, [$color1, $color2]);
                for ($i = 1; $i < $steps; $i++) {
                        $r = intval($color1->r + ($step[0] * $i));
@@ -275,7 +275,7 @@ abstract class Avatar implements IAvatar {
         */
        private function hashToInt($hash, $maximum) {
                $final = 0;
-               $result = array();
+               $result = [];
 
                // Splitting evenly the string
                for ($i = 0; $i < strlen($hash); $i++) {
index ba81041c9de9cb9ad4f39a3d328a06ba9a9dbd50..64c9972ae0193361fcb4744cdd6d7c7d1fefba46 100644 (file)
@@ -28,8 +28,8 @@ class QueuedJob extends \OC\BackgroundJob\QueuedJob {
                $class = $argument['klass'];
                $method = $argument['method'];
                $parameters = $argument['parameters'];
-               if (is_callable(array($class, $method))) {
-                       call_user_func(array($class, $method), $parameters);
+               if (is_callable([$class, $method])) {
+                       call_user_func([$class, $method], $parameters);
                }
        }
 }
index 09ddb78d4f31e86200aec64384aae836bbec8490..6e4c790a1f34f48163366dfc9f504eb57eff34ae 100644 (file)
@@ -193,11 +193,11 @@ class File implements ICache {
                                                }
                                        } catch (\OCP\Lock\LockedException $e) {
                                                // ignore locked chunks
-                                               \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
+                                               \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', ['app' => 'core']);
                                        } catch (\OCP\Files\ForbiddenException $e) {
-                                               \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', array('app' => 'core'));
+                                               \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', ['app' => 'core']);
                                        } catch (\OCP\Files\LockNotAcquiredException $e) {
-                                               \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
+                                               \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', ['app' => 'core']);
                                        }
                                }
                        }
index 96337627be280a873f063fe83a6c67504287dd73..55e0b0c8967ae090e80d1f8f2e6d92dc97d07515 100644 (file)
@@ -36,7 +36,7 @@ use OCP\ILogger;
 class CapabilitiesManager {
 
        /** @var \Closure[] */
-       private $capabilities = array();
+       private $capabilities = [];
 
        /** @var ILogger */
        private $logger;
index a21c27f1b51d57c3a562feb419b27d158381439a..5366cd295d41b3a73c3537fd5f963a5c1875643c 100644 (file)
@@ -45,7 +45,7 @@ class Config {
        const ENV_PREFIX = 'NC_';
 
        /** @var array Associative array ($key => $value) */
-       protected $cache = array();
+       protected $cache = [];
        /** @var string */
        protected $configDir;
        /** @var string */
@@ -186,7 +186,7 @@ class Config {
         */
        private function readData() {
                // Default config should always get loaded
-               $configFiles = array($this->configFilePath);
+               $configFiles = [$this->configFilePath];
 
                // Add all files in the config dir ending with the same file name
                $extra = glob($this->configDir.'*.'.$this->configFileName);
index ba709baefe576f8478ef16ffa4ebea83bb0f1b7a..ca4a7d885cd8a4c06bdb6bdb1541dbed3d216000 100644 (file)
@@ -41,12 +41,12 @@ namespace OC {
                 *      - 'escape_like_param' - If set to false wildcards _ and % are not escaped
                 * @return array an array of contacts which are arrays of key-value-pairs
                 */
-               public function search($pattern, $searchProperties = array(), $options = array()) {
+               public function search($pattern, $searchProperties = [], $options = []) {
                        $this->loadAddressBooks();
-                       $result = array();
+                       $result = [];
                        foreach($this->addressBooks as $addressBook) {
                                $r = $addressBook->search($pattern, $searchProperties, $options);
-                               $contacts = array();
+                               $contacts = [];
                                foreach($r as $c){
                                        $c['addressbook-key'] = $addressBook->getKey();
                                        $contacts[] = $c;
@@ -131,7 +131,7 @@ namespace OC {
                 */
                public function getAddressBooks() {
                        $this->loadAddressBooks();
-                       $result = array();
+                       $result = [];
                        foreach($this->addressBooks as $addressBook) {
                                $result[$addressBook->getKey()] = $addressBook->getDisplayName();
                        }
@@ -154,19 +154,19 @@ namespace OC {
                 * removes all registered address book instances
                 */
                public function clear() {
-                       $this->addressBooks = array();
-                       $this->addressBookLoaders = array();
+                       $this->addressBooks = [];
+                       $this->addressBookLoaders = [];
                }
 
                /**
                 * @var \OCP\IAddressBook[] which holds all registered address books
                 */
-               private $addressBooks = array();
+               private $addressBooks = [];
 
                /**
                 * @var \Closure[] to call to load/register address books
                 */
-               private $addressBookLoaders = array();
+               private $addressBookLoaders = [];
 
                /**
                 * In order to improve lazy loading a closure can be registered which will be called in case
@@ -203,7 +203,7 @@ namespace OC {
                        foreach($this->addressBookLoaders as $callable) {
                                $callable($this);
                        }
-                       $this->addressBookLoaders = array();
+                       $this->addressBookLoaders = [];
                }
        }
 }
index 8150f08593fd3314bd36e90436470bf836be4476..03cd7f1af66705cfebdd6f77d4bae1d4e901bbeb 100644 (file)
@@ -190,7 +190,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
         *
         * @throws \Doctrine\DBAL\DBALException
         */
-       public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null)
+       public function executeQuery($query, array $params = [], $types = [], QueryCacheProfile $qcp = null)
        {
                $query = $this->replaceTablePrefix($query);
                $query = $this->adapter->fixupStatement($query);
@@ -211,7 +211,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
         *
         * @throws \Doctrine\DBAL\DBALException
         */
-       public function executeUpdate($query, array $params = array(), array $types = array())
+       public function executeUpdate($query, array $params = [], array $types = [])
        {
                $query = $this->replaceTablePrefix($query);
                $query = $this->adapter->fixupStatement($query);
@@ -373,7 +373,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
        public function dropTable($table) {
                $table = $this->tablePrefix . trim($table);
                $schema = $this->getSchemaManager();
-               if($schema->tablesExist(array($table))) {
+               if($schema->tablesExist([$table])) {
                        $schema->dropTable($table);
                }
        }
@@ -387,7 +387,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
        public function tableExists($table){
                $table = $this->tablePrefix . trim($table);
                $schema = $this->getSchemaManager();
-               return $schema->tablesExist(array($table));
+               return $schema->tablesExist([$table]);
        }
 
        // internal use
index 427a292b6b536019640d60ec6e8de73be43e256d..3722aa9a05ed9ecc5cbb63f6907930ffb1db5218 100644 (file)
@@ -106,9 +106,9 @@ class ConnectionFactory {
                // \PDO::MYSQL_ATTR_FOUND_ROWS may not be defined, e.g. when the MySQL
                // driver is missing. In this case, we won't be able to connect anyway.
                if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) {
-                       $result['driverOptions'] = array(
+                       $result['driverOptions'] = [
                                \PDO::MYSQL_ATTR_FOUND_ROWS => true,
-                       );
+                       ];
                }
                return $result;
        }
index b18929cbd195e59b98c3bd22302bdab0ef19f8fd..874537298ee90a1e3121e74a01931d5f5d8317be 100644 (file)
@@ -155,7 +155,7 @@ class MDB2SchemaReader {
         * @throws \DomainException
         */
        private function loadField($table, $xml) {
-               $options = array( 'notnull' => false );
+               $options = [ 'notnull' => false ];
                foreach ($xml->children() as $child) {
                        /**
                         * @var \SimpleXMLElement $child
@@ -262,7 +262,7 @@ class MDB2SchemaReader {
 
                        $table->addColumn($name, $type, $options);
                        if (!empty($options['primary']) && $options['primary']) {
-                               $table->setPrimaryKey(array($name));
+                               $table->setPrimaryKey([$name]);
                        }
                }
        }
@@ -274,7 +274,7 @@ class MDB2SchemaReader {
         */
        private function loadIndex($table, $xml) {
                $name = null;
-               $fields = array();
+               $fields = [];
                foreach ($xml->children() as $child) {
                        /**
                         * @var \SimpleXMLElement $child
index 8b1621a5f55053efc9c7f9dc3c4b22e0c84f8b4a..bda0720b3bbcf51c75c81f2e7ff201a4e9405b79 100644 (file)
@@ -155,7 +155,7 @@ class Migrator {
                $tmpTable = $this->renameTableSchema($table, $tmpName);
                $schemaConfig = new SchemaConfig();
                $schemaConfig->setName($this->connection->getDatabase());
-               $schema = new Schema(array($tmpTable), array(), $schemaConfig);
+               $schema = new Schema([$tmpTable], [], $schemaConfig);
 
                try {
                        $this->applySchema($schema);
@@ -180,7 +180,7 @@ class Migrator {
                 * @var \Doctrine\DBAL\Schema\Index[] $indexes
                 */
                $indexes = $table->getIndexes();
-               $newIndexes = array();
+               $newIndexes = [];
                foreach ($indexes as $index) {
                        if ($index->isPrimary()) {
                                // do not rename primary key
@@ -193,7 +193,7 @@ class Migrator {
                }
 
                // foreign keys are not supported so we just set it to an empty array
-               return new Table($newName, $table->getColumns(), $newIndexes, array(), 0, $table->getOptions());
+               return new Table($newName, $table->getColumns(), $newIndexes, [], 0, $table->getOptions());
        }
 
        public function createSchema() {
index 236d462b02ca6f11890fb72061bbb38eca8a8f7c..4c906a0107de042255968925fb5362008d0785f5 100644 (file)
@@ -46,7 +46,7 @@ class OracleConnection extends Connection {
        /**
         * {@inheritDoc}
         */
-       public function insert($tableName, array $data, array $types = array()) {
+       public function insert($tableName, array $data, array $types = []) {
                if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
                        $tableName = $this->quoteIdentifier($tableName);
                }
@@ -57,7 +57,7 @@ class OracleConnection extends Connection {
        /**
         * {@inheritDoc}
         */
-       public function update($tableName, array $data, array $identifier, array $types = array()) {
+       public function update($tableName, array $data, array $identifier, array $types = []) {
                if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
                        $tableName = $this->quoteIdentifier($tableName);
                }
@@ -69,7 +69,7 @@ class OracleConnection extends Connection {
        /**
         * {@inheritDoc}
         */
-       public function delete($tableExpression, array $identifier, array $types = array()) {
+       public function delete($tableExpression, array $identifier, array $types = []) {
                if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
                        $tableExpression = $this->quoteIdentifier($tableExpression);
                }
@@ -86,7 +86,7 @@ class OracleConnection extends Connection {
                $table = $this->tablePrefix . trim($table);
                $table = $this->quoteIdentifier($table);
                $schema = $this->getSchemaManager();
-               if($schema->tablesExist(array($table))) {
+               if($schema->tablesExist([$table])) {
                        $schema->dropTable($table);
                }
        }
@@ -101,6 +101,6 @@ class OracleConnection extends Connection {
                $table = $this->tablePrefix . trim($table);
                $table = $this->quoteIdentifier($table);
                $schema = $this->getSchemaManager();
-               return $schema->tablesExist(array($table));
+               return $schema->tablesExist([$table]);
        }
 }
index d98116292a4476fb06bdc557ad1d70ff1db1802b..72e1dfe1b276dd98e4df075a13abe44306a23dd2 100644 (file)
@@ -57,10 +57,10 @@ class PgSqlTools {
                        $sqlInfo = 'SELECT table_schema, table_name, column_name
                                FROM information_schema.columns
                                WHERE column_default = ? AND table_catalog = ?';
-                       $sequenceInfo = $conn->fetchAssoc($sqlInfo, array(
+                       $sequenceInfo = $conn->fetchAssoc($sqlInfo, [
                                "nextval('$sequenceName'::regclass)",
                                $databaseName
-                       ));
+                       ]);
                        $tableName = $sequenceInfo['table_name'];
                        $columnName = $sequenceInfo['column_name'];
                        $sqlMaxId = "SELECT MAX($columnName) FROM $tableName";
index ba5ee1733528385c2eeb58ead8ef40be052e148a..1e96910af4a6cca2ae2cda198372bf75a9b21944 100644 (file)
@@ -44,7 +44,7 @@ class CompositeExpression implements ICompositeExpression, \Countable {
         *
         * @return \OCP\DB\QueryBuilder\ICompositeExpression
         */
-       public function addMultiple(array $parts = array()) {
+       public function addMultiple(array $parts = []) {
                $this->compositeExpression->addMultiple($parts);
 
                return $this;
index c9fc3eb5f21eb0fed5f2340fa090a2aa96110dd9..9871e9284f83f6f2e8447ced0d1389d348ed53c6 100644 (file)
@@ -273,7 +273,7 @@ class QueryBuilder implements IQueryBuilder {
         *
         * @return $this This QueryBuilder instance.
         */
-       public function setParameters(array $params, array $types = array()) {
+       public function setParameters(array $params, array $types = []) {
                $this->queryBuilder->setParameters($params, $types);
 
                return $this;
index bd9504a3fed0482e9c8d06dfada570c742ecce83..244bbd6f628d5f2bc0b78070b12a13dd19a7b1e9 100644 (file)
@@ -43,10 +43,10 @@ class SQLiteMigrator extends Migrator {
                $tmpFile = $this->buildTempDatabase();
                copy($dbFile, $tmpFile);
 
-               $connectionParams = array(
+               $connectionParams = [
                        'path' => $tmpFile,
                        'driver' => 'pdo_sqlite',
-               );
+               ];
                $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
                try {
                        $this->applySchema($targetSchema, $conn);
index a34bd509091a9647fa7c1609341f0dd737100c0c..ed4d75cb278ec0369544069cb25bea1776a4ccc3 100644 (file)
@@ -65,6 +65,6 @@ class SQLiteSessionInit implements EventSubscriber {
        }
 
        public function getSubscribedEvents() {
-               return array(Events::postConnect);
+               return [Events::postConnect];
        }
 }
index 4ff3e1e5eaf6a5d65ee3710ac22d626024de1067..b2b628090bfd98e6018b7914c295344d105aeaa2 100644 (file)
@@ -311,8 +311,8 @@ class DateTimeFormatter implements \OCP\IDateTimeFormatter {
                $timeZone = $this->getTimeZone($timeZone);
                $timestamp = $this->getDateTime($timestamp, $timeZone);
 
-               return $l->l($type, $timestamp, array(
+               return $l->l($type, $timestamp, [
                        'width' => $format,
-               ));
+               ]);
        }
 }
index f7351ec1bedf95183774b24b593e9df213fd16d6..63eb40dd0982f5d73b4c86dd4c6d59b4ae236e0f 100644 (file)
@@ -208,7 +208,7 @@ class DecryptAll {
        protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
 
                $this->setupUserFS($uid);
-               $directories = array();
+               $directories = [];
                $directories[] = '/' . $uid . '/files';
 
                while ($root = array_pop($directories)) {
index 1c71ec7dd9512db79cc77491d45e421b4c7d1a18..0fc9dcc68669743a7ee88d1570bc18d087dcaeef 100644 (file)
@@ -71,10 +71,10 @@ class File implements \OCP\Encryption\IFile {
                list($owner, $ownerPath) = $this->util->getUidAndFilename($path);
 
                // always add owner to the list of users with access to the file
-               $userIds = array($owner);
+               $userIds = [$owner];
 
                if (!$this->util->isFile($owner . '/' . $ownerPath)) {
-                       return array('users' => $userIds, 'public' => false);
+                       return ['users' => $userIds, 'public' => false];
                }
 
                $ownerPath = substr($ownerPath, strlen('/files'));
@@ -121,7 +121,7 @@ class File implements \OCP\Encryption\IFile {
                // Remove duplicate UIDs
                $uniqueUserIds = array_unique($userIds);
 
-               return array('users' => $uniqueUserIds, 'public' => $public);
+               return ['users' => $uniqueUserIds, 'public' => $public];
        }
 
 }
index 183db55c7ea77305c6bacc4c6608f90e6d1cce11..c75210564d6339ca8b2b90b62464129b3b7b3f2c 100644 (file)
@@ -68,7 +68,7 @@ class Manager implements IManager {
         * @param ArrayCache $arrayCache
         */
        public function __construct(IConfig $config, ILogger $logger, IL10N $l10n, View $rootView, Util $util, ArrayCache $arrayCache) {
-               $this->encryptionModules = array();
+               $this->encryptionModules = [];
                $this->config = $config;
                $this->logger = $logger;
                $this->l = $l10n;
@@ -248,7 +248,7 @@ class Manager implements IManager {
                // If encryption is disabled and there are no loaded modules it makes no sense to load the wrapper
                if (!empty($this->encryptionModules) || $this->isEnabled()) {
                        $encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger);
-                       Filesystem::addStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'), 2);
+                       Filesystem::addStorageWrapper('oc_encryption', [$encryptionWrapper, 'wrapStorage'], 2);
                }
        }
 
index 3bb7680989b0985176b42a3373fae291ab99816a..4f4d9555fd45482fe42ccf5b6008ca8ba38dee3e 100644 (file)
@@ -158,7 +158,7 @@ class Update {
                        throw new \InvalidArgumentException('No file found for ' . $info->getId());
                }
 
-               return array($owner, $path);
+               return [$owner, $path];
        }
 
        /**
@@ -181,7 +181,7 @@ class Update {
                if ($this->view->is_dir($path)) {
                        $allFiles = $this->util->getAllFiles($path);
                } else {
-                       $allFiles = array($path);
+                       $allFiles = [$path];
                }
 
 
index b173d1eae5ce81a9bfb204306059459b9b7e21bb..98652e1ecc58113989c998237adb9f49bc5094da 100644 (file)
@@ -164,8 +164,8 @@ class Util {
         * @return array with list of files relative to the users files folder
         */
        public function getAllFiles($dir) {
-               $result = array();
-               $dirList = array($dir);
+               $result = [];
+               $dirList = [$dir];
 
                while ($dirList) {
                        $dir = array_pop($dirList);
@@ -239,7 +239,7 @@ class Util {
 
                $ownerPath = implode('/', array_slice($parts, 2));
 
-               return array($uid, Filesystem::normalizePath($ownerPath));
+               return [$uid, Filesystem::normalizePath($ownerPath)];
 
        }
 
@@ -325,7 +325,7 @@ class Util {
         * @return boolean
         */
        private function isMountPointApplicableToUser($mount, $uid) {
-               $acceptedUids = array('all', $uid);
+               $acceptedUids = ['all', $uid];
                // check if mount point is applicable for the user
                $intersection = array_intersect($acceptedUids, $mount['applicable']['users']);
                if (!empty($intersection)) {
index ec3c8df519de55277919ccbee691832ac5a451ea..0691c1d1e44367a453799b2618b78bebfe2d869e 100644 (file)
@@ -54,14 +54,14 @@ class HomeCache extends Cache {
                        $sql = 'SELECT SUM(`size`) AS f1 ' .
                           'FROM `*PREFIX*filecache` ' .
                                'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0';
-                       $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
+                       $result = \OC_DB::executeAudited($sql, [$id, $this->getNumericStorageId()]);
                        if ($row = $result->fetchRow()) {
                                $result->closeCursor();
                                list($sum) = array_values($row);
                                $totalSize = 0 + $sum;
                                $entry['size'] += 0;
                                if ($entry['size'] !== $totalSize) {
-                                       $this->update($id, array('size' => $totalSize));
+                                       $this->update($id, ['size' => $totalSize]);
                                }
                        }
                }
index 30688a8da3e8458b34df5e63078f828287fbf7e9..b481a9918b9751cab7eda4bac1f73c07e902e8ad 100644 (file)
@@ -164,8 +164,8 @@ class Scanner extends BasicEmitter implements IScanner {
 
                                        // pre-emit only if it was a file. By that we avoid counting/treating folders as files
                                        if ($data['mimetype'] !== 'httpd/unix-directory') {
-                                               $this->emit('\OC\Files\Cache\Scanner', 'scanFile', array($file, $this->storageId));
-                                               \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId));
+                                               $this->emit('\OC\Files\Cache\Scanner', 'scanFile', [$file, $this->storageId]);
+                                               \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', ['path' => $file, 'storage' => $this->storageId]);
                                        }
 
                                        $parent = dirname($file);
@@ -233,8 +233,8 @@ class Scanner extends BasicEmitter implements IScanner {
 
                                        // post-emit only if it was a file. By that we avoid counting/treating folders as files
                                        if ($data['mimetype'] !== 'httpd/unix-directory') {
-                                               $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId));
-                                               \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId));
+                                               $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', [$file, $this->storageId]);
+                                               \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', ['path' => $file, 'storage' => $this->storageId]);
                                        }
 
                                } else {
@@ -266,8 +266,8 @@ class Scanner extends BasicEmitter implements IScanner {
        }
 
        protected function removeFromCache($path) {
-               \OC_Hook::emit('Scanner', 'removeFromCache', array('file' => $path));
-               $this->emit('\OC\Files\Cache\Scanner', 'removeFromCache', array($path));
+               \OC_Hook::emit('Scanner', 'removeFromCache', ['file' => $path]);
+               $this->emit('\OC\Files\Cache\Scanner', 'removeFromCache', [$path]);
                if ($this->cacheActive) {
                        $this->cache->remove($path);
                }
@@ -283,8 +283,8 @@ class Scanner extends BasicEmitter implements IScanner {
                if (isset($data['scan_permissions'])) {
                        $data['permissions'] = $data['scan_permissions'];
                }
-               \OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
-               $this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
+               \OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]);
+               $this->emit('\OC\Files\Cache\Scanner', 'addToCache', [$path, $this->storageId, $data]);
                if ($this->cacheActive) {
                        if ($fileId !== -1) {
                                $this->cache->update($fileId, $data);
@@ -303,8 +303,8 @@ class Scanner extends BasicEmitter implements IScanner {
         * @param int $fileId
         */
        protected function updateCache($path, $data, $fileId = -1) {
-               \OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
-               $this->emit('\OC\Files\Cache\Scanner', 'updateCache', array($path, $this->storageId, $data));
+               \OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]);
+               $this->emit('\OC\Files\Cache\Scanner', 'updateCache', [$path, $this->storageId, $data]);
                if ($this->cacheActive) {
                        if ($fileId !== -1) {
                                $this->cache->update($fileId, $data);
@@ -357,7 +357,7 @@ class Scanner extends BasicEmitter implements IScanner {
         * @return array[]
         */
        protected function getExistingChildren($folderId) {
-               $existingChildren = array();
+               $existingChildren = [];
                $children = $this->cache->getFolderContentsById($folderId);
                foreach ($children as $child) {
                        $existingChildren[$child['name']] = $child;
@@ -372,7 +372,7 @@ class Scanner extends BasicEmitter implements IScanner {
         * @return string[]
         */
        protected function getNewChildren($folder) {
-               $children = array();
+               $children = [];
                if ($dh = $this->storage->opendir($folder)) {
                        if (is_resource($dh)) {
                                while (($file = readdir($dh)) !== false) {
@@ -399,7 +399,7 @@ class Scanner extends BasicEmitter implements IScanner {
                if ($reuse === -1) {
                        $reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
                }
-               $this->emit('\OC\Files\Cache\Scanner', 'scanFolder', array($path, $this->storageId));
+               $this->emit('\OC\Files\Cache\Scanner', 'scanFolder', [$path, $this->storageId]);
                $size = 0;
                if (!is_null($folderId)) {
                        $folderId = $this->cache->getId($path);
@@ -415,9 +415,9 @@ class Scanner extends BasicEmitter implements IScanner {
                        }
                }
                if ($this->cacheActive) {
-                       $this->cache->update($folderId, array('size' => $size));
+                       $this->cache->update($folderId, ['size' => $size]);
                }
-               $this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', array($path, $this->storageId));
+               $this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', [$path, $this->storageId]);
                return $size;
        }
 
@@ -531,7 +531,7 @@ class Scanner extends BasicEmitter implements IScanner {
        private function runBackgroundScanJob(callable $callback, $path) {
                try {
                        $callback();
-                       \OC_Hook::emit('Scanner', 'correctFolderSize', array('path' => $path));
+                       \OC_Hook::emit('Scanner', 'correctFolderSize', ['path' => $path]);
                        if ($this->cacheActive && $this->cache instanceof Cache) {
                                $this->cache->correctFolderSize($path, null, true);
                        }
index 13af41acfea6c8a099bc05413fdb17f203c3cd56..439ed30890cf5f6abd308a70b43d9af38fdf5d9f 100644 (file)
@@ -127,7 +127,7 @@ class Storage {
        public static function getStorageId($numericId) {
 
                $sql = 'SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?';
-               $result = \OC_DB::executeAudited($sql, array($numericId));
+               $result = \OC_DB::executeAudited($sql, [$numericId]);
                if ($row = $result->fetchRow()) {
                        return $row['id'];
                } else {
@@ -194,11 +194,11 @@ class Storage {
                $storageId = self::adjustStorageId($storageId);
                $numericId = self::getNumericStorageId($storageId);
                $sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
-               \OC_DB::executeAudited($sql, array($storageId));
+               \OC_DB::executeAudited($sql, [$storageId]);
 
                if (!is_null($numericId)) {
                        $sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?';
-                       \OC_DB::executeAudited($sql, array($numericId));
+                       \OC_DB::executeAudited($sql, [$numericId]);
                }
        }
 }
index 59cff9b3a41106bb002f86a538c3cd4ddd103c42..b093b591d4e38a291ff6599b6ddd166981bf3663 100644 (file)
@@ -247,7 +247,7 @@ class Updater implements IUpdater {
                if ($parentId != -1) {
                        $mtime = $this->storage->filemtime($parent);
                        if ($mtime !== false) {
-                               $this->cache->update($parentId, array('storage_mtime' => $mtime));
+                               $this->cache->update($parentId, ['storage_mtime' => $mtime]);
                        }
                }
        }
index beb49ff2d652e3d9eb90e39cdb16e09b14ebff79..884054c9a028d8454a6ee0b3f843e5cc3384a242 100644 (file)
@@ -35,7 +35,7 @@ class Watcher implements IWatcher {
 
        protected $watchPolicy = self::CHECK_ONCE;
 
-       protected $checkedPaths = array();
+       protected $checkedPaths = [];
 
        /**
         * @var \OC\Files\Storage\Storage $storage
index 92601e38d13eef72902ca0a791cf923d56ab9e03..e2ed62b4444f515a8a5daca6d9dfdd4e42d994b3 100644 (file)
@@ -209,9 +209,9 @@ class CacheJail extends CacheWrapper {
        }
 
        private function formatSearchResults($results) {
-               $results = array_filter($results, array($this, 'filterCacheEntry'));
+               $results = array_filter($results, [$this, 'filterCacheEntry']);
                $results = array_values($results);
-               return array_map(array($this, 'formatCacheEntry'), $results);
+               return array_map([$this, 'formatCacheEntry'], $results);
        }
 
        /**
@@ -282,7 +282,7 @@ class CacheJail extends CacheWrapper {
         */
        public function getAll() {
                // not supported
-               return array();
+               return [];
        }
 
        /**
index 40bac888673b9f34d3ab7960fe66010035bf44f0..27aa203655b166d58caa8439c6ea1715e10fdcc7 100644 (file)
@@ -96,7 +96,7 @@ class CacheWrapper extends Cache {
         */
        public function getFolderContentsById($fileId) {
                $results = $this->getCache()->getFolderContentsById($fileId);
-               return array_map(array($this, 'formatCacheEntry'), $results);
+               return array_map([$this, 'formatCacheEntry'], $results);
        }
 
        /**
@@ -223,7 +223,7 @@ class CacheWrapper extends Cache {
         */
        public function search($pattern) {
                $results = $this->getCache()->search($pattern);
-               return array_map(array($this, 'formatCacheEntry'), $results);
+               return array_map([$this, 'formatCacheEntry'], $results);
        }
 
        /**
@@ -234,12 +234,12 @@ class CacheWrapper extends Cache {
         */
        public function searchByMime($mimetype) {
                $results = $this->getCache()->searchByMime($mimetype);
-               return array_map(array($this, 'formatCacheEntry'), $results);
+               return array_map([$this, 'formatCacheEntry'], $results);
        }
 
        public function searchQuery(ISearchQuery $query) {
                $results = $this->getCache()->searchQuery($query);
-               return array_map(array($this, 'formatCacheEntry'), $results);
+               return array_map([$this, 'formatCacheEntry'], $results);
        }
 
        /**
index 4ef3f9f8d942bb099fc6d5a31bce7bc47bd98676..4b723cc764bcf6b038163c49aad060fcdb10aa50 100644 (file)
@@ -46,7 +46,7 @@ class MountProviderCollection implements IMountProviderCollection, Emitter {
        /**
         * @var \OCP\Files\Config\IMountProvider[]
         */
-       private $providers = array();
+       private $providers = [];
 
        /**
         * @var \OCP\Files\Storage\IStorageFactory
@@ -86,7 +86,7 @@ class MountProviderCollection implements IMountProviderCollection, Emitter {
                });
                $mounts = array_reduce($mounts, function (array $mounts, array $providerMounts) {
                        return array_merge($mounts, $providerMounts);
-               }, array());
+               }, []);
                return $this->filterMounts($user, $mounts);
        }
 
index 24d21ad604920c2cf315ed69bd7b4bb2f9c77975..d4e584c39f9878425f18907bcdb326212c03275f 100644 (file)
@@ -83,7 +83,7 @@ class Filesystem {
         */
        static private $defaultInstance;
 
-       static private $usersSetup = array();
+       static private $usersSetup = [];
 
        static private $normalizedPathCache = null;
 
@@ -300,7 +300,7 @@ class Filesystem {
                if (!self::$mounts) {
                        \OC_Util::setupFS();
                }
-               $result = array();
+               $result = [];
                $mounts = self::$mounts->findIn($path);
                foreach ($mounts as $mount) {
                        $result[] = $mount->getMountPoint();
@@ -356,9 +356,9 @@ class Filesystem {
                }
                $mount = self::$mounts->find($path);
                if ($mount) {
-                       return array($mount->getStorage(), rtrim($mount->getInternalPath($path), '/'));
+                       return [$mount->getStorage(), rtrim($mount->getInternalPath($path), '/')];
                } else {
-                       return array(null, null);
+                       return [null, null];
                }
        }
 
@@ -461,7 +461,7 @@ class Filesystem {
                                '/' . $user . '/files'
                        ));
                }
-               \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user));
+               \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', ['user' => $user]);
        }
 
        /**
@@ -478,7 +478,7 @@ class Filesystem {
                                        $userObject = $userManager->get($user);
                                        if ($userObject) {
                                                $mounts = $provider->getMountsForUser($userObject, Filesystem::getLoader());
-                                               array_walk($mounts, array(self::$mounts, 'addMount'));
+                                               array_walk($mounts, [self::$mounts, 'addMount']);
                                        }
                                }
                        });
@@ -521,7 +521,7 @@ class Filesystem {
         */
        public static function clearMounts() {
                if (self::$mounts) {
-                       self::$usersSetup = array();
+                       self::$usersSetup = [];
                        self::$mounts->clear();
                }
        }
@@ -619,7 +619,7 @@ class Filesystem {
        static public function isFileBlacklisted($filename) {
                $filename = self::normalizePath($filename);
 
-               $blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', array('.htaccess'));
+               $blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', ['.htaccess']);
                $filename = strtolower(basename($filename));
                return in_array($filename, $blacklist);
        }
index 2b5fa3f7199cc21f9ddf275fb8f70c7d85242117..93f9941d38320cc3cba57b0b6b4fdfa53e988b4c 100644 (file)
@@ -50,7 +50,7 @@ class MountPoint implements IMountPoint {
         *
         * @var array
         */
-       protected $arguments = array();
+       protected $arguments = [];
        protected $mountPoint;
 
        /**
@@ -58,7 +58,7 @@ class MountPoint implements IMountPoint {
         *
         * @var array
         */
-       protected $mountOptions = array();
+       protected $mountOptions = [];
 
        /**
         * @var \OC\Files\Storage\StorageFactory $loader
@@ -87,7 +87,7 @@ class MountPoint implements IMountPoint {
         */
        public function __construct($storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) {
                if (is_null($arguments)) {
-                       $arguments = array();
+                       $arguments = [];
                }
                if (is_null($loader)) {
                        $this->loader = new StorageFactory();
index dcfa0b93ed1cdec5af8b12e3ceb8f51ea19200b0..fd5e996627d2c4369c19c7933e248c59e3cd9726 100644 (file)
@@ -67,12 +67,12 @@ class File extends Node implements \OCP\Files\File {
         */
        public function putContent($data) {
                if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
-                       $this->sendHooks(array('preWrite'));
+                       $this->sendHooks(['preWrite']);
                        if ($this->view->file_put_contents($this->path, $data) === false) {
                                throw new GenericFileException('file_put_contents failed');
                        }
                        $this->fileInfo = null;
-                       $this->sendHooks(array('postWrite'));
+                       $this->sendHooks(['postWrite']);
                } else {
                        throw new NotPermittedException();
                }
@@ -85,8 +85,8 @@ class File extends Node implements \OCP\Files\File {
         * @throws LockedException
         */
        public function fopen($mode) {
-               $preHooks = array();
-               $postHooks = array();
+               $preHooks = [];
+               $postHooks = [];
                $requiredPermissions = \OCP\Constants::PERMISSION_READ;
                switch ($mode) {
                        case 'r+':
@@ -126,7 +126,7 @@ class File extends Node implements \OCP\Files\File {
         */
        public function delete() {
                if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
-                       $this->sendHooks(array('preDelete'));
+                       $this->sendHooks(['preDelete']);
                        $fileInfo = $this->getFileInfo();
                        $this->view->unlink($this->path);
                        $nonExisting = new NonExistingFile($this->root, $this->view, $this->path, $fileInfo);
index 727b08e9335f762735ec6c91b49f6fb7b11e363b..f910eb27fdf083e05e0994773b44b72282e42d4f 100644 (file)
@@ -205,9 +205,9 @@ class Folder extends Node implements \OCP\Files\Folder {
         */
        public function search($query) {
                if (is_string($query)) {
-                       return $this->searchCommon('search', array('%' . $query . '%'));
+                       return $this->searchCommon('search', ['%' . $query . '%']);
                } else {
-                       return $this->searchCommon('searchQuery', array($query));
+                       return $this->searchCommon('searchQuery', [$query]);
                }
        }
 
@@ -218,7 +218,7 @@ class Folder extends Node implements \OCP\Files\Folder {
         * @return Node[]
         */
        public function searchByMime($mimetype) {
-               return $this->searchCommon('searchByMime', array($mimetype));
+               return $this->searchCommon('searchByMime', [$mimetype]);
        }
 
        /**
@@ -229,7 +229,7 @@ class Folder extends Node implements \OCP\Files\Folder {
         * @return Node[]
         */
        public function searchByTag($tag, $userId) {
-               return $this->searchCommon('searchByTag', array($tag, $userId));
+               return $this->searchCommon('searchByTag', [$tag, $userId]);
        }
 
        /**
@@ -243,7 +243,7 @@ class Folder extends Node implements \OCP\Files\Folder {
                        throw new \InvalidArgumentException('searching by owner is only allows on the users home folder');
                }
 
-               $files = array();
+               $files = [];
                $rootLength = strlen($this->path);
                $mount = $this->root->getMount($this->path);
                $storage = $mount->getStorage();
@@ -256,7 +256,7 @@ class Folder extends Node implements \OCP\Files\Folder {
 
                $cache = $storage->getCache('');
 
-               $results = call_user_func_array(array($cache, $method), $args);
+               $results = call_user_func_array([$cache, $method], $args);
                foreach ($results as $result) {
                        if ($internalRootLength === 0 or substr($result['path'], 0, $internalRootLength) === $internalPath) {
                                $result['internalPath'] = $result['path'];
@@ -394,7 +394,7 @@ class Folder extends Node implements \OCP\Files\Folder {
 
        public function delete() {
                if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
-                       $this->sendHooks(array('preDelete'));
+                       $this->sendHooks(['preDelete']);
                        $fileInfo = $this->getFileInfo();
                        $this->view->rmdir($this->path);
                        $nonExisting = new NonExistingFolder($this->root, $this->view, $this->path, $fileInfo);
index 8076c3b4f6abefa163b6d4320930c5b4d7ccb12f..654badbd9d0feb4e791c96042b9a59cab98bbd30 100644 (file)
@@ -89,14 +89,14 @@ class LazyRoot implements IRootFolder {
        /**
         * @inheritDoc
         */
-       public function emit($scope, $method, $arguments = array()) {
+       public function emit($scope, $method, $arguments = []) {
                $this->__call(__FUNCTION__, func_get_args());
        }
 
        /**
         * @inheritDoc
         */
-       public function mount($storage, $mountPoint, $arguments = array()) {
+       public function mount($storage, $mountPoint, $arguments = []) {
                $this->__call(__FUNCTION__, func_get_args());
        }
 
index 896b30503843b15a967f42688d63cc551e9416c2..a8b5fea6be8bf447bde9964e040cc5caa29ff7f7 100644 (file)
@@ -139,9 +139,9 @@ class Node implements \OCP\Files\Node {
         */
        public function touch($mtime = null) {
                if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
-                       $this->sendHooks(array('preTouch'));
+                       $this->sendHooks(['preTouch']);
                        $this->view->touch($this->path, $mtime);
-                       $this->sendHooks(array('postTouch'));
+                       $this->sendHooks(['postTouch']);
                        if ($this->fileInfo) {
                                if (is_null($mtime)) {
                                        $mtime = time();
index 948715aec04bbea35c15a1f796d8cb9012317614..843069ff50d54f11cbdecd4cc6425a1ccb34beac 100644 (file)
@@ -133,7 +133,7 @@ class Root extends Folder implements IRootFolder {
         * @param string $method
         * @param Node[] $arguments
         */
-       public function emit($scope, $method, $arguments = array()) {
+       public function emit($scope, $method, $arguments = []) {
                $this->emitter->emit($scope, $method, $arguments);
        }
 
@@ -142,7 +142,7 @@ class Root extends Folder implements IRootFolder {
         * @param string $mountPoint
         * @param array $arguments
         */
-       public function mount($storage, $mountPoint, $arguments = array()) {
+       public function mount($storage, $mountPoint, $arguments = []) {
                $mount = new MountPoint($storage, $mountPoint, $arguments);
                $this->mountManager->addMount($mount);
        }
index f82eb7b1ddcf72519a0e87a77d9b37b9da71ba1e..c25594ccb3f50ea8e711e74d7697de82541fd18e 100644 (file)
@@ -44,7 +44,7 @@ class NoopScanner extends Scanner {
         * @return array an array of metadata of the scanned file
         */
        public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true) {
-               return array();
+               return [];
        }
 
        /**
@@ -56,7 +56,7 @@ class NoopScanner extends Scanner {
         * @return array with the meta data of the scanned file or folder
         */
        public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
-               return array();
+               return [];
        }
 
        /**
index e0d437839a06627941d21c7fab09d17549a24d39..0f2d1f244a80ec35a812e6b48fb0aa44e1cffa64 100644 (file)
@@ -245,7 +245,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
                $path = $this->normalizePath($path);
 
                try {
-                       $files = array();
+                       $files = [];
                        $folderContents = $this->getCache()->getFolderContents($path);
                        foreach ($folderContents as $file) {
                                $files[] = $file['name'];
@@ -375,14 +375,14 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
                                // work with all object storage implementations
                                $this->file_put_contents($path, ' ');
                                $mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
-                               $stat = array(
+                               $stat = [
                                        'etag' => $this->getETag($path),
                                        'mimetype' => $mimeType,
                                        'size' => 0,
                                        'mtime' => $mtime,
                                        'storage_mtime' => $mtime,
                                        'permissions' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE,
-                               );
+                               ];
                                $this->getCache()->put($path, $stat);
                        } catch (\Exception $ex) {
                                $this->logger->logException($ex, [
index f931b6092a6fbe8ed2beb33cbe046de9a2659ffe..f4ed8c5b5c0b124ebbc49300f2dd6ee07aafccad 100644 (file)
@@ -117,7 +117,7 @@ trait S3ConnectionTrait {
                                if (!$this->connection->isBucketDnsCompatible($this->bucket)) {
                                        throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: " . $this->bucket);
                                }
-                               $this->connection->createBucket(array('Bucket' => $this->bucket));
+                               $this->connection->createBucket(['Bucket' => $this->bucket]);
                                $this->testTimeout();
                        } catch (S3Exception $e) {
                                $logger->logException($e, [
index 8760fae1185f50bbb9e02fc4e1d5f06b2409876e..c976174f8cf05cfe5256d60608d10ac2722c6b61 100644 (file)
@@ -296,7 +296,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
         * @return array
         */
        protected function searchInDir($query, $dir = '') {
-               $files = array();
+               $files = [];
                $dh = $this->opendir($dir);
                if (is_resource($dh)) {
                        while (($item = readdir($dh)) !== false) {
@@ -434,7 +434,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
                        $path = '/' . $path;
                }
 
-               $output = array();
+               $output = [];
                foreach (explode('/', $path) as $chunk) {
                        if ($chunk == '..') {
                                array_pop($output);
index 625e5f3f6250ee5bb40f02f65acb576487e871f1..970f3f8c1562245863b64329d356879d0339a05b 100644 (file)
@@ -265,7 +265,7 @@ class DAV extends Common {
                        try {
                                $response = $this->client->propFind(
                                        $this->encodePath($path),
-                                       array(
+                                       [
                                                '{DAV:}getlastmodified',
                                                '{DAV:}getcontentlength',
                                                '{DAV:}getcontenttype',
@@ -273,7 +273,7 @@ class DAV extends Common {
                                                '{http://open-collaboration-services.org/ns}share-permissions',
                                                '{DAV:}resourcetype',
                                                '{DAV:}getetag',
-                                       )
+                                       ]
                                );
                                $this->statCache->set($path, $response);
                        } catch (ClientHttpException $e) {
@@ -591,7 +591,7 @@ class DAV extends Common {
                } catch (\Exception $e) {
                        $this->convertException($e, $path);
                }
-               return array();
+               return [];
        }
 
        /** {@inheritdoc} */
index 13a3ca87097fa10ddba35b94ed7aa0e28fdf1349..e186d29c3483011930328a80e08db96f04ed1168 100644 (file)
@@ -107,7 +107,7 @@ class Local extends \OC\Files\Storage\Common {
                                 * @var \SplFileInfo $file
                                 */
                                $file = $it->current();
-                               if (in_array($file->getBasename(), array('.', '..'))) {
+                               if (in_array($file->getBasename(), ['.', '..'])) {
                                        $it->next();
                                        continue;
                                } elseif ($file->isDir()) {
@@ -340,7 +340,7 @@ class Local extends \OC\Files\Storage\Common {
         * @return array
         */
        protected function searchInDir($query, $dir = '') {
-               $files = array();
+               $files = [];
                $physicalDir = $this->getSourcePath($dir);
                foreach (scandir($physicalDir) as $item) {
                        if (\OC\Files\Filesystem::isIgnoredDir($item))
index bb501cb55659b456032e2e540cadcc011468f2c5..2e1d1e33bef2d50444944d74469de5d71af59865 100644 (file)
@@ -30,7 +30,7 @@ namespace OC\Files\Storage;
  */
 class Temporary extends Local{
        public function __construct($arguments = null) {
-               parent::__construct(array('datadir' => \OC::$server->getTempManager()->getTemporaryFolder()));
+               parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]);
        }
 
        public function cleanUp() {
index 68cf6f99ee5d3f4d182ea8c7565ecc90689f6395..cbe9b8745016890d962f297f6df385be31a271e4 100644 (file)
@@ -87,7 +87,7 @@ class Encryption extends Wrapper {
        private $mountManager;
 
        /** @var array remember for which path we execute the repair step to avoid recursions */
-       private $fixUnencryptedSizeOf = array();
+       private $fixUnencryptedSizeOf = [];
 
        /** @var  ArrayCache */
        private $arrayCache;
@@ -125,7 +125,7 @@ class Encryption extends Wrapper {
                $this->uid = $uid;
                $this->fileHelper = $fileHelper;
                $this->keyStorage = $keyStorage;
-               $this->unencryptedSize = array();
+               $this->unencryptedSize = [];
                $this->update = $update;
                $this->mountManager = $mountManager;
                $this->arrayCache = $arrayCache;
@@ -892,7 +892,7 @@ class Encryption extends Wrapper {
         * @return array
         */
        protected function parseRawHeader($rawHeader) {
-               $result = array();
+               $result = [];
                if (substr($rawHeader, 0, strlen(Util::HEADER_START)) === Util::HEADER_START) {
                        $header = $rawHeader;
                        $endAt = strpos($header, Util::HEADER_END);
index 7cb24f9b5b608073f44f450908a9701f924b7c0f..3030fa8c7ef37cc5fc44afcc8679a59a61339642 100644 (file)
@@ -503,7 +503,7 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage, IWriteStrea
         * @return mixed
         */
        public function __call($method, $args) {
-               return call_user_func_array(array($this->getWrapperStorage(), $method), $args);
+               return call_user_func_array([$this->getWrapperStorage(), $method], $args);
        }
 
        /**
index dc6cd9cea7f606cfd99edba8a7c1907601f576f8..2ae872de3378838d98d5b43583120a9f2a8f558b 100644 (file)
@@ -109,7 +109,7 @@ class Encryption extends Wrapper {
        protected $fileUpdated;
 
        public function __construct() {
-               $this->expectedContextProperties = array(
+               $this->expectedContextProperties = [
                        'source',
                        'storage',
                        'internalPath',
@@ -124,7 +124,7 @@ class Encryption extends Wrapper {
                        'encryptionStorage',
                        'headerSize',
                        'signed'
-               );
+               ];
        }
 
 
@@ -165,8 +165,8 @@ class Encryption extends Wrapper {
                                                                $signed,
                                                                $wrapper = Encryption::class) {
 
-               $context = stream_context_create(array(
-                       'ocencryption' => array(
+               $context = stream_context_create([
+                       'ocencryption' => [
                                'source' => $source,
                                'storage' => $storage,
                                'internalPath' => $internalPath,
@@ -181,8 +181,8 @@ class Encryption extends Wrapper {
                                'encryptionStorage' => $encStorage,
                                'headerSize' => $headerSize,
                                'signed' => $signed
-                       )
-               ));
+                       ]
+               ]);
 
                return self::wrapSource($source, $context, 'ocencryption', $wrapper, $mode);
        }
index 08272ad61cb2dafeb3c531adf39997f36b1f4973..f07c0c2b678f04fcb2bee710b56c8eb0309e5b3b 100644 (file)
@@ -44,12 +44,12 @@ class Quota extends Wrapper {
         * @return resource
         */
        static public function wrap($stream, $limit) {
-               $context = stream_context_create(array(
-                       'quota' => array(
+               $context = stream_context_create([
+                       'quota' => [
                                'source' => $stream,
                                'limit' => $limit
-                       )
-               ));
+                       ]
+               ]);
                return Wrapper::wrapSource($stream, $context, 'quota', self::class);
        }
 
index 1352963fc67f122beb4d24d8d13f201c9213915e..0db564032acf0f7b0808adca2b6352ceb79334c6 100644 (file)
@@ -103,7 +103,7 @@ class Detection implements IMimeTypeDetector {
        public function registerType(string $extension,
                                                                 string $mimetype,
                                                                 ?string $secureMimeType = null): void {
-               $this->mimetypes[$extension] = array($mimetype, $secureMimeType);
+               $this->mimetypes[$extension] = [$mimetype, $secureMimeType];
                $this->secureMimeTypes[$mimetype] = $secureMimeType ?: $mimetype;
        }
 
index 4febf9afbf145d43bb51cfc8a87de69cf609ed37..d9afe1381715ec5d38d59da05b93749e8e81d52f 100644 (file)
@@ -29,7 +29,7 @@ namespace OC\Files\Type;
  * @deprecated 18.0.0
  */
 class TemplateManager {
-       protected $templates = array();
+       protected $templates = [];
 
        public function registerTemplate($mimetype, $path) {
                $this->templates[$mimetype] = $path;
index 943078215b5e2d8276fbae6dcb175e62fdad5191..49f8177834a6cc82c455fcae965c9edc9a8a7bcc 100644 (file)
@@ -131,19 +131,19 @@ class Scanner extends PublicEmitter {
        protected function attachListener($mount) {
                $scanner = $mount->getStorage()->getScanner();
                $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount) {
-                       $this->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path));
+                       $this->emit('\OC\Files\Utils\Scanner', 'scanFile', [$mount->getMountPoint() . $path]);
                        $this->dispatcher->dispatchTyped(new BeforeFileScannedEvent($mount->getMountPoint() . $path));
                });
                $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount) {
-                       $this->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path));
+                       $this->emit('\OC\Files\Utils\Scanner', 'scanFolder', [$mount->getMountPoint() . $path]);
                        $this->dispatcher->dispatchTyped(new BeforeFolderScannedEvent($mount->getMountPoint() . $path));
                });
                $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFile', function ($path) use ($mount) {
-                       $this->emit('\OC\Files\Utils\Scanner', 'postScanFile', array($mount->getMountPoint() . $path));
+                       $this->emit('\OC\Files\Utils\Scanner', 'postScanFile', [$mount->getMountPoint() . $path]);
                        $this->dispatcher->dispatchTyped(new FileScannedEvent($mount->getMountPoint() . $path));
                });
                $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFolder', function ($path) use ($mount) {
-                       $this->emit('\OC\Files\Utils\Scanner', 'postScanFolder', array($mount->getMountPoint() . $path));
+                       $this->emit('\OC\Files\Utils\Scanner', 'postScanFolder', [$mount->getMountPoint() . $path]);
                        $this->dispatcher->dispatchTyped(new FolderScannedEvent($mount->getMountPoint() . $path));
                });
        }
index 8ea94626a2aaaf012918f1107443478f9fe8f5aa..abfde63be5a64de846a2b8556271e27505752dbb 100644 (file)
@@ -266,7 +266,7 @@ class View {
         * for \OC\Files\Storage\Storage via basicOperation().
         */
        public function mkdir($path) {
-               return $this->basicOperation('mkdir', $path, array('create', 'write'));
+               return $this->basicOperation('mkdir', $path, ['create', 'write']);
        }
 
        /**
@@ -284,7 +284,7 @@ class View {
                        $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true);
                        \OC_Hook::emit(
                                Filesystem::CLASSNAME, "umount",
-                               array(Filesystem::signal_param_path => $relPath)
+                               [Filesystem::signal_param_path => $relPath]
                        );
                        $this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true);
                        $result = $mount->removeMount();
@@ -292,7 +292,7 @@ class View {
                        if ($result) {
                                \OC_Hook::emit(
                                        Filesystem::CLASSNAME, "post_umount",
-                                       array(Filesystem::signal_param_path => $relPath)
+                                       [Filesystem::signal_param_path => $relPath]
                                );
                        }
                        $this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true);
@@ -345,7 +345,7 @@ class View {
                        return $this->removeMount($mount, $absolutePath);
                }
                if ($this->is_dir($path)) {
-                       $result = $this->basicOperation('rmdir', $path, array('delete'));
+                       $result = $this->basicOperation('rmdir', $path, ['delete']);
                } else {
                        $result = false;
                }
@@ -363,7 +363,7 @@ class View {
         * @return resource
         */
        public function opendir($path) {
-               return $this->basicOperation('opendir', $path, array('read'));
+               return $this->basicOperation('opendir', $path, ['read']);
        }
 
        /**
@@ -559,7 +559,7 @@ class View {
                        $mtime = strtotime($mtime);
                }
 
-               $hooks = array('touch');
+               $hooks = ['touch'];
 
                if (!$this->file_exists($path)) {
                        $hooks[] = 'create';
@@ -581,7 +581,7 @@ class View {
                                $mtime = time();
                        }
                        //if native touch fails, we emulate it by changing the mtime in the cache
-                       $this->putFileInfo($path, array('mtime' => floor($mtime)));
+                       $this->putFileInfo($path, ['mtime' => floor($mtime)]);
                }
                return true;
        }
@@ -592,7 +592,7 @@ class View {
         * @throws LockedException
         */
        public function file_get_contents($path) {
-               return $this->basicOperation('file_get_contents', $path, array('read'));
+               return $this->basicOperation('file_get_contents', $path, ['read']);
        }
 
        /**
@@ -602,20 +602,20 @@ class View {
         */
        protected function emit_file_hooks_pre($exists, $path, &$run) {
                if (!$exists) {
-                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, array(
+                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [
                                Filesystem::signal_param_path => $this->getHookPath($path),
                                Filesystem::signal_param_run => &$run,
-                       ));
+                       ]);
                } else {
-                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, array(
+                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, [
                                Filesystem::signal_param_path => $this->getHookPath($path),
                                Filesystem::signal_param_run => &$run,
-                       ));
+                       ]);
                }
-               \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_write, array(
+               \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_write, [
                        Filesystem::signal_param_path => $this->getHookPath($path),
                        Filesystem::signal_param_run => &$run,
-               ));
+               ]);
        }
 
        /**
@@ -624,17 +624,17 @@ class View {
         */
        protected function emit_file_hooks_post($exists, $path) {
                if (!$exists) {
-                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_create, array(
+                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_create, [
                                Filesystem::signal_param_path => $this->getHookPath($path),
-                       ));
+                       ]);
                } else {
-                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_update, array(
+                       \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_update, [
                                Filesystem::signal_param_path => $this->getHookPath($path),
-                       ));
+                       ]);
                }
-               \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_write, array(
+               \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_write, [
                        Filesystem::signal_param_path => $this->getHookPath($path),
-               ));
+               ]);
        }
 
        /**
@@ -690,7 +690,7 @@ class View {
                                return false;
                        }
                } else {
-                       $hooks = $this->file_exists($path) ? array('update', 'write') : array('create', 'write');
+                       $hooks = $this->file_exists($path) ? ['update', 'write'] : ['create', 'write'];
                        return $this->basicOperation('file_put_contents', $path, $hooks, $data);
                }
        }
@@ -770,11 +770,11 @@ class View {
                                } elseif ($this->shouldEmitHooks($path1)) {
                                        \OC_Hook::emit(
                                                Filesystem::CLASSNAME, Filesystem::signal_rename,
-                                               array(
+                                               [
                                                        Filesystem::signal_param_oldpath => $this->getHookPath($path1),
                                                        Filesystem::signal_param_newpath => $this->getHookPath($path2),
                                                        Filesystem::signal_param_run => &$run
-                                               )
+                                               ]
                                        );
                                }
                                if ($run) {
@@ -844,10 +844,10 @@ class View {
                                                        \OC_Hook::emit(
                                                                Filesystem::CLASSNAME,
                                                                Filesystem::signal_post_rename,
-                                                               array(
+                                                               [
                                                                        Filesystem::signal_param_oldpath => $this->getHookPath($path1),
                                                                        Filesystem::signal_param_newpath => $this->getHookPath($path2)
-                                                               )
+                                                               ]
                                                        );
                                                }
                                        }
@@ -900,11 +900,11 @@ class View {
                                        \OC_Hook::emit(
                                                Filesystem::CLASSNAME,
                                                Filesystem::signal_copy,
-                                               array(
+                                               [
                                                        Filesystem::signal_param_oldpath => $this->getHookPath($path1),
                                                        Filesystem::signal_param_newpath => $this->getHookPath($path2),
                                                        Filesystem::signal_param_run => &$run
-                                               )
+                                               ]
                                        );
                                        $this->emit_file_hooks_pre($exists, $path2, $run);
                                }
@@ -938,10 +938,10 @@ class View {
                                                \OC_Hook::emit(
                                                        Filesystem::CLASSNAME,
                                                        Filesystem::signal_post_copy,
-                                                       array(
+                                                       [
                                                                Filesystem::signal_param_oldpath => $this->getHookPath($path1),
                                                                Filesystem::signal_param_newpath => $this->getHookPath($path2)
-                                                       )
+                                                       ]
                                                );
                                                $this->emit_file_hooks_post($exists, $path2);
                                        }
@@ -968,7 +968,7 @@ class View {
         */
        public function fopen($path, $mode) {
                $mode = str_replace('b', '', $mode); // the binary flag is a windows only feature which we do not support
-               $hooks = array();
+               $hooks = [];
                switch ($mode) {
                        case 'r':
                                $hooks[] = 'read';
@@ -1087,7 +1087,7 @@ class View {
                                \OC_Hook::emit(
                                        Filesystem::CLASSNAME,
                                        Filesystem::signal_read,
-                                       array(Filesystem::signal_param_path => $this->getHookPath($path))
+                                       [Filesystem::signal_param_path => $this->getHookPath($path)]
                                );
                        }
                        list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
@@ -1270,18 +1270,18 @@ class View {
                                        \OC_Hook::emit(
                                                Filesystem::CLASSNAME,
                                                $prefix . $hook,
-                                               array(
+                                               [
                                                        Filesystem::signal_param_run => &$run,
                                                        Filesystem::signal_param_path => $path
-                                               )
+                                               ]
                                        );
                                } elseif (!$post) {
                                        \OC_Hook::emit(
                                                Filesystem::CLASSNAME,
                                                $prefix . $hook,
-                                               array(
+                                               [
                                                        Filesystem::signal_param_path => $path
-                                               )
+                                               ]
                                        );
                                }
                        }
@@ -1297,7 +1297,7 @@ class View {
         * @return bool
         */
        public function hasUpdated($path, $time) {
-               return $this->basicOperation('hasUpdated', $path, array(), $time);
+               return $this->basicOperation('hasUpdated', $path, [], $time);
        }
 
        /**
@@ -1591,7 +1591,7 @@ class View {
         * @return FileInfo[]
         */
        public function search($query) {
-               return $this->searchCommon('search', array('%' . $query . '%'));
+               return $this->searchCommon('search', ['%' . $query . '%']);
        }
 
        /**
@@ -1601,7 +1601,7 @@ class View {
         * @return FileInfo[]
         */
        public function searchRaw($query) {
-               return $this->searchCommon('search', array($query));
+               return $this->searchCommon('search', [$query]);
        }
 
        /**
@@ -1611,7 +1611,7 @@ class View {
         * @return FileInfo[]
         */
        public function searchByMime($mimetype) {
-               return $this->searchCommon('searchByMime', array($mimetype));
+               return $this->searchCommon('searchByMime', [$mimetype]);
        }
 
        /**
@@ -1622,7 +1622,7 @@ class View {
         * @return FileInfo[]
         */
        public function searchByTag($tag, $userId) {
-               return $this->searchCommon('searchByTag', array($tag, $userId));
+               return $this->searchCommon('searchByTag', [$tag, $userId]);
        }
 
        /**
@@ -1631,7 +1631,7 @@ class View {
         * @return FileInfo[]
         */
        private function searchCommon($method, $args) {
-               $files = array();
+               $files = [];
                $rootLength = strlen($this->fakeRoot);
 
                $mount = $this->getMount('');
@@ -1640,7 +1640,7 @@ class View {
                if ($storage) {
                        $cache = $storage->getCache('');
 
-                       $results = call_user_func_array(array($cache, $method), $args);
+                       $results = call_user_func_array([$cache, $method], $args);
                        foreach ($results as $result) {
                                if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') {
                                        $internalPath = $result['path'];
@@ -1659,7 +1659,7 @@ class View {
                                        $cache = $storage->getCache('');
 
                                        $relativeMountPoint = substr($mountPoint, $rootLength);
-                                       $results = call_user_func_array(array($cache, $method), $args);
+                                       $results = call_user_func_array([$cache, $method], $args);
                                        if ($results) {
                                                foreach ($results as $result) {
                                                        $internalPath = $result['path'];
@@ -1881,7 +1881,7 @@ class View {
 
                // remove the single file
                array_pop($parts);
-               $result = array('/');
+               $result = ['/'];
                $resultPath = '';
                foreach ($parts as $part) {
                        if ($part) {
index 06cc8ae846f32965a4c7cbc2db122f19a82b5066..dca3a0ed0424143950945a1c2f86aed7e1683ee9 100644 (file)
@@ -94,7 +94,7 @@ abstract class Backend implements \OCP\GroupInterface {
         * if the user exists at all.
         */
        public function getUserGroups($uid) {
-               return array();
+               return [];
        }
 
        /**
@@ -108,7 +108,7 @@ abstract class Backend implements \OCP\GroupInterface {
         */
 
        public function getGroups($search = '', $limit = -1, $offset = 0) {
-               return array();
+               return [];
        }
 
        /**
@@ -129,6 +129,6 @@ abstract class Backend implements \OCP\GroupInterface {
         * @return array an array of user ids
         */
        public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
-               return array();
+               return [];
        }
 }
index 26e23e3b1b1a5eaa0a872a1a6890ca590c3eae97..b14489fe0d9eaaf2783c528ab50626cdae57572e 100644 (file)
@@ -51,7 +51,7 @@ class Group implements IGroup {
        private $gid;
 
        /** @var \OC\User\User[] */
-       private $users = array();
+       private $users = [];
 
        /** @var bool */
        private $usersLoaded;
@@ -127,7 +127,7 @@ class Group implements IGroup {
                        return $this->users;
                }
 
-               $userIds = array();
+               $userIds = [];
                foreach ($this->backends as $backend) {
                        $diff = array_diff(
                                $backend->usersInGroup($this->gid),
@@ -177,7 +177,7 @@ class Group implements IGroup {
                ]));
 
                if ($this->emitter) {
-                       $this->emitter->emit('\OC\Group', 'preAddUser', array($this, $user));
+                       $this->emitter->emit('\OC\Group', 'preAddUser', [$this, $user]);
                }
                foreach ($this->backends as $backend) {
                        if ($backend->implementsActions(\OC\Group\Backend::ADD_TO_GROUP)) {
@@ -191,7 +191,7 @@ class Group implements IGroup {
                                ]));
 
                                if ($this->emitter) {
-                                       $this->emitter->emit('\OC\Group', 'postAddUser', array($this, $user));
+                                       $this->emitter->emit('\OC\Group', 'postAddUser', [$this, $user]);
                                }
                                return;
                        }
@@ -209,7 +209,7 @@ class Group implements IGroup {
                        'user' => $user,
                ]));
                if ($this->emitter) {
-                       $this->emitter->emit('\OC\Group', 'preRemoveUser', array($this, $user));
+                       $this->emitter->emit('\OC\Group', 'preRemoveUser', [$this, $user]);
                }
                foreach ($this->backends as $backend) {
                        if ($backend->implementsActions(\OC\Group\Backend::REMOVE_FROM_GOUP) and $backend->inGroup($user->getUID(), $this->gid)) {
@@ -222,7 +222,7 @@ class Group implements IGroup {
                                'user' => $user,
                        ]));
                        if ($this->emitter) {
-                               $this->emitter->emit('\OC\Group', 'postRemoveUser', array($this, $user));
+                               $this->emitter->emit('\OC\Group', 'postRemoveUser', [$this, $user]);
                        }
                        if ($this->users) {
                                foreach ($this->users as $index => $groupUser) {
@@ -244,7 +244,7 @@ class Group implements IGroup {
         * @return \OC\User\User[]
         */
        public function searchUsers($search, $limit = null, $offset = null) {
-               $users = array();
+               $users = [];
                foreach ($this->backends as $backend) {
                        $userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset);
                        $users += $this->getVerifiedUsers($userIds);
@@ -305,7 +305,7 @@ class Group implements IGroup {
         * @return \OC\User\User[]
         */
        public function searchDisplayName($search, $limit = null, $offset = null) {
-               $users = array();
+               $users = [];
                foreach ($this->backends as $backend) {
                        $userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset);
                        $users = $this->getVerifiedUsers($userIds);
@@ -330,7 +330,7 @@ class Group implements IGroup {
                $result = false;
                $this->dispatcher->dispatch(IGroup::class . '::preDelete', new GenericEvent($this));
                if ($this->emitter) {
-                       $this->emitter->emit('\OC\Group', 'preDelete', array($this));
+                       $this->emitter->emit('\OC\Group', 'preDelete', [$this]);
                }
                foreach ($this->backends as $backend) {
                        if ($backend->implementsActions(\OC\Group\Backend::DELETE_GROUP)) {
@@ -341,7 +341,7 @@ class Group implements IGroup {
                if ($result) {
                        $this->dispatcher->dispatch(IGroup::class . '::postDelete', new GenericEvent($this));
                        if ($this->emitter) {
-                               $this->emitter->emit('\OC\Group', 'postDelete', array($this));
+                               $this->emitter->emit('\OC\Group', 'postDelete', [$this]);
                        }
                }
                return $result;
@@ -354,9 +354,9 @@ class Group implements IGroup {
         */
        private function getVerifiedUsers($userIds) {
                if (!is_array($userIds)) {
-                       return array();
+                       return [];
                }
-               $users = array();
+               $users = [];
                foreach ($userIds as $userId) {
                        $user = $this->userManager->get($userId);
                        if (!is_null($user)) {
index 0879138619c9ffe2e43d16567664d944e60e046d..f789e0d358f152a3939d871f5ce95793ad0dfabb 100644 (file)
@@ -342,7 +342,7 @@ class Manager extends PublicEmitter implements IGroupManager {
         */
        public function getUserGroupNames(IUser $user) {
                return array_map(function ($group) {
-                       return array('displayName' => $group->getDisplayName());
+                       return ['displayName' => $group->getDisplayName()];
                }, $this->getUserGroups($user));
        }
 
index 2a0198bc451f016d13ca93686454ac75548ab8d1..a48baa15cfecf2ae0161e3988986135471248c13 100644 (file)
@@ -43,7 +43,7 @@ class MetaData {
        /** @var bool */
        protected $isAdmin;
        /** @var array */
-       protected $metaData = array();
+       protected $metaData = [];
        /** @var IGroupManager */
        protected $groupManager;
        /** @var bool */
@@ -86,12 +86,12 @@ class MetaData {
                        return $this->metaData[$key];
                }
 
-               $adminGroups = array();
-               $groups = array();
+               $adminGroups = [];
+               $groups = [];
                $sortGroupsIndex = 0;
-               $sortGroupsKeys = array();
+               $sortGroupsKeys = [];
                $sortAdminGroupsIndex = 0;
-               $sortAdminGroupsKeys = array();
+               $sortAdminGroupsKeys = [];
 
                foreach($this->getGroups($groupSearch) as $group) {
                        $groupMetaData = $this->generateGroupMetaData($group, $userSearch);
@@ -117,7 +117,7 @@ class MetaData {
                $this->sort($groups, $sortGroupsKeys);
                $this->sort($adminGroups, $sortAdminGroupsKeys);
 
-               $this->metaData[$key] = array($adminGroups, $groups);
+               $this->metaData[$key] = [$adminGroups, $groups];
                return $this->metaData[$key];
        }
 
@@ -163,14 +163,14 @@ class MetaData {
         * @return array with the keys 'id', 'name', 'usercount' and 'disabled'
         */
        private function generateGroupMetaData(\OCP\IGroup $group, $userSearch) {
-               return array(
+               return [
                                'id' => $group->getGID(),
                                'name' => $group->getDisplayName(),
                                'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
                                'disabled' => $group->countDisabled(),
                                'canAdd' => $group->canAddUser(),
                                'canRemove' => $group->canRemoveUser(),
-                       );
+                       ];
        }
 
        /**
index a3c7e2df5da5ddf280e04487da85a7f493001c19..58b8242ec5489ca92f3103a4be0fb32cf1decaff 100644 (file)
@@ -28,7 +28,7 @@ trait EmitterTrait {
        /**
         * @var callable[][] $listeners
         */
-       protected $listeners = array();
+       protected $listeners = [];
 
        /**
         * @param string $scope
@@ -38,7 +38,7 @@ trait EmitterTrait {
        public function listen($scope, $method, callable $callback) {
                $eventName = $scope . '::' . $method;
                if (!isset($this->listeners[$eventName])) {
-                       $this->listeners[$eventName] = array();
+                       $this->listeners[$eventName] = [];
                }
                if (array_search($callback, $this->listeners[$eventName], true) === false) {
                        $this->listeners[$eventName][] = $callback;
@@ -51,7 +51,7 @@ trait EmitterTrait {
         * @param callable $callback optional
         */
        public function removeListener($scope = null, $method = null, callable $callback = null) {
-               $names = array();
+               $names = [];
                $allNames = array_keys($this->listeners);
                if ($scope and $method) {
                        $name = $scope . '::' . $method;
@@ -83,7 +83,7 @@ trait EmitterTrait {
                                        unset($this->listeners[$name][$index]);
                                }
                        } else {
-                               $this->listeners[$name] = array();
+                               $this->listeners[$name] = [];
                        }
                }
        }
@@ -93,7 +93,7 @@ trait EmitterTrait {
         * @param string $method
         * @param array $arguments optional
         */
-       protected function emit($scope, $method, array $arguments = array()) {
+       protected function emit($scope, $method, array $arguments = []) {
                $eventName = $scope . '::' . $method;
                if (isset($this->listeners[$eventName])) {
                        foreach ($this->listeners[$eventName] as $callback) {
index d7dc6bfe9b545fbbc4287a671fffa979b5f2f09a..431c0333c72966de844d1d5b63e725451ba2755f 100644 (file)
@@ -34,7 +34,7 @@ abstract class ForwardingEmitter extends BasicEmitter {
        /**
         * @var \OC\Hooks\Emitter[] array
         */
-       private $forwardEmitters = array();
+       private $forwardEmitters = [];
 
        /**
         * @param string $scope
index 9d4051e5899ded5fdc99103c2cebb3beddd1f10e..84f8b7b413e1c04a074ae8d25931a253b2d39de5 100644 (file)
@@ -32,7 +32,7 @@ abstract class LegacyEmitter extends BasicEmitter {
         *
         * @suppress PhanAccessMethodProtected
         */
-       protected function emit($scope, $method, array $arguments = array()) {
+       protected function emit($scope, $method, array $arguments = []) {
                \OC_Hook::emit($scope, $method, $arguments);
                parent::emit($scope, $method, $arguments);
        }
index 88c3d7ff327723aebbfa4b4e1750e2a9cc27f91a..dbccc34f2e96c9a4c4323906d3af851b565b8c78 100644 (file)
@@ -36,7 +36,7 @@ class PublicEmitter extends BasicEmitter {
         *
         * @suppress PhanAccessMethodProtected
         */
-       public function emit($scope, $method, array $arguments = array()) {
+       public function emit($scope, $method, array $arguments = []) {
                parent::emit($scope, $method, $arguments);
        }
 }
index bba55385882654e6d64227de456d821fb2e6e49e..8cb4bfaccadbf440a328db6ecfe19aa25130f961 100644 (file)
@@ -118,7 +118,7 @@ class Factory implements IFactory {
 
                        $app = \OC_App::cleanAppId($app);
                        if ($lang !== null) {
-                               $lang = str_replace(array('\0', '/', '\\', '..'), '', (string)$lang);
+                               $lang = str_replace(['\0', '/', '\\', '..'], '', (string)$lang);
                        }
 
                        $forceLang = $this->config->getSystemValue('force_language', false);
@@ -532,8 +532,8 @@ class Factory implements IFactory {
                        $plural = preg_replace( '#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2] );
 
                        $body = str_replace(
-                               array( 'plural', 'n', '$n$plurals', ),
-                               array( '$plural', '$n', '$nplurals', ),
+                               [ 'plural', 'n', '$n$plurals', ],
+                               [ '$plural', '$n', '$nplurals', ],
                                'nplurals='. $nplurals . '; plural=' . $plural
                        );
 
@@ -599,20 +599,20 @@ class Factory implements IFactory {
                        // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
                        $potentialName = (string) $l->t('__language_name__');
                        if ($l->getLanguageCode() === $lang && $potentialName[0] !== '_') {//first check if the language name is in the translation file
-                               $ln = array(
+                               $ln = [
                                        'code' => $lang,
                                        'name' => $potentialName
-                               );
+                               ];
                        } else if ($lang === 'en') {
-                               $ln = array(
+                               $ln = [
                                        'code' => $lang,
                                        'name' => 'English (US)'
-                               );
+                               ];
                        } else {//fallback to language code
-                               $ln = array(
+                               $ln = [
                                        'code' => $lang,
                                        'name' => $lang
-                               );
+                               ];
                        }
 
                        // put appropriate languages into appropriate arrays, to print them sorted
index dd75ec9820c167b43c4d7ecc08d6341fa6a13eb1..2706e2ec2c598577b0803ed7e043233c81ac1bb0 100755 (executable)
@@ -125,7 +125,7 @@ class LargeFileHelper {
                        $data = curl_exec($ch);
                        curl_close($ch);
                        if ($data !== false) {
-                               $matches = array();
+                               $matches = [];
                                preg_match('/Content-Length: (\d+)/', $data, $matches);
                                if (isset($matches[1])) {
                                        return 0 + $matches[1];
index 7561486a4a92e105bd4dfad213c0b79b0e919451..5d846da17ce49cc3900ea95b721e3630dfbcd3b7 100644 (file)
@@ -44,15 +44,15 @@ class ErrorHandler {
                $handler = new ErrorHandler();
 
                if ($debug) {
-                       set_error_handler(array($handler, 'onAll'), E_ALL);
+                       set_error_handler([$handler, 'onAll'], E_ALL);
                        if (\OC::$CLI) {
-                               set_exception_handler(array('OC_Template', 'printExceptionErrorPage'));
+                               set_exception_handler(['OC_Template', 'printExceptionErrorPage']);
                        }
                } else {
-                       set_error_handler(array($handler, 'onError'));
+                       set_error_handler([$handler, 'onError']);
                }
-               register_shutdown_function(array($handler, 'onShutdown'));
-               set_exception_handler(array($handler, 'onException'));
+               register_shutdown_function([$handler, 'onShutdown']);
+               set_exception_handler([$handler, 'onException']);
        }
 
        public static function setLogger(ILogger $logger) {
@@ -65,7 +65,7 @@ class ErrorHandler {
                if($error && self::$logger) {
                        //ob_end_clean();
                        $msg = $error['message'] . ' at ' . $error['file'] . '#' . $error['line'];
-                       self::$logger->critical(self::removePassword($msg), array('app' => 'PHP'));
+                       self::$logger->critical(self::removePassword($msg), ['app' => 'PHP']);
                }
        }
 
@@ -87,14 +87,14 @@ class ErrorHandler {
                        return;
                }
                $msg = $message . ' at ' . $file . '#' . $line;
-               self::$logger->error(self::removePassword($msg), array('app' => 'PHP'));
+               self::$logger->error(self::removePassword($msg), ['app' => 'PHP']);
 
        }
 
        //Recoverable handler which catch all errors, warnings and notices
        public static function onAll($number, $message, $file, $line) {
                $msg = $message . ' at ' . $file . '#' . $line;
-               self::$logger->debug(self::removePassword($msg), array('app' => 'PHP'));
+               self::$logger->debug(self::removePassword($msg), ['app' => 'PHP']);
 
        }
 
index eb7eedac83ec45d20cf29944dd279aa16de4f00a..80e0beeba0d99283f25593c2141d50d9ae6a145e 100644 (file)
@@ -106,7 +106,7 @@ class File extends LogDetails implements IWriter, IFileBased {
         */
        public function getEntries(int $limit=50, int $offset=0):array {
                $minLevel = $this->config->getValue("loglevel", ILogger::WARN);
-               $entries = array();
+               $entries = [];
                $handle = @fopen($this->logFile, 'rb');
                if ($handle) {
                        fseek($handle, 0, SEEK_END);
index bf1304063a4f28a2176b373f77ce155e439a61c7..4bd2263004ce65e7ef4b53b3cd329e35544ceb28 100644 (file)
@@ -28,7 +28,7 @@ use OCP\IMemcache;
 
 class ArrayCache extends Cache implements IMemcache {
        /** @var array Array with the cached data */
-       protected $cachedData = array();
+       protected $cachedData = [];
 
        use CADTrait;
 
index 700ed05380eba653c018197abc18352fea203335..83828c95268f0da85a3476b37cc0770076bea780 100644 (file)
@@ -140,7 +140,7 @@ class Memcached extends Cache implements IMemcache {
                        self::$cache->flush();
                        return true;
                }
-               $keys = array();
+               $keys = [];
                $prefixLength = strlen($prefix);
                foreach ($allKeys as $key) {
                        if (substr($key, 0, $prefixLength) === $prefix) {
index 3cc822223530e2f5ec201697f2cdde677b904faf..32ed9abb06931edcf1e877d2228bb88aef8ef1fd 100644 (file)
@@ -32,7 +32,7 @@ use OCP\ILogger;
 class NaturalSort {
        private static $instance;
        private $collator;
-       private $cache = array();
+       private $cache = [];
 
        /**
         * Instantiate a new \OC\NaturalSort instance.
@@ -58,7 +58,7 @@ class NaturalSort {
                if (isset($this->cache[$t])) {
                        return $this->cache[$t];
                }
-               $tz = array();
+               $tz = [];
                $x = 0;
                $y = -1;
                $n = null;
index 47d20073455f1708d777c6696dcd6aac7378e2a3..1de5b1d6a14260d2a06bedf4ee62d1d7ad043c37 100644 (file)
@@ -115,7 +115,7 @@ class NavigationManager implements INavigationManager {
                foreach ($this->closureEntries as $c) {
                        $this->add($c());
                }
-               $this->closureEntries = array();
+               $this->closureEntries = [];
 
                $result = $this->entries;
                if ($type !== 'all') {
index 0be12f3a234386f9f32e9322a9efe6fa8f9384b2..8f42179f1a00360c48a4da13751858efcdf8ddf4 100644 (file)
@@ -59,9 +59,9 @@ class Result {
         */
        public function __construct($data = null, $code = 100, $message = null, $headers = []) {
                if ($data === null) {
-                       $this->data = array();
+                       $this->data = [];
                } elseif (!is_array($data)) {
-                       $this->data = array($this->data);
+                       $this->data = [$this->data];
                } else {
                        $this->data = $data;
                }
@@ -99,7 +99,7 @@ class Result {
         * @return array
         */
        public function getMeta() {
-               $meta = array();
+               $meta = [];
                $meta['status'] = $this->succeeded() ? 'ok' : 'failure';
                $meta['statuscode'] = $this->statusCode;
                $meta['message'] = $this->message;
index e80d6ec78744cc406b4f54311417635243f10c90..e042ca193cf5ebca9bdf4c06ef5887ccbe6e128e 100644 (file)
@@ -93,7 +93,7 @@ class Repair implements IOutput {
         */
        public function run() {
                if (count($this->repairSteps) === 0) {
-                       $this->emit('\OC\Repair', 'info', array('No repair steps available'));
+                       $this->emit('\OC\Repair', 'info', ['No repair steps available']);
 
                        return;
                }
@@ -207,7 +207,7 @@ class Repair implements IOutput {
 
        public function info($string) {
                // for now just emit as we did in the past
-               $this->emit('\OC\Repair', 'info', array($string));
+               $this->emit('\OC\Repair', 'info', [$string]);
        }
 
        /**
index d579068e16378d8362a25366c44a70ad90422f51..1c50ee2505af90ed03d2ca4b6d7bbe705227427d 100644 (file)
@@ -186,7 +186,7 @@ class CleanTags implements IRepairStep {
                        );
                $result = $qb->execute();
 
-               $orphanItems = array();
+               $orphanItems = [];
                while ($row = $result->fetch()) {
                        $orphanItems[] = (int) $row[$deleteId];
                }
index 891fdd99433655f8fa48736b709a9952e211a507..8477d5d0bc92a3b2ff08e44c67aa725df4bf9cc1 100644 (file)
@@ -126,7 +126,7 @@ class Collation implements IRepairStep {
                        "       WHERE TABLE_SCHEMA = ?" .
                        "       AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" .
                        "       AND TABLE_NAME LIKE '*PREFIX*%'",
-                       array($dbName)
+                       [$dbName]
                );
                $rows = $statement->fetchAll();
                $result = [];
index c3ad7be72da1007754dc17c9447af5eb334210c5..0ced7848df4ab6e9c8744451ef0f7cecb8461d3a 100644 (file)
@@ -90,46 +90,46 @@ class RepairMimeTypes implements IRepairStep {
 
        private function updateMimetypes($updatedMimetypes) {
                if (empty($this->folderMimeTypeId)) {
-                       $result = \OC_DB::executeAudited(self::getIdStmt(), array('httpd/unix-directory'));
+                       $result = \OC_DB::executeAudited(self::getIdStmt(), ['httpd/unix-directory']);
                        $this->folderMimeTypeId = (int)$result->fetchOne();
                }
 
                $count = 0;
                foreach ($updatedMimetypes as $extension => $mimetype) {
-                       $result = \OC_DB::executeAudited(self::existsStmt(), array($mimetype));
+                       $result = \OC_DB::executeAudited(self::existsStmt(), [$mimetype]);
                        $exists = $result->fetchOne();
 
                        if (!$exists) {
                                // insert mimetype
-                               \OC_DB::executeAudited(self::insertStmt(), array($mimetype));
+                               \OC_DB::executeAudited(self::insertStmt(), [$mimetype]);
                        }
 
                        // get target mimetype id
-                       $result = \OC_DB::executeAudited(self::getIdStmt(), array($mimetype));
+                       $result = \OC_DB::executeAudited(self::getIdStmt(), [$mimetype]);
                        $mimetypeId = $result->fetchOne();
 
                        // change mimetype for files with x extension
-                       $count += \OC_DB::executeAudited(self::updateByNameStmt(), array($mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension));
+                       $count += \OC_DB::executeAudited(self::updateByNameStmt(), [$mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension]);
                }
 
                return $count;
        }
 
        private function introduceImageTypes() {
-               $updatedMimetypes = array(
+               $updatedMimetypes = [
                        'jp2' => 'image/jp2',
                        'webp' => 'image/webp',
-               );
+               ];
 
                return $this->updateMimetypes($updatedMimetypes);
        }
 
        private function introduceWindowsProgramTypes() {
-               $updatedMimetypes = array(
+               $updatedMimetypes = [
                        'htaccess' => 'text/plain',
                        'bat' => 'application/x-msdos-program',
                        'cmd' => 'application/cmd',
-               );
+               ];
 
                return $this->updateMimetypes($updatedMimetypes);
        }
index af68129e57d6a4376fd60260ce067ad5e2ace7a5..6c3bb1fb711eda4944a53a8706cdda633c41f891 100644 (file)
@@ -49,7 +49,7 @@ class CachingRouter extends Router {
         * @param bool $absolute
         * @return string
         */
-       public function generate($name, $parameters = array(), $absolute = false) {
+       public function generate($name, $parameters = [], $absolute = false) {
                asort($parameters);
                $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute;
                $cachedKey = $this->cache->get($key);
index 645c24499082097f8730e4969938164e14d59566..38107737a72caabe04b23c56a9b98ed8aab3467b 100644 (file)
@@ -133,7 +133,7 @@ class Route extends SymfonyRoute implements IRoute {
         * to the class with $function
         */
        public function action($class, $function = null) {
-               $action = array($class, $function);
+               $action = [$class, $function];
                if (is_null($function)) {
                        $action = $class;
                }
index db533ff182aaf6f4f63ee43361a6926e33c9af65..e8f012c54698a7b4c141a4bdbb3e1af213afd945 100644 (file)
@@ -35,8 +35,8 @@ use OCP\Search\Provider;
  */
 class Search implements ISearch {
 
-       private $providers = array();
-       private $registeredProviders = array();
+       private $providers = [];
+       private $registeredProviders = [];
 
        /**
         * Search all providers for $query
@@ -46,9 +46,9 @@ class Search implements ISearch {
         * @param int $size, 0 = all
         * @return array An array of OC\Search\Result's
         */
-       public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30) {
+       public function searchPaged($query, array $inApps = [], $page = 1, $size = 30) {
                $this->initProviders();
-               $results = array();
+               $results = [];
                foreach($this->providers as $provider) {
                        /** @var $provider Provider */
                        if ( ! $provider->providesResultsFor($inApps) ) {
@@ -65,7 +65,7 @@ class Search implements ISearch {
                                        $results = array_merge($results, $providerResults);
                                }
                        } else {
-                               \OC::$server->getLogger()->warning('Ignoring Unknown search provider', array('provider' => $provider));
+                               \OC::$server->getLogger()->warning('Ignoring Unknown search provider', ['provider' => $provider]);
                        }
                }
                return $results;
@@ -75,8 +75,8 @@ class Search implements ISearch {
         * Remove all registered search providers
         */
        public function clearProviders() {
-               $this->providers = array();
-               $this->registeredProviders = array();
+               $this->providers = [];
+               $this->registeredProviders = [];
        }
 
        /**
@@ -91,7 +91,7 @@ class Search implements ISearch {
                        }
                );
                // force regeneration of providers on next search
-               $this->providers = array();
+               $this->providers = [];
        }
 
        /**
@@ -99,8 +99,8 @@ class Search implements ISearch {
         * @param string $class class name of a OC\Search\Provider
         * @param array $options optional
         */
-       public function registerProvider($class, array $options = array()) {
-               $this->registeredProviders[] = array('class' => $class, 'options' => $options);
+       public function registerProvider($class, array $options = []) {
+               $this->registeredProviders[] = ['class' => $class, 'options' => $options];
        }
 
        /**
index 87927b90768ec5bdc3ec92b816ff26fc03353a40..4e9a253675acba96c90e950118e50682577fea5b 100644 (file)
@@ -40,7 +40,7 @@ class File extends \OCP\Search\Provider {
         */
        public function search($query) {
                $files = Filesystem::search($query);
-               $results = array();
+               $results = [];
                // edit results
                foreach ($files as $fileData) {
                        // skip versions
index 48ff28a3fb47d6377d99f4e9c23530875b29c301..9c47076787c210b9fb151ca1e3b07dd039822edb 100644 (file)
@@ -88,17 +88,17 @@ class CertificateManager implements ICertificateManager {
        public function listCertificates() {
 
                if (!$this->config->getSystemValue('installed', false)) {
-                       return array();
+                       return [];
                }
 
                $path = $this->getPathToCertificates() . 'uploads/';
                if (!$this->view->is_dir($path)) {
-                       return array();
+                       return [];
                }
-               $result = array();
+               $result = [];
                $handle = $this->view->opendir($path);
                if (!is_resource($handle)) {
-                       return array();
+                       return [];
                }
                while (false !== ($file = readdir($handle))) {
                        if ($file != '.' && $file != '..') {
index 971b144e1d0fcba66c96ce8913c01e0416711507..27268981c2bcf07a52f7b5781089d7465bc157c9 100644 (file)
@@ -391,44 +391,44 @@ class Server extends ServerContainer implements IServerContainer {
                $this->registerService(\OCP\IGroupManager::class, function (Server $c) {
                        $groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger());
                        $groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
-                               \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
+                               \OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
                        });
                        $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
-                               \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $group->getGID()));
+                               \OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new GroupCreatedEvent($group));
                        });
                        $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
-                               \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
+                               \OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
                        });
                        $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
-                               \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
+                               \OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new GroupDeletedEvent($group));
                        });
                        $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
-                               \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
+                               \OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
                        });
                        $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
-                               \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
+                               \OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
                                //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
-                               \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
+                               \OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -491,7 +491,7 @@ class Server extends ServerContainer implements IServerContainer {
                                $c->query(IEventDispatcher::class)
                        );
                        $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
-                               \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
+                               \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -499,7 +499,7 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
+                               \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -507,7 +507,7 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
+                               \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
                                $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
 
                                /** @var IEventDispatcher $dispatcher */
@@ -516,7 +516,7 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'postDelete', function ($user) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
+                               \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -524,7 +524,7 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
+                               \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -532,14 +532,14 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
+                               \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
                        });
                        $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
-                               \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
+                               \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -547,7 +547,7 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin));
+                               \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -560,14 +560,14 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
+                               \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
                                $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
                        });
                        $userSession->listen('\OC\User', 'logout', function ($user) {
-                               \OC_Hook::emit('OC_User', 'logout', array());
+                               \OC_Hook::emit('OC_User', 'logout', []);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
@@ -580,7 +580,7 @@ class Server extends ServerContainer implements IServerContainer {
                        });
                        $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
                                /** @var $user \OC\User\User */
-                               \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
+                               \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
 
                                /** @var IEventDispatcher $dispatcher */
                                $dispatcher = $this->query(IEventDispatcher::class);
index 26299aaa0399063544ed9ba883e67c3020742a46..4042d502a7ec3fe87dbd38d9c4668995b45992ca 100644 (file)
@@ -182,7 +182,7 @@ class Setup {
                        throw new Exception('Supported databases are not properly configured.');
                }
 
-               $supportedDatabases = array();
+               $supportedDatabases = [];
 
                foreach ($configuredDatabases as $database) {
                        if (array_key_exists($database, $availableDatabases)) {
@@ -263,7 +263,7 @@ class Setup {
                        ];
                }
 
-               return array(
+               return [
                        'hasSQLite' => isset($databases['sqlite']),
                        'hasMySQL' => isset($databases['mysql']),
                        'hasPostgreSQL' => isset($databases['pgsql']),
@@ -272,7 +272,7 @@ class Setup {
                        'directory' => $dataDir,
                        'htaccessWorking' => $htAccessWorking,
                        'errors' => $errors,
-               );
+               ];
        }
 
        /**
@@ -282,7 +282,7 @@ class Setup {
        public function install($options) {
                $l = $this->l10n;
 
-               $error = array();
+               $error = [];
                $dbType = $options['dbtype'];
 
                if (empty($options['adminlogin'])) {
@@ -310,7 +310,7 @@ class Setup {
 
                // validate the data directory
                if ((!is_dir($dataDir) && !mkdir($dataDir)) || !is_writable($dataDir)) {
-                       $error[] = $l->t("Can't create or write into the data directory %s", array($dataDir));
+                       $error[] = $l->t("Can't create or write into the data directory %s", [$dataDir]);
                }
 
                if (!empty($error)) {
index d52aaa8882d2414222e4337ebe252da1b6c2a2be..c3c873f2d8b8c99e4d1c6187d62446ae00ca99f9 100644 (file)
@@ -67,16 +67,16 @@ abstract class AbstractDatabase {
        }
 
        public function validate($config) {
-               $errors = array();
+               $errors = [];
                if(empty($config['dbuser']) && empty($config['dbname'])) {
-                       $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
                } else if(empty($config['dbuser'])) {
-                       $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
                } else if(empty($config['dbname'])) {
-                       $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
                }
                if(substr_count($config['dbname'], '.') >= 1) {
-                       $errors[] = $this->trans->t("%s you may not use dots in the database name", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]);
                }
                return $errors;
        }
@@ -109,13 +109,13 @@ abstract class AbstractDatabase {
         * @return \OC\DB\Connection
         */
        protected function connect(array $configOverwrite = []) {
-               $connectionParams = array(
+               $connectionParams = [
                        'host' => $this->dbHost,
                        'user' => $this->dbUser,
                        'password' => $this->dbPassword,
                        'tablePrefix' => $this->tablePrefix,
                        'dbname' => $this->dbName
-               );
+               ];
 
                // adding port support through installer
                if (!empty($this->dbPort)) {
index 75d75254a00a09237a3c268758d802d768b26cc3..f1dcf6c3b5ddaa7d867c7240aa4659ef852c7d59 100644 (file)
@@ -52,13 +52,13 @@ class OCI extends AbstractDatabase {
        }
 
        public function validate($config) {
-               $errors = array();
+               $errors = [];
                if (empty($config['dbuser']) && empty($config['dbname'])) {
-                       $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
                } else if (empty($config['dbuser'])) {
-                       $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
                } else if (empty($config['dbname'])) {
-                       $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname));
+                       $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
                }
                return $errors;
        }
@@ -101,7 +101,7 @@ class OCI extends AbstractDatabase {
                } else {
                        $error = oci_error();
                }
-               foreach (array('message', 'code') as $key) {
+               foreach (['message', 'code'] as $key) {
                        if (isset($error[$key])) {
                                return $error[$key];
                        }
index 0b97b4c0451f202ab7cc77cc76c45b1cb65890d2..9bb482229ef6bdd4066dd2f08a89ee35607c3d9f 100644 (file)
@@ -29,7 +29,7 @@ class Sqlite extends AbstractDatabase {
        public $dbprettyname = 'Sqlite';
 
        public function validate($config) {
-               return array();
+               return [];
        }
 
        public function initialize($config) {
index 4ad9c71b51167d5c49dc01123b3edf4e50539844..4ec0a306a9a0e01f25ddc2ab1ba379c398a6722a 100644 (file)
@@ -83,7 +83,7 @@ class Constants {
 
        protected static $shareTypeUserAndGroups = -1;
        protected static $shareTypeGroupUserUnique = 2;
-       protected static $backends = array();
-       protected static $backendTypes = array();
+       protected static $backends = [];
+       protected static $backendTypes = [];
        protected static $isResharingAllowed;
 }
index 2dd91613cbd723941e8d9cdbaf7dba8565b67180..ef37b3b342792e14b9f1ef9358ab263771846853 100644 (file)
@@ -82,15 +82,15 @@ class Helper extends \OC\Share\Constants {
         * @param bool $excludeGroupChildren exclude group children elements
         */
        public static function delete($parent, $excludeParent = false, $uidOwner = null, $newParent = null, $excludeGroupChildren = false) {
-               $ids = array($parent);
-               $deletedItems = array();
-               $changeParent = array();
-               $parents = array($parent);
+               $ids = [$parent];
+               $deletedItems = [];
+               $changeParent = [];
+               $parents = [$parent];
                while (!empty($parents)) {
                        $parents = "'".implode("','", $parents)."'";
                        // Check the owner on the first search of reshares, useful for
                        // finding and deleting the reshares by a single user of a group share
-                       $params = array();
+                       $params = [];
                        if (count($ids) == 1 && isset($uidOwner)) {
                                // FIXME: don't concat $parents, use Docrine's PARAM_INT_ARRAY approach
                                $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' .
@@ -110,15 +110,15 @@ class Helper extends \OC\Share\Constants {
                        $query = \OC_DB::prepare($queryString);
                        $result = $query->execute($params);
                        // Reset parents array, only go through loop again if items are found
-                       $parents = array();
+                       $parents = [];
                        while ($item = $result->fetchRow()) {
-                               $tmpItem = array(
+                               $tmpItem = [
                                        'id' => $item['id'],
                                        'shareWith' => $item['share_with'],
                                        'itemTarget' => $item['item_target'],
                                        'itemType' => $item['item_type'],
                                        'shareType' => (int)$item['share_type'],
-                               );
+                               ];
                                if (isset($item['file_target'])) {
                                        $tmpItem['fileTarget'] = $item['file_target'];
                                }
@@ -141,7 +141,7 @@ class Helper extends \OC\Share\Constants {
                if (!empty($changeParent)) {
                        $idList = "'".implode("','", $changeParent)."'";
                        $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `parent` = ? WHERE `id` IN ('.$idList.')');
-                       $query->execute(array($newParent));
+                       $query->execute([$newParent]);
                }
 
                if (!empty($ids)) {
@@ -161,7 +161,7 @@ class Helper extends \OC\Share\Constants {
 
                $config = \OC::$server->getConfig();
 
-               $defaultExpireSettings = array('defaultExpireDateSet' => false);
+               $defaultExpireSettings = ['defaultExpireDateSet' => false];
 
                // get default expire settings
                $defaultExpireDate = $config->getAppValue('core', 'shareapi_default_expire_date', 'no');
@@ -277,12 +277,12 @@ class Helper extends \OC\Share\Constants {
                        \OCP\Util::emitHook(
                                        '\OCA\Files_Sharing\API\Server2Server',
                                        'preLoginNameUsedAsUserName',
-                                       array('uid' => &$user1)
+                                       ['uid' => &$user1]
                        );
                        \OCP\Util::emitHook(
                                        '\OCA\Files_Sharing\API\Server2Server',
                                        'preLoginNameUsedAsUserName',
-                                       array('uid' => &$user2)
+                                       ['uid' => &$user2]
                        );
 
                        if ($user1 === $user2) {
index 452b7a4849c1d9b841fb97c7a8b3c32050cdfd8c..e16150b8e6f8eba11c0d3d97a5882d0b8e4a654a 100644 (file)
@@ -56,7 +56,7 @@ class SearchResultSorter {
                if(!isset($a[$this->key]) || !isset($b[$this->key])) {
                        if(!is_null($this->log)) {
                                $this->log->error('Sharing dialogue: cannot sort due to ' .
-                                                                 'missing array key', array('app' => 'core'));
+                                                                 'missing array key', ['app' => 'core']);
                        }
                        return 0;
                }
index ed876022bdd8e9ebcbe4182c5c9a1a884a06b11c..d54dcb2e0e2c4d9c3cd37ba739c650587b31b685 100644 (file)
@@ -76,11 +76,11 @@ class Share extends Constants {
        public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
                if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') == 'yes') {
                        if (!isset(self::$backendTypes[$itemType])) {
-                               self::$backendTypes[$itemType] = array(
+                               self::$backendTypes[$itemType] = [
                                        'class' => $class,
                                        'collectionOf' => $collectionOf,
                                        'supportedFileExtensions' => $supportedFileExtensions
-                               );
+                               ];
                                return true;
                        }
                        \OCP\Util::writeLog('OCP\Share',
@@ -134,7 +134,7 @@ class Share extends Constants {
         * @return array Return list of items with file_target, permissions and expiration
         */
        public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null, $shareType = null) {
-               $shares = array();
+               $shares = [];
                $fileDependent = false;
 
                $where = 'WHERE';
@@ -151,7 +151,7 @@ class Share extends Constants {
                $select = self::createSelectStatement(self::FORMAT_NONE, $fileDependent);
 
                $where .= ' `' . $column . '` = ? AND `item_type` = ? ';
-               $arguments = array($itemSource, $itemType);
+               $arguments = [$itemSource, $itemType];
                // for link shares $user === null
                if ($user !== null) {
                        $where .= ' AND `share_with` = ? ';
@@ -205,8 +205,8 @@ class Share extends Constants {
 
                        if (!empty($groups)) {
                                $where = $fileDependentWhere . ' WHERE `' . $column . '` = ? AND `item_type` = ? AND `share_with` in (?)';
-                               $arguments = array($itemSource, $itemType, $groups);
-                               $types = array(null, null, IQueryBuilder::PARAM_STR_ARRAY);
+                               $arguments = [$itemSource, $itemType, $groups];
+                               $types = [null, null, IQueryBuilder::PARAM_STR_ARRAY];
 
                                if ($owner !== null) {
                                        $where .= ' AND `uid_owner` = ?';
@@ -347,7 +347,7 @@ class Share extends Constants {
 
                $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, $owner, $shareType);
 
-               $toDelete = array();
+               $toDelete = [];
                $newParent = null;
                $currentUser = $owner ? $owner : \OC_User::getUser();
                foreach ($items as $item) {
@@ -423,7 +423,7 @@ class Share extends Constants {
                }
 
                // Pass all the vars we have for now, they may be useful
-               $hookParams = array(
+               $hookParams = [
                        'id'            => $item['id'],
                        'itemType'      => $item['item_type'],
                        'itemSource'    => $item['item_source'],
@@ -431,7 +431,7 @@ class Share extends Constants {
                        'shareWith'     => $shareWith,
                        'itemParent'    => $item['parent'],
                        'uidOwner'      => $item['uid_owner'],
-               );
+               ];
                if($item['item_type'] === 'file' || $item['item_type'] === 'folder') {
                        $hookParams['fileSource'] = $item['file_source'];
                        $hookParams['fileTarget'] = $item['file_target'];
@@ -464,20 +464,20 @@ class Share extends Constants {
                                self::$backends[$itemType] = new $class;
                                if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) {
                                        $message = 'Sharing backend %s must implement the interface OCP\Share_Backend';
-                                       $message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class));
+                                       $message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', [$class]);
                                        \OCP\Util::writeLog('OCP\Share', sprintf($message, $class), ILogger::ERROR);
                                        throw new \Exception($message_t);
                                }
                                return self::$backends[$itemType];
                        } else {
                                $message = 'Sharing backend %s not found';
-                               $message_t = $l->t('Sharing backend %s not found', array($class));
+                               $message_t = $l->t('Sharing backend %s not found', [$class]);
                                \OCP\Util::writeLog('OCP\Share', sprintf($message, $class), ILogger::ERROR);
                                throw new \Exception($message_t);
                        }
                }
                $message = 'Sharing backend for %s not found';
-               $message_t = $l->t('Sharing backend for %s not found', array($itemType));
+               $message_t = $l->t('Sharing backend for %s not found', [$itemType]);
                \OCP\Util::writeLog('OCP\Share', sprintf($message, $itemType), ILogger::ERROR);
                throw new \Exception($message_t);
        }
@@ -505,7 +505,7 @@ class Share extends Constants {
         * @return array
         */
        private static function getCollectionItemTypes($itemType) {
-               $collectionTypes = array($itemType);
+               $collectionTypes = [$itemType];
                foreach (self::$backendTypes as $type => $backend) {
                        if (in_array($backend['collectionOf'], $collectionTypes)) {
                                $collectionTypes[] = $type;
@@ -538,7 +538,7 @@ class Share extends Constants {
        public static function getSharedItemsOwners($user, $type, $includeCollections = false, $includeOwner = false) {
                // First, we find out if $type is part of a collection (and if that collection is part of
                // another one and so on).
-               $collectionTypes = array();
+               $collectionTypes = [];
                if (!$includeCollections || !$collectionTypes = self::getCollectionItemTypes($type)) {
                        $collectionTypes[] = $type;
                }
@@ -547,7 +547,7 @@ class Share extends Constants {
                // list of the ones for which a sharing backend has been registered.
                // FIXME: Ideally, we wouldn't need to nest getItemsSharedWith in this loop but just call it
                // with its $includeCollections parameter set to true. Unfortunately, this fails currently.
-               $allMaybeSharedItems = array();
+               $allMaybeSharedItems = [];
                foreach ($collectionTypes as $collectionType) {
                        if (isset(self::$backends[$collectionType])) {
                                $allMaybeSharedItems[$collectionType] = self::getItemsSharedWithUser(
@@ -558,7 +558,7 @@ class Share extends Constants {
                        }
                }
 
-               $owners = array();
+               $owners = [];
                if ($includeOwner) {
                        $owners[] = $user;
                }
@@ -599,7 +599,7 @@ class Share extends Constants {
                                                                        $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1,
                                                                        $includeCollections = false, $itemShareWithBySource = false, $checkExpireDate  = true) {
                if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') != 'yes') {
-                       return array();
+                       return [];
                }
                $backend = self::getBackend($itemType);
                $collectionTypes = false;
@@ -617,7 +617,7 @@ class Share extends Constants {
                        }
                        $where .= 'INNER JOIN `*PREFIX*storages` ON `numeric_id` = `*PREFIX*filecache`.`storage` ';
                        $fileDependent = true;
-                       $queryArgs = array();
+                       $queryArgs = [];
                } else {
                        $fileDependent = false;
                        $root = '';
@@ -625,7 +625,7 @@ class Share extends Constants {
                        if ($includeCollections && !isset($item) && $collectionTypes) {
                                // If includeCollections is true, find collections of this item type, e.g. a music album contains songs
                                if (!in_array($itemType, $collectionTypes)) {
-                                       $itemTypes = array_merge(array($itemType), $collectionTypes);
+                                       $itemTypes = array_merge([$itemType], $collectionTypes);
                                } else {
                                        $itemTypes = $collectionTypes;
                                }
@@ -634,7 +634,7 @@ class Share extends Constants {
                                $queryArgs = $itemTypes;
                        } else {
                                $where = ' WHERE `item_type` = ?';
-                               $queryArgs = array($itemType);
+                               $queryArgs = [$itemType];
                        }
                }
                if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
@@ -754,10 +754,10 @@ class Share extends Constants {
                                \OC_DB::getErrorMessage() . ', select=' . $select . ' where=',
                                ILogger::ERROR);
                }
-               $items = array();
-               $targets = array();
-               $switchedItems = array();
-               $mounts = array();
+               $items = [];
+               $targets = [];
+               $switchedItems = [];
+               $mounts = [];
                while ($row = $result->fetchRow()) {
                        self::transformDBResults($row);
                        // Filter out duplicate group shares for users with unique targets
@@ -812,7 +812,7 @@ class Share extends Constants {
                        if (isset($uidOwner) && isset($row['path'])) {
                                if (isset($row['parent'])) {
                                        $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?');
-                                       $parentResult = $query->execute(array($row['parent']));
+                                       $parentResult = $query->execute([$row['parent']]);
                                        if ($result === false) {
                                                \OCP\Util::writeLog('OCP\Share', 'Can\'t select parent: ' .
                                                        \OC_DB::getErrorMessage() . ', select=' . $select . ' where=' . $where,
@@ -887,7 +887,7 @@ class Share extends Constants {
                }
 
                if (!empty($items)) {
-                       $collectionItems = array();
+                       $collectionItems = [];
                        foreach ($items as &$row) {
                                // Return only the item instead of a 2-dimensional array
                                if ($limit == 1 && $row[$column] == $item && ($row['item_type'] == $itemType || $itemType == 'file')) {
@@ -905,7 +905,7 @@ class Share extends Constants {
                                                if (isset($item) && $row['item_type'] == $itemType && $row[$column] == $item) {
                                                        $collectionItems[] = $row;
                                                } else {
-                                                       $collection = array();
+                                                       $collection = [];
                                                        $collection['item_type'] = $row['item_type'];
                                                        if ($row['item_type'] == 'file' || $row['item_type'] == 'folder') {
                                                                $collection['path'] = basename($row['path']);
@@ -938,7 +938,7 @@ class Share extends Constants {
                                                                                                return $childItem;
                                                                                        } else {
                                                                                                // Unset the items array and break out of both loops
-                                                                                               $items = array();
+                                                                                               $items = [];
                                                                                                $items[] = $childItem;
                                                                                                break 2;
                                                                                        }
@@ -985,7 +985,7 @@ class Share extends Constants {
                        // FIXME: Thats a dirty hack to improve file sharing performance,
                        // see github issue #10588 for more details
                        // Need to find a solution which works for all back-ends
-                       $collectionItems = array();
+                       $collectionItems = [];
                        $collectionBackend = self::getBackend('folder');
                        $sharedParents = $collectionBackend->getParents($item, $shareWith, $uidOwner);
                        foreach ($sharedParents as $parent) {
@@ -997,7 +997,7 @@ class Share extends Constants {
                        return self::formatResult($collectionItems, $column, $backend, $format, $parameters);
                }
 
-               return array();
+               return [];
        }
 
        /**
@@ -1011,7 +1011,7 @@ class Share extends Constants {
 
                $fileSharing = $itemType === 'file' || $itemType === 'folder';
 
-               $result = array();
+               $result = [];
 
                foreach ($items as $item) {
                        $grouped = false;
@@ -1058,7 +1058,7 @@ class Share extends Constants {
        private static function put($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
                                                                $permissions) {
 
-               $queriesToExecute = array();
+               $queriesToExecute = [];
                $suggestedItemTarget = null;
                $groupFileTarget = $fileTarget = $suggestedFileTarget = $filePath = '';
                $groupItemTarget = $itemTarget = $fileSource = $parent = 0;
@@ -1074,13 +1074,13 @@ class Share extends Constants {
                }
 
                $isGroupShare = false;
-                       $users = array($shareWith);
+                       $users = [$shareWith];
                        $itemTarget = Helper::generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
                                $suggestedItemTarget);
 
                $run = true;
                $error = '';
-               $preHookData = array(
+               $preHookData = [
                        'itemType' => $itemType,
                        'itemSource' => $itemSource,
                        'shareType' => $shareType,
@@ -1091,7 +1091,7 @@ class Share extends Constants {
                        'token' => null,
                        'run' => &$run,
                        'error' => &$error
-               );
+               ];
 
                $preHookData['itemTarget'] = $itemTarget;
                $preHookData['shareWith'] = $shareWith;
@@ -1144,7 +1144,7 @@ class Share extends Constants {
                                }
                        }
 
-                       $queriesToExecute[] = array(
+                       $queriesToExecute[] = [
                                'itemType'                      => $itemType,
                                'itemSource'            => $itemSource,
                                'itemTarget'            => $itemTarget,
@@ -1158,7 +1158,7 @@ class Share extends Constants {
                                'token'                         => null,
                                'parent'                        => $parent,
                                'expiration'            => null,
-                       );
+                       ];
 
                }
 
@@ -1169,7 +1169,7 @@ class Share extends Constants {
                        $id = self::insertShare($shareQuery);
                }
 
-               $postHookData = array(
+               $postHookData = [
                        'itemType' => $itemType,
                        'itemSource' => $itemSource,
                        'parent' => $parent,
@@ -1180,7 +1180,7 @@ class Share extends Constants {
                        'id' => $parent,
                        'token' => null,
                        'expirationDate' => null,
-               );
+               ];
 
                $postHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith;
                $postHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget;
@@ -1208,7 +1208,7 @@ class Share extends Constants {
        private static function checkReshare($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $itemSourceName, $expirationDate) {
                $backend = self::getBackend($itemType);
 
-               $result = array();
+               $result = [];
 
                $column = ($itemType === 'file' || $itemType === 'folder') ? 'file_source' : 'item_source';
 
@@ -1419,7 +1419,7 @@ class Share extends Constants {
                if ($format === self::FORMAT_NONE) {
                        return $items;
                } else if ($format === self::FORMAT_STATUSES) {
-                       $statuses = array();
+                       $statuses = [];
                        foreach ($items as $item) {
                                if ($item['share_type'] === self::SHARE_TYPE_LINK) {
                                        if ($item['uid_initiator'] !== \OC::$server->getUserSession()->getUser()->getUID()) {
@@ -1507,7 +1507,7 @@ class Share extends Constants {
         */
        private static function sendRemoteUnshare($remote, $id, $token) {
                $url = rtrim($remote, '/');
-               $fields = array('token' => $token, 'format' => 'json');
+               $fields = ['token' => $token, 'format' => 'json'];
                $url = self::removeProtocolFromUrl($url);
                $result = self::tryHttpPostToShareEndpoint($url, '/'.$id.'/unshare', $fields);
                $status = json_decode($result['result'], true);
index e7f077f4022afb0bf4699a4ef2f9f50b38ef9e60..3c39b58245e914915eac8f9df4f7ee5bff7dcdce 100644 (file)
@@ -839,7 +839,7 @@ class DefaultShareProvider implements IShareProvider {
                $pathSections = explode('/', $data['path'], 2);
                // FIXME: would not detect rare md5'd home storage case properly
                if ($pathSections[0] !== 'files'
-                       && in_array(explode(':', $data['storage_string_id'], 2)[0], array('home', 'object'))) {
+                       && in_array(explode(':', $data['storage_string_id'], 2)[0], ['home', 'object'])) {
                        return false;
                }
                return true;
index 9023e14fd2c497babf7cae4c88582ad7475c6fc8..4e1f6567e6b475118331f69c027512f128b48393 100644 (file)
@@ -858,7 +858,7 @@ class Manager implements IManager {
                        'shareWith' => $shareWith,
                ]);
 
-               $emailTemplate->setSubject($l->t('%1$s shared »%2$s« with you', array($initiatorDisplayName, $filename)));
+               $emailTemplate->setSubject($l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]));
                $emailTemplate->addHeader();
                $emailTemplate->addHeading($l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false);
                $text = $l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]);
@@ -1022,7 +1022,7 @@ class Manager implements IManager {
                        } else {
                                $userFolder = $this->rootFolder->getUserFolder($share->getSharedBy());
                        }
-                       \OC_Hook::emit(Share::class, 'post_update_permissions', array(
+                       \OC_Hook::emit(Share::class, 'post_update_permissions', [
                                'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder',
                                'itemSource' => $share->getNode()->getId(),
                                'shareType' => $share->getShareType(),
@@ -1030,7 +1030,7 @@ class Manager implements IManager {
                                'uidOwner' => $share->getSharedBy(),
                                'permissions' => $share->getPermissions(),
                                'path' => $userFolder->getRelativePath($share->getNode()->getPath()),
-                       ));
+                       ]);
                }
 
                return $share;
index b3b40e78b9fb6090dd82a2b675868a055565138a..0c9d7bdd84a8163bab7f6ba803e85594ed730c34 100644 (file)
@@ -135,7 +135,7 @@ class SubAdmin extends PublicEmitter implements ISubAdmin {
         */
        public function getSubAdminsGroupsName(IUser $user): array {
                return array_map(function($group) {
-                       return array('displayName' => $group->getDisplayName());
+                       return ['displayName' => $group->getDisplayName()];
                }, $this->getSubAdminsGroups($user));
        }
 
index a12076196c819db0581bdf1fd014deae18e1c752..900bd13e84940ec8534940c10298dabfd2a334ac 100644 (file)
@@ -77,7 +77,7 @@ class TagManager implements \OCP\ITagManager {
        * logged in user
        * @return \OCP\ITags
        */
-       public function load($type, $defaultTags = array(), $includeShared = false, $userId = null) {
+       public function load($type, $defaultTags = [], $includeShared = false, $userId = null) {
                if (is_null($userId)) {
                        $user = $this->userSession->getUser();
                        if ($user === null) {
index fb58c33dd0792da6e520c9774977d55236cf93c7..500a0a353d6b7954bd0c1a3a835dffd0df906f8a 100644 (file)
@@ -52,12 +52,12 @@ class TagMapper extends Mapper {
        */
        public function loadTags($owners, $type) {
                if(!is_array($owners)) {
-                       $owners = array($owners);
+                       $owners = [$owners];
                }
 
                $sql = 'SELECT `id`, `uid`, `type`, `category` FROM `' . $this->getTableName() . '` '
                        . 'WHERE `uid` IN (' . str_repeat('?,', count($owners)-1) . '?) AND `type` = ? ORDER BY `category`';
-               return $this->findEntities($sql, array_merge($owners, array($type)));
+               return $this->findEntities($sql, array_merge($owners, [$type]));
        }
 
        /**
@@ -70,7 +70,7 @@ class TagMapper extends Mapper {
                $sql = 'SELECT `id`, `uid`, `type`, `category` FROM `' . $this->getTableName() . '` '
                        . 'WHERE `uid` = ? AND `type` = ? AND `category` = ?';
                try {
-                       $this->findEntity($sql, array($tag->getOwner(), $tag->getType(), $tag->getName()));
+                       $this->findEntity($sql, [$tag->getOwner(), $tag->getType(), $tag->getName()]);
                } catch (DoesNotExistException $e) {
                        return false;
                }
index fe24391a1a5a664c234403dba207c4d0652f7bc3..13618ff518cf41642630e4143ca34e17fe5cfae1 100644 (file)
@@ -57,14 +57,14 @@ class Tags implements ITags {
         *
         * @var array
         */
-       private $tags = array();
+       private $tags = [];
 
        /**
         * Used for storing objectid/categoryname pairs while rescanning.
         *
         * @var array
         */
-       private static $relations = array();
+       private static $relations = [];
 
        /**
         * Type
@@ -93,7 +93,7 @@ class Tags implements ITags {
         *
         * @var array
         */
-       private $owners = array();
+       private $owners = [];
 
        /**
         * The Mapper we're using to communicate our Tag objects to the database.
@@ -122,12 +122,12 @@ class Tags implements ITags {
        * @param array $defaultTags Tags that should be created at construction.
        * @param boolean $includeShared Whether to include tags for items shared with this user by others.
        */
-       public function __construct(TagMapper $mapper, $user, $type, $defaultTags = array(), $includeShared = false) {
+       public function __construct(TagMapper $mapper, $user, $type, $defaultTags = [], $includeShared = false) {
                $this->mapper = $mapper;
                $this->user = $user;
                $this->type = $type;
                $this->includeShared = $includeShared;
-               $this->owners = array($this->user);
+               $this->owners = [$this->user];
                if ($this->includeShared) {
                        $this->owners = array_merge($this->owners, \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true));
                        $this->backend = \OC\Share\Share::getBackend($this->type);
@@ -176,13 +176,13 @@ class Tags implements ITags {
        */
        public function getTags() {
                if(!count($this->tags)) {
-                       return array();
+                       return [];
                }
 
                usort($this->tags, function($a, $b) {
                        return strnatcasecmp($a->getName(), $b->getName());
                });
-               $tagMap = array();
+               $tagMap = [];
 
                foreach($this->tags as $tag) {
                        if($tag->getName() !== ITags::TAG_FAVORITE) {
@@ -216,7 +216,7 @@ class Tags implements ITags {
         * or false if an error occurred
         */
        public function getTagsForObjects(array $objIds) {
-               $entries = array();
+               $entries = [];
 
                try {
                        $conn = \OC::$server->getDatabaseConnection();
@@ -226,13 +226,13 @@ class Tags implements ITags {
                                        'SELECT `category`, `categoryid`, `objid` ' .
                                        'FROM `' . self::RELATION_TABLE . '` r, `' . self::TAG_TABLE . '` ' .
                                        'WHERE `categoryid` = `id` AND `uid` = ? AND r.`type` = ? AND `objid` IN (?)',
-                                       array($this->user, $this->type, $chunk),
-                                       array(null, null, IQueryBuilder::PARAM_INT_ARRAY)
+                                       [$this->user, $this->type, $chunk],
+                                       [null, null, IQueryBuilder::PARAM_INT_ARRAY]
                                );
                                while ($row = $result->fetch()) {
                                        $objId = (int)$row['objid'];
                                        if (!isset($entries[$objId])) {
-                                               $entries[$objId] = array();
+                                               $entries[$objId] = [];
                                        }
                                        $entries[$objId][] = $row['category'];
                                }
@@ -283,13 +283,13 @@ class Tags implements ITags {
                        );
                }
 
-               $ids = array();
+               $ids = [];
                $sql = 'SELECT `objid` FROM `' . self::RELATION_TABLE
                        . '` WHERE `categoryid` = ?';
 
                try {
                        $stmt = \OC_DB::prepare($sql);
-                       $result = $stmt->execute(array($tagId));
+                       $result = $stmt->execute([$tagId]);
                        if ($result === null) {
                                \OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), ILogger::ERROR);
                                return false;
@@ -440,19 +440,19 @@ class Tags implements ITags {
        */
        public function addMultiple($names, $sync=false, $id = null) {
                if(!is_array($names)) {
-                       $names = array($names);
+                       $names = [$names];
                }
                $names = array_map('trim', $names);
                array_filter($names);
 
-               $newones = array();
+               $newones = [];
                foreach($names as $name) {
                        if(!$this->hasTag($name) && $name !== '') {
                                $newones[] = new Tag($this->user, $this->type, $name);
                        }
                        if(!is_null($id) ) {
                                // Insert $objectid, $categoryid  pairs if not exist.
-                               self::$relations[] = array('objid' => $id, 'tag' => $name);
+                               self::$relations[] = ['objid' => $id, 'tag' => $name];
                        }
                }
                $this->tags = array_merge($this->tags, $newones);
@@ -498,11 +498,11 @@ class Tags implements ITags {
                                if($tagId) {
                                        try {
                                                $dbConnection->insertIfNotExist(self::RELATION_TABLE,
-                                                       array(
+                                                       [
                                                                'objid' => $relation['objid'],
                                                                'categoryid' => $tagId,
                                                                'type' => $this->type,
-                                                               ));
+                                                               ]);
                                        } catch(\Exception $e) {
                                                \OC::$server->getLogger()->logException($e, [
                                                        'message' => __METHOD__,
@@ -512,7 +512,7 @@ class Tags implements ITags {
                                        }
                                }
                        }
-                       self::$relations = array(); // reset
+                       self::$relations = []; // reset
                } else {
                        \OCP\Util::writeLog('core', __METHOD__.', $this->tags is not an array! '
                                . print_r($this->tags, true), ILogger::ERROR);
@@ -532,7 +532,7 @@ class Tags implements ITags {
                try {
                        $stmt = \OC_DB::prepare('SELECT `id` FROM `' . self::TAG_TABLE . '` '
                                . 'WHERE `uid` = ?');
-                       $result = $stmt->execute(array($arguments['uid']));
+                       $result = $stmt->execute([$arguments['uid']]);
                        if ($result === null) {
                                \OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), ILogger::ERROR);
                        }
@@ -550,7 +550,7 @@ class Tags implements ITags {
                                        . 'WHERE `categoryid` = ?');
                                while( $row = $result->fetchRow()) {
                                        try {
-                                               $stmt->execute(array($row['id']));
+                                               $stmt->execute([$row['id']]);
                                        } catch(\Exception $e) {
                                                \OC::$server->getLogger()->logException($e, [
                                                        'message' => __METHOD__,
@@ -570,7 +570,7 @@ class Tags implements ITags {
                try {
                        $stmt = \OC_DB::prepare('DELETE FROM `' . self::TAG_TABLE . '` '
                                . 'WHERE `uid` = ?');
-                       $result = $stmt->execute(array($arguments['uid']));
+                       $result = $stmt->execute([$arguments['uid']]);
                        if ($result === null) {
                                \OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OC::$server->getDatabaseConnection()->getError(), ILogger::ERROR);
                        }
@@ -635,7 +635,7 @@ class Tags implements ITags {
                                'level' => ILogger::ERROR,
                                'app' => 'core',
                        ]);
-                       return array();
+                       return [];
                }
        }
 
@@ -685,11 +685,11 @@ class Tags implements ITags {
                }
                try {
                        \OC::$server->getDatabaseConnection()->insertIfNotExist(self::RELATION_TABLE,
-                               array(
+                               [
                                        'objid' => $objid,
                                        'categoryid' => $tagId,
                                        'type' => $this->type,
-                               ));
+                               ]);
                } catch(\Exception $e) {
                        \OC::$server->getLogger()->logException($e, [
                                'message' => __METHOD__,
@@ -724,7 +724,7 @@ class Tags implements ITags {
                        $sql = 'DELETE FROM `' . self::RELATION_TABLE . '` '
                                        . 'WHERE `objid` = ? AND `categoryid` = ? AND `type` = ?';
                        $stmt = \OC_DB::prepare($sql);
-                       $stmt->execute(array($objid, $tagId, $this->type));
+                       $stmt->execute([$objid, $tagId, $this->type]);
                } catch(\Exception $e) {
                        \OC::$server->getLogger()->logException($e, [
                                'message' => __METHOD__,
@@ -744,7 +744,7 @@ class Tags implements ITags {
        */
        public function delete($names) {
                if(!is_array($names)) {
-                       $names = array($names);
+                       $names = [$names];
                }
 
                $names = array_map('trim', $names);
@@ -774,7 +774,7 @@ class Tags implements ITags {
                                        $sql = 'DELETE FROM `' . self::RELATION_TABLE . '` '
                                                        . 'WHERE `categoryid` = ?';
                                        $stmt = \OC_DB::prepare($sql);
-                                       $result = $stmt->execute(array($id));
+                                       $result = $stmt->execute([$id]);
                                        if ($result === null) {
                                                \OCP\Util::writeLog('core',
                                                        __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(),
@@ -801,7 +801,7 @@ class Tags implements ITags {
                }
                return array_search(strtolower($needle), array_map(
                        function($tag) use($mem) {
-                               return strtolower(call_user_func(array($tag, $mem)));
+                               return strtolower(call_user_func([$tag, $mem]));
                        }, $haystack)
                );
        }
@@ -850,11 +850,11 @@ class Tags implements ITags {
        * @return array
        */
        private function tagMap(Tag $tag) {
-               return array(
+               return [
                        'id'    => $tag->getId(),
                        'name'  => $tag->getName(),
                        'owner' => $tag->getOwner(),
                        'type'  => $tag->getType()
-               );
+               ];
        }
 }
index dab4e9d9086a7b1a339c5b81861fb67c5e8587fa..cbad438cd2c1a9ed10874a0eb2e4981eb30889ae 100644 (file)
@@ -48,7 +48,7 @@ class Base {
         * @param Defaults $theme
         */
        public function __construct($template, $requestToken, $l10n, $theme ) {
-               $this->vars = array();
+               $this->vars = [];
                $this->vars['requesttoken'] = $requestToken;
                $this->l10n = $l10n;
                $this->template = $template;
@@ -118,7 +118,7 @@ class Base {
                        $this->vars[$key][] = $value;
                }
                else{
-                       $this->vars[$key] = array( $value );
+                       $this->vars[$key] = [ $value ];
                }
        }
 
index 94eac48b61fe8ab56925d793ea1db32f9b2df431..ab063dbbdca2702f2c497375c37cce15efc90731 100644 (file)
@@ -145,7 +145,7 @@ class CSSResourceLocator extends ResourceLocator {
                                }
                        }
 
-                       $this->resources[] = array($webRoot? : \OC::$WEBROOT, $webRoot, $file);
+                       $this->resources[] = [$webRoot? : \OC::$WEBROOT, $webRoot, $file];
                }
        }
 }
index 83fc717c9c5e483840ab5a24db083cc37740b1bf..e96505b6d4095b7f60ba87a8409ebc20076329dd 100644 (file)
@@ -216,7 +216,7 @@ class JSCombiner {
                $fileName = array_pop($tmpfileLoc);
                $fileName = str_replace('.json', '.js', $fileName);
 
-               return substr($this->urlGenerator->linkToRoute('core.Js.getJs', array('fileName' => $fileName, 'appName' => $appName)), strlen(\OC::$WEBROOT) + 1);
+               return substr($this->urlGenerator->linkToRoute('core.Js.getJs', ['fileName' => $fileName, 'appName' => $appName]), strlen(\OC::$WEBROOT) + 1);
        }
 
        /**
index ec11e8456d195f2cff764fbea7fa18192424d8f2..781cb0d779458908cd29a2a8780dbf8131120260 100644 (file)
@@ -298,7 +298,7 @@ class JSConfigHelper {
                }
 
                // Allow hooks to modify the output values
-               \OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array));
+               \OC_Hook::emit('\OCP\Config', 'js', ['array' => &$array]);
 
                $result = '';
 
index 22595df7964c820693881a6a0b7fff8737ca6012..7761e115353a2b5764eda336d30726d1b3c5f85a 100755 (executable)
@@ -37,7 +37,7 @@ abstract class ResourceLocator {
        protected $thirdpartyroot;
        protected $webroot;
 
-       protected $resources = array();
+       protected $resources = [];
 
        /** @var \OCP\ILogger */
        protected $logger;
@@ -185,7 +185,7 @@ abstract class ResourceLocator {
                                ]);
                        }
                }
-               $this->resources[] = array($root, $webRoot, $file);
+               $this->resources[] = [$root, $webRoot, $file];
 
                if ($throw && !is_file($root . '/' . $file)) {
                        throw new ResourceNotFoundException($file, $webRoot);
index 8cecc17dbc16c2905f511db9ba1ab8b85e7b9bf2..691f90b788e5bf9a131d1dc4ad1eaaf4ee4cdf12 100644 (file)
@@ -172,7 +172,7 @@ class TemplateLayout extends \OC_Template {
 
                // Add the js files
                $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts);
-               $this->assign('jsfiles', array());
+               $this->assign('jsfiles', []);
                if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
                        if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
                                $jsConfigHelper = new JSConfigHelper(
@@ -220,7 +220,7 @@ class TemplateLayout extends \OC_Template {
                        $cssFiles = self::findStylesheetFiles(\OC_Util::$styles, false);
                }
 
-               $this->assign('cssfiles', array());
+               $this->assign('cssfiles', []);
                $this->assign('printcssfiles', []);
                $this->assign('versionHash', self::$versionHash);
                foreach($cssFiles as $info) {
@@ -303,8 +303,8 @@ class TemplateLayout extends \OC_Template {
                $locator = new \OC\Template\CSSResourceLocator(
                        \OC::$server->getLogger(),
                        $theme,
-                       array( \OC::$SERVERROOT => \OC::$WEBROOT ),
-                       array( \OC::$SERVERROOT => \OC::$WEBROOT ),
+                       [ \OC::$SERVERROOT => \OC::$WEBROOT ],
+                       [ \OC::$SERVERROOT => \OC::$WEBROOT ],
                        $SCSSCacher
                );
                $locator->find($styles);
@@ -339,8 +339,8 @@ class TemplateLayout extends \OC_Template {
                $locator = new \OC\Template\JSResourceLocator(
                        \OC::$server->getLogger(),
                        $theme,
-                       array( \OC::$SERVERROOT => \OC::$WEBROOT ),
-                       array( \OC::$SERVERROOT => \OC::$WEBROOT ),
+                       [ \OC::$SERVERROOT => \OC::$WEBROOT ],
+                       [ \OC::$SERVERROOT => \OC::$WEBROOT ],
                        \OC::$server->query(JSCombiner::class)
                        );
                $locator->find($scripts);
index 4f50f779a8332a66d7eb9f2f52014482b4742c6d..1a12132cf012c3e97f9752c91d2fa640432e9bba 100644 (file)
@@ -77,7 +77,7 @@ class URLGenerator implements IURLGenerator {
         *
         * Returns a url to the given route.
         */
-       public function linkToRoute(string $route, array $parameters = array()): string {
+       public function linkToRoute(string $route, array $parameters = []): string {
                // TODO: mock router
                return \OC::$server->getRouter()->generate($route, $parameters);
        }
@@ -90,7 +90,7 @@ class URLGenerator implements IURLGenerator {
         *
         * Returns an absolute url to the given route.
         */
-       public function linkToRouteAbsolute(string $routeName, array $arguments = array()): string {
+       public function linkToRouteAbsolute(string $routeName, array $arguments = []): string {
                return $this->getAbsoluteURL($this->linkToRoute($routeName, $arguments));
        }
 
@@ -118,7 +118,7 @@ class URLGenerator implements IURLGenerator {
         *
         * Returns a url to the given app and file.
         */
-       public function linkTo(string $app, string $file, array $args = array()): string {
+       public function linkTo(string $app, string $file, array $args = []): string {
                $frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
 
                if( $app !== '' ) {
index 611da73254e6dc6a7dd8a2c2970d3a95a1db3430..91a0943e048a312c6b96aa38c38e7fe79400d660 100644 (file)
@@ -124,22 +124,22 @@ class Updater extends BasicEmitter {
                $installedVersion = $this->config->getSystemValue('version', '0.0.0');
                $currentVersion = implode('.', \OCP\Util::getVersion());
 
-               $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
+               $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, ['app' => 'core']);
 
                $success = true;
                try {
                        $this->doUpgrade($currentVersion, $installedVersion);
                } catch (HintException $exception) {
                        $this->log->logException($exception, ['app' => 'core']);
-                       $this->emit('\OC\Updater', 'failure', array($exception->getMessage() . ': ' .$exception->getHint()));
+                       $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' .$exception->getHint()]);
                        $success = false;
                } catch (\Exception $exception) {
                        $this->log->logException($exception, ['app' => 'core']);
-                       $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage()));
+                       $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' .$exception->getMessage()]);
                        $success = false;
                }
 
-               $this->emit('\OC\Updater', 'updateEnd', array($success));
+               $this->emit('\OC\Updater', 'updateEnd', [$success]);
 
                if(!$wasMaintenanceModeEnabled && $success) {
                        $this->config->setSystemValue('maintenance', false);
@@ -324,7 +324,7 @@ class Updater extends BasicEmitter {
                                        $this->includePreUpdate($appId);
                                }
                                if (file_exists(\OC_App::getAppPath($appId) . '/appinfo/database.xml')) {
-                                       $this->emit('\OC\Updater', 'appSimulateUpdate', array($appId));
+                                       $this->emit('\OC\Updater', 'appSimulateUpdate', [$appId]);
                                        \OC_DB::simulateUpdateDbFromStructure(\OC_App::getAppPath($appId) . '/appinfo/database.xml');
                                }
                        }
@@ -349,15 +349,15 @@ class Updater extends BasicEmitter {
         */
        protected function doAppUpgrade() {
                $apps = \OC_App::getEnabledApps();
-               $priorityTypes = array('authentication', 'filesystem', 'logging');
+               $priorityTypes = ['authentication', 'filesystem', 'logging'];
                $pseudoOtherType = 'other';
-               $stacks = array($pseudoOtherType => array());
+               $stacks = [$pseudoOtherType => []];
 
                foreach ($apps as $appId) {
                        $priorityType = false;
                        foreach ($priorityTypes as $type) {
                                if(!isset($stacks[$type])) {
-                                       $stacks[$type] = array();
+                                       $stacks[$type] = [];
                                }
                                if (\OC_App::isType($appId, [$type])) {
                                        $stacks[$type][] = $appId;
@@ -409,7 +409,7 @@ class Updater extends BasicEmitter {
                                        throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update');
                                }
                                \OC::$server->getAppManager()->disableApp($app, true);
-                               $this->emit('\OC\Updater', 'incompatibleAppDisabled', array($app));
+                               $this->emit('\OC\Updater', 'incompatibleAppDisabled', [$app]);
                        }
                        // no need to disable any app in case this is a non-core upgrade
                        if (!$isCoreUpgrade) {
index a4dbcf77484b3e70534af678fe18befda79cb607..a616183dced494e180d0229dc30c10f0b3f993ff 100644 (file)
@@ -47,7 +47,7 @@ abstract class Backend implements UserInterface {
        const PROVIDE_AVATAR    = 16777216;             // 1 << 24
        const COUNT_USERS               = 268435456;    // 1 << 28
 
-       protected $possibleActions = array(
+       protected $possibleActions = [
                self::CREATE_USER => 'createUser',
                self::SET_PASSWORD => 'setPassword',
                self::CHECK_PASSWORD => 'checkPassword',
@@ -56,7 +56,7 @@ abstract class Backend implements UserInterface {
                self::SET_DISPLAYNAME => 'setDisplayName',
                self::PROVIDE_AVATAR => 'canChangeAvatar',
                self::COUNT_USERS => 'countUsers',
-       );
+       ];
 
        /**
        * Get all supported actions
@@ -108,7 +108,7 @@ abstract class Backend implements UserInterface {
         * @return string[] an array of all uids
         */
        public function getUsers($search = '', $limit = null, $offset = null) {
-               return array();
+               return [];
        }
 
        /**
@@ -147,7 +147,7 @@ abstract class Backend implements UserInterface {
         * @return array an array of all displayNames (value) and the corresponding uids (key)
         */
        public function getDisplayNames($search = '', $limit = null, $offset = null) {
-               $displayNames = array();
+               $displayNames = [];
                $users = $this->getUsers($search, $limit, $offset);
                foreach ( $users as $user) {
                        $displayNames[$user] = $user;
index 7fc774630bdac196f0ee8173cfbee2036bf7e319..2dd12cf916dc2a7abc6d1597c494c991efbaddc5 100644 (file)
@@ -69,12 +69,12 @@ class Manager extends PublicEmitter implements IUserManager {
        /**
         * @var \OCP\UserInterface[] $backends
         */
-       private $backends = array();
+       private $backends = [];
 
        /**
         * @var \OC\User\User[] $cachedUsers
         */
-       private $cachedUsers = array();
+       private $cachedUsers = [];
 
        /** @var IConfig */
        private $config;
@@ -121,7 +121,7 @@ class Manager extends PublicEmitter implements IUserManager {
         * @param \OCP\UserInterface $backend
         */
        public function removeBackend($backend) {
-               $this->cachedUsers = array();
+               $this->cachedUsers = [];
                if (($i = array_search($backend, $this->backends)) !== false) {
                        unset($this->backends[$i]);
                }
@@ -131,8 +131,8 @@ class Manager extends PublicEmitter implements IUserManager {
         * remove all user backends
         */
        public function clearBackends() {
-               $this->cachedUsers = array();
-               $this->backends = array();
+               $this->cachedUsers = [];
+               $this->backends = [];
        }
 
        /**
@@ -241,7 +241,7 @@ class Manager extends PublicEmitter implements IUserManager {
         * @return \OC\User\User[]
         */
        public function search($pattern, $limit = null, $offset = null) {
-               $users = array();
+               $users = [];
                foreach ($this->backends as $backend) {
                        $backendUsers = $backend->getUsers($pattern, $limit, $offset);
                        if (is_array($backendUsers)) {
@@ -270,7 +270,7 @@ class Manager extends PublicEmitter implements IUserManager {
         * @return \OC\User\User[]
         */
        public function searchDisplayName($pattern, $limit = null, $offset = null) {
-               $users = array();
+               $users = [];
                foreach ($this->backends as $backend) {
                        $backendUsers = $backend->getDisplayNames($pattern, $limit, $offset);
                        if (is_array($backendUsers)) {
index 602f779c901204026df4763b47e1ff4f704bdda3..3d97ddce7f9cca6a79f8b46b4860d91eca79b24c 100644 (file)
@@ -440,7 +440,7 @@ class Session implements IUserSession, Emitter {
                $currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login');
 
                if ($this->manager instanceof PublicEmitter) {
-                       $this->manager->emit('\OC\User', 'preLogin', array($user, $password));
+                       $this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
                }
 
                try {
@@ -500,7 +500,7 @@ class Session implements IUserSession, Emitter {
                Util::emitHook(
                        '\OCA\Files_Sharing\API\Server2Server',
                        'preLoginNameUsedAsUserName',
-                       array('uid' => &$username)
+                       ['uid' => &$username]
                );
                $user = $this->manager->get($username);
                if (is_null($user)) {
@@ -640,7 +640,7 @@ class Session implements IUserSession, Emitter {
                        // Ignore and use empty string instead
                }
 
-               $this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
+               $this->manager->emit('\OC\User', 'preLogin', [$uid, $password]);
 
                $user = $this->manager->get($uid);
                if (is_null($user)) {
@@ -841,7 +841,7 @@ class Session implements IUserSession, Emitter {
         */
        public function loginWithCookie($uid, $currentToken, $oldSessionId) {
                $this->session->regenerateId();
-               $this->manager->emit('\OC\User', 'preRememberedLogin', array($uid));
+               $this->manager->emit('\OC\User', 'preRememberedLogin', [$uid]);
                $user = $this->manager->get($uid);
                if (is_null($user)) {
                        // user does not exist
index c68b8b88e31f402d79521fc1d3f019eadbf9bbee..d3ad6dd5799c77585dfd9026beb184a1fd050475 100644 (file)
@@ -202,7 +202,7 @@ class User implements IUser {
        public function delete() {
                $this->dispatcher->dispatch(IUser::class . '::preDelete', new GenericEvent($this));
                if ($this->emitter) {
-                       $this->emitter->emit('\OC\User', 'preDelete', array($this));
+                       $this->emitter->emit('\OC\User', 'preDelete', [$this]);
                }
                // get the home now because it won't return it after user deletion
                $homePath = $this->getHome();
@@ -247,7 +247,7 @@ class User implements IUser {
 
                        $this->dispatcher->dispatch(IUser::class . '::postDelete', new GenericEvent($this));
                        if ($this->emitter) {
-                               $this->emitter->emit('\OC\User', 'postDelete', array($this));
+                               $this->emitter->emit('\OC\User', 'postDelete', [$this]);
                        }
                }
                return !($result === false);
@@ -266,7 +266,7 @@ class User implements IUser {
                        'recoveryPassword' => $recoveryPassword,
                ]));
                if ($this->emitter) {
-                       $this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword));
+                       $this->emitter->emit('\OC\User', 'preSetPassword', [$this, $password, $recoveryPassword]);
                }
                if ($this->backend->implementsActions(Backend::SET_PASSWORD)) {
                        $result = $this->backend->setPassword($this->uid, $password);
@@ -275,7 +275,7 @@ class User implements IUser {
                                'recoveryPassword' => $recoveryPassword,
                        ]));
                        if ($this->emitter) {
-                               $this->emitter->emit('\OC\User', 'postSetPassword', array($this, $password, $recoveryPassword));
+                               $this->emitter->emit('\OC\User', 'postSetPassword', [$this, $password, $recoveryPassword]);
                        }
                        return !($result === false);
                } else {
@@ -473,7 +473,7 @@ class User implements IUser {
                        'oldValue' => $oldValue,
                ]));
                if ($this->emitter) {
-                       $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value, $oldValue));
+                       $this->emitter->emit('\OC\User', 'changeUser', [$this, $feature, $value, $oldValue]);
                }
        }
 }
index 4402840703418dd0bc590ba49eb434683be6c1dc..660ca885dd70d0d7cf70eb50cdee46ffcc1241e5 100644 (file)
@@ -36,7 +36,7 @@ class OC_API {
        /**
         * api actions
         */
-       protected static $actions = array();
+       protected static $actions = [];
 
        /**
         * respond to a call
@@ -101,7 +101,7 @@ class OC_API {
         * @return string
         */
        public static function requestedFormat() {
-               $formats = array('json', 'xml');
+               $formats = ['json', 'xml'];
 
                $format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml';
                return $format;
@@ -167,12 +167,12 @@ class OC_API {
         * @return string
         */
        public static function renderResult($format, $meta, $data) {
-               $response = array(
-                       'ocs' => array(
+               $response = [
+                       'ocs' => [
                                'meta' => $meta,
                                'data' => $data,
-                       ),
-               );
+                       ],
+               ];
                if ($format == 'json') {
                        return OC_JSON::encode($response);
                }
index 961e51fe736d75234872150604744bb3230aff3c..996b7a885c63b498d2765617a1be11342463d23c 100644 (file)
@@ -81,7 +81,7 @@ class OC_App {
         * @return string
         */
        public static function cleanAppId(string $app): string {
-               return str_replace(array('\0', '/', '\\', '..'), '', $app);
+               return str_replace(['\0', '/', '\\', '..'], '', $app);
        }
 
        /**
@@ -473,10 +473,10 @@ class OC_App {
                        foreach ($possibleApps as $possibleApp) {
                                $version = self::getAppVersionByPath($possibleApp['path'] . '/' . $appId);
                                if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) {
-                                       $versionToLoad = array(
+                                       $versionToLoad = [
                                                'dir' => $possibleApp,
                                                'version' => $version,
-                                       );
+                                       ];
                                }
                        }
                        $app_dir[$appId] = $versionToLoad['dir'];
index 9371e733d28eb7ca7cf88dbd0dc483bb94f02209..1cef0d50e04d6944354a6e303ee51e16389ae687 100644 (file)
@@ -121,7 +121,7 @@ class OC_DB {
                                                 . ' pass an array with \'limit\' and \'offset\' instead';
                                throw new \OC\DatabaseException($message);
                        }
-                       $stmt = array('sql' => $stmt, 'limit' => null, 'offset' => null);
+                       $stmt = ['sql' => $stmt, 'limit' => null, 'offset' => null];
                }
                if (is_array($stmt)) {
                        // convert to prepared statement
index 4512784d955710768161842c7624298615bbc75f..cdcf3ad951e5b65655f239df6ed53089a5346c94 100644 (file)
@@ -42,7 +42,7 @@ class OC_DB_StatementWrapper {
         */
        private $statement = null;
        private $isManipulation = false;
-       private $lastArguments = array();
+       private $lastArguments = [];
 
        /**
         * @param boolean $isManipulation
@@ -56,7 +56,7 @@ class OC_DB_StatementWrapper {
         * pass all other function directly to the \Doctrine\DBAL\Driver\Statement
         */
        public function __call($name,$arguments) {
-               return call_user_func_array(array($this->statement,$name), $arguments);
+               return call_user_func_array([$this->statement,$name], $arguments);
        }
 
        /**
index adc793ba9b7155c8f1feb3a177db9b233401a9a0..ebce03385007508346307525e5062cd653ceaeb5 100644 (file)
@@ -123,7 +123,7 @@ class OC_Files {
                        if (!is_array($files)) {
                                $filename = $dir . '/' . $files;
                                if (!$view->is_dir($filename)) {
-                                       self::getSingleFile($view, $dir, $files, is_null($params) ? array() : $params);
+                                       self::getSingleFile($view, $dir, $files, is_null($params) ? [] : $params);
                                        return;
                                }
                        }
@@ -150,7 +150,7 @@ class OC_Files {
 
                        /* Calculate filesize and number of files */
                        if ($getType === self::ZIP_FILES) {
-                               $fileInfos = array();
+                               $fileInfos = [];
                                $fileSize = 0;
                                foreach ($files as $file) {
                                        $fileInfo = \OC\Files\Filesystem::getFileInfo($dir . '/' . $file);
@@ -161,7 +161,7 @@ class OC_Files {
                        } elseif ($getType === self::ZIP_DIR) {
                                $fileInfo = \OC\Files\Filesystem::getFileInfo($dir . '/' . $files);
                                $fileSize = $fileInfo->getSize();
-                               $numberOfFiles = self::getNumberOfFiles(array($fileInfo));
+                               $numberOfFiles = self::getNumberOfFiles([$fileInfo]);
                        }
 
                        $streamer = new Streamer(\OC::$server->getRequest(), $fileSize, $numberOfFiles);
@@ -239,7 +239,7 @@ class OC_Files {
                $minOffset = 0;
                $ind = 0;
 
-               $rangeArray = array();
+               $rangeArray = [];
 
                foreach ($rArray as $value) {
                        $ranges = explode('-', $value);
@@ -258,7 +258,7 @@ class OC_Files {
                                if ($ranges[1] >= $fileSize) {
                                        $ranges[1] = $fileSize-1;
                                }
-                               $rangeArray[$ind++] = array( 'from' => $ranges[0], 'to' => $ranges[1], 'size' => $fileSize );
+                               $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $ranges[1], 'size' => $fileSize ];
                                $minOffset = $ranges[1] + 1;
                                if ($minOffset >= $fileSize) {
                                        break;
@@ -266,7 +266,7 @@ class OC_Files {
                        }
                        elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) {
                                // case: x-
-                               $rangeArray[$ind++] = array( 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize );
+                               $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize ];
                                break;
                        }
                        elseif (is_numeric($ranges[1])) {
@@ -274,7 +274,7 @@ class OC_Files {
                                if ($ranges[1] > $fileSize) {
                                        $ranges[1] = $fileSize;
                                }
-                               $rangeArray[$ind++] = array( 'from' => $fileSize-$ranges[1], 'to' => $fileSize-1, 'size' => $fileSize );
+                               $rangeArray[$ind++] = [ 'from' => $fileSize-$ranges[1], 'to' => $fileSize-1, 'size' => $fileSize ];
                                break;
                        }
                }
@@ -315,7 +315,7 @@ class OC_Files {
                OC_Util::obEnd();
                $view->lockFile($filename, ILockingProvider::LOCK_SHARED);
 
-               $rangeArray = array();
+               $rangeArray = [];
 
                if (isset($params['range']) && substr($params['range'], 0, 6) === 'bytes=') {
                        $rangeArray = self::parseHttpRangeHeader(substr($params['range'], 6), $fileSize);
@@ -352,7 +352,7 @@ class OC_Files {
                            header_remove('Accept-Ranges');
                            header_remove('Content-Range');
                            http_response_code(200);
-                           self::sendHeaders($filename, $name, array());
+                           self::sendHeaders($filename, $name, []);
                            $view->readfile($filename);
                        }
                }
index 3ddb9d07b1462b24eb1cb3d35cd2102797307721..02002d40f1cc8152076cee55967a41cf1f6901e9 100644 (file)
@@ -100,7 +100,7 @@ class OC_Helper {
                        return (float)$str;
                }
 
-               $bytes_array = array(
+               $bytes_array = [
                        'b' => 1,
                        'k' => 1024,
                        'kb' => 1024,
@@ -112,7 +112,7 @@ class OC_Helper {
                        't' => 1024 * 1024 * 1024 * 1024,
                        'pb' => 1024 * 1024 * 1024 * 1024 * 1024,
                        'p' => 1024 * 1024 * 1024 * 1024 * 1024,
-               );
+               ];
 
                $bytes = (float)$str;
 
@@ -245,7 +245,7 @@ class OC_Helper {
         */
        public static function streamCopy($source, $target) {
                if (!$source or !$target) {
-                       return array(0, false);
+                       return [0, false];
                }
                $bufSize = 8192;
                $result = true;
@@ -266,7 +266,7 @@ class OC_Helper {
                                break;
                        }
                }
-               return array($count, $result);
+               return [$count, $result];
        }
 
        /**
@@ -342,7 +342,7 @@ class OC_Helper {
         */
        public static function mb_array_change_key_case($input, $case = MB_CASE_LOWER, $encoding = 'UTF-8') {
                $case = ($case != MB_CASE_UPPER) ? MB_CASE_LOWER : MB_CASE_UPPER;
-               $ret = array();
+               $ret = [];
                foreach ($input as $k => $v) {
                        $ret[mb_convert_case($k, $case, $encoding)] = $v;
                }
index 6353d1f15db6d55282640a0f696b74b54a2e27ed..2918dd4282f8ead166ffca0bee3a8c386ec81ea6 100644 (file)
@@ -36,7 +36,7 @@
 class OC_Hook {
        public static $thrownExceptions = [];
 
-       static private $registered = array();
+       static private $registered = [];
 
        /**
         * connects a function to a hook
@@ -55,12 +55,12 @@ class OC_Hook {
                // If we're trying to connect to an emitting class that isn't
                // yet registered, register it
                if( !array_key_exists($signalClass, self::$registered )) {
-                       self::$registered[$signalClass] = array();
+                       self::$registered[$signalClass] = [];
                }
                // If we're trying to connect to an emitting method that isn't
                // yet registered, register it with the emitting class
                if( !array_key_exists( $signalName, self::$registered[$signalClass] )) {
-                       self::$registered[$signalClass][$signalName] = array();
+                       self::$registered[$signalClass][$signalName] = [];
                }
 
                // don't connect hooks twice
@@ -70,10 +70,10 @@ class OC_Hook {
                        }
                }
                // Connect the hook handler to the requested emitter
-               self::$registered[$signalClass][$signalName][] = array(
+               self::$registered[$signalClass][$signalName][] = [
                                "class" => $slotClass,
                                "name" => $slotName
-               );
+               ];
 
                // No chance for failure ;-)
                return true;
@@ -108,7 +108,7 @@ class OC_Hook {
                // Call all slots
                foreach( self::$registered[$signalClass][$signalName] as $i ) {
                        try {
-                               call_user_func( array( $i["class"], $i["name"] ), $params );
+                               call_user_func( [ $i["class"], $i["name"] ], $params );
                        } catch (Exception $e){
                                self::$thrownExceptions[] = $e;
                                \OC::$server->getLogger()->logException($e);
@@ -132,12 +132,12 @@ class OC_Hook {
        static public function clear($signalClass='', $signalName='') {
                if ($signalClass) {
                        if ($signalName) {
-                               self::$registered[$signalClass][$signalName]=array();
+                               self::$registered[$signalClass][$signalName]=[];
                        }else{
-                               self::$registered[$signalClass]=array();
+                               self::$registered[$signalClass]=[];
                        }
                }else{
-                       self::$registered=array();
+                       self::$registered=[];
                }
        }
 
index e0f2dad35998a9296559a6fcd5fe9173a4535436..4e16b0d8ed714d2759694c288f775066b703a369 100644 (file)
@@ -132,7 +132,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function widthTopLeft() {
                $o = $this->getOrientation();
-               $this->logger->debug('OC_Image->widthTopLeft() Orientation: ' . $o, array('app' => 'core'));
+               $this->logger->debug('OC_Image->widthTopLeft() Orientation: ' . $o, ['app' => 'core']);
                switch ($o) {
                        case -1:
                        case 1:
@@ -156,7 +156,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function heightTopLeft() {
                $o = $this->getOrientation();
-               $this->logger->debug('OC_Image->heightTopLeft() Orientation: ' . $o, array('app' => 'core'));
+               $this->logger->debug('OC_Image->heightTopLeft() Orientation: ' . $o, ['app' => 'core']);
                switch ($o) {
                        case -1:
                        case 1:
@@ -201,7 +201,7 @@ class OC_Image implements \OCP\IImage {
                }
                if ($filePath === null) {
                        if ($this->filePath === null) {
-                               $this->logger->error(__METHOD__ . '(): called with no path.', array('app' => 'core'));
+                               $this->logger->error(__METHOD__ . '(): called with no path.', ['app' => 'core']);
                                return false;
                        } else {
                                $filePath = $this->filePath;
@@ -225,10 +225,10 @@ class OC_Image implements \OCP\IImage {
                        }
                        $isWritable = is_writable(dirname($filePath));
                        if (!$isWritable) {
-                               $this->logger->error(__METHOD__ . '(): Directory \'' . dirname($filePath) . '\' is not writable.', array('app' => 'core'));
+                               $this->logger->error(__METHOD__ . '(): Directory \'' . dirname($filePath) . '\' is not writable.', ['app' => 'core']);
                                return false;
                        } elseif ($isWritable && file_exists($filePath) && !is_writable($filePath)) {
-                               $this->logger->error(__METHOD__ . '(): File \'' . $filePath . '\' is not writable.', array('app' => 'core'));
+                               $this->logger->error(__METHOD__ . '(): File \'' . $filePath . '\' is not writable.', ['app' => 'core']);
                                return false;
                        }
                }
@@ -360,11 +360,11 @@ class OC_Image implements \OCP\IImage {
                                break;
                        default:
                                $res = imagepng($this->resource);
-                               $this->logger->info('OC_Image->data. Could not guess mime-type, defaulting to png', array('app' => 'core'));
+                               $this->logger->info('OC_Image->data. Could not guess mime-type, defaulting to png', ['app' => 'core']);
                                break;
                }
                if (!$res) {
-                       $this->logger->error('OC_Image->data. Error getting image data.', array('app' => 'core'));
+                       $this->logger->error('OC_Image->data. Error getting image data.', ['app' => 'core']);
                }
                return ob_get_clean();
        }
@@ -399,19 +399,19 @@ class OC_Image implements \OCP\IImage {
                }
 
                if ($this->imageType !== IMAGETYPE_JPEG) {
-                       $this->logger->debug('OC_Image->fixOrientation() Image is not a JPEG.', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->fixOrientation() Image is not a JPEG.', ['app' => 'core']);
                        return -1;
                }
                if (!is_callable('exif_read_data')) {
-                       $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', ['app' => 'core']);
                        return -1;
                }
                if (!$this->valid()) {
-                       $this->logger->debug('OC_Image->fixOrientation() No image loaded.', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->fixOrientation() No image loaded.', ['app' => 'core']);
                        return -1;
                }
                if (is_null($this->filePath) || !is_readable($this->filePath)) {
-                       $this->logger->debug('OC_Image->fixOrientation() No readable file path set.', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->fixOrientation() No readable file path set.', ['app' => 'core']);
                        return -1;
                }
                $exif = @exif_read_data($this->filePath, 'IFD0');
@@ -427,11 +427,11 @@ class OC_Image implements \OCP\IImage {
 
        public function readExif($data) {
                if (!is_callable('exif_read_data')) {
-                       $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', ['app' => 'core']);
                        return;
                }
                if (!$this->valid()) {
-                       $this->logger->debug('OC_Image->fixOrientation() No image loaded.', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->fixOrientation() No image loaded.', ['app' => 'core']);
                        return;
                }
 
@@ -453,7 +453,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function fixOrientation() {
                $o = $this->getOrientation();
-               $this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, array('app' => 'core'));
+               $this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, ['app' => 'core']);
                $rotate = 0;
                $flip = false;
                switch ($o) {
@@ -500,15 +500,15 @@ class OC_Image implements \OCP\IImage {
                                                $this->resource = $res;
                                                return true;
                                        } else {
-                                               $this->logger->debug('OC_Image->fixOrientation() Error during alpha-saving', array('app' => 'core'));
+                                               $this->logger->debug('OC_Image->fixOrientation() Error during alpha-saving', ['app' => 'core']);
                                                return false;
                                        }
                                } else {
-                                       $this->logger->debug('OC_Image->fixOrientation() Error during alpha-blending', array('app' => 'core'));
+                                       $this->logger->debug('OC_Image->fixOrientation() Error during alpha-blending', ['app' => 'core']);
                                        return false;
                                }
                        } else {
-                               $this->logger->debug('OC_Image->fixOrientation() Error during orientation fixing', array('app' => 'core'));
+                               $this->logger->debug('OC_Image->fixOrientation() Error during orientation fixing', ['app' => 'core']);
                                return false;
                        }
                }
@@ -550,7 +550,7 @@ class OC_Image implements \OCP\IImage {
                                        imagealphablending($this->resource, true);
                                        imagesavealpha($this->resource, true);
                                } else {
-                                       $this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core'));
+                                       $this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, ['app' => 'core']);
                                }
                                break;
                        case IMAGETYPE_JPEG:
@@ -558,10 +558,10 @@ class OC_Image implements \OCP\IImage {
                                        if (getimagesize($imagePath) !== false) {
                                                $this->resource = @imagecreatefromjpeg($imagePath);
                                        } else {
-                                               $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, array('app' => 'core'));
+                                               $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, ['app' => 'core']);
                                        }
                                } else {
-                                       $this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core'));
+                                       $this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, ['app' => 'core']);
                                }
                                break;
                        case IMAGETYPE_PNG:
@@ -571,21 +571,21 @@ class OC_Image implements \OCP\IImage {
                                        imagealphablending($this->resource, true);
                                        imagesavealpha($this->resource, true);
                                } else {
-                                       $this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core'));
+                                       $this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, ['app' => 'core']);
                                }
                                break;
                        case IMAGETYPE_XBM:
                                if (imagetypes() & IMG_XPM) {
                                        $this->resource = @imagecreatefromxbm($imagePath);
                                } else {
-                                       $this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagePath, array('app' => 'core'));
+                                       $this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagePath, ['app' => 'core']);
                                }
                                break;
                        case IMAGETYPE_WBMP:
                                if (imagetypes() & IMG_WBMP) {
                                        $this->resource = @imagecreatefromwbmp($imagePath);
                                } else {
-                                       $this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: ' . $imagePath, array('app' => 'core'));
+                                       $this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: ' . $imagePath, ['app' => 'core']);
                                }
                                break;
                        case IMAGETYPE_BMP:
@@ -620,7 +620,7 @@ class OC_Image implements \OCP\IImage {
                                // this is mostly file created from encrypted file
                                $this->resource = imagecreatefromstring(\OC\Files\Filesystem::file_get_contents(\OC\Files\Filesystem::getLocalPath($imagePath)));
                                $iType = IMAGETYPE_PNG;
-                               $this->logger->debug('OC_Image->loadFromFile, Default', array('app' => 'core'));
+                               $this->logger->debug('OC_Image->loadFromFile, Default', ['app' => 'core']);
                                break;
                }
                if ($this->valid()) {
@@ -651,7 +651,7 @@ class OC_Image implements \OCP\IImage {
                }
 
                if (!$this->resource) {
-                       $this->logger->debug('OC_Image->loadFromFile, could not load', array('app' => 'core'));
+                       $this->logger->debug('OC_Image->loadFromFile, could not load', ['app' => 'core']);
                        return false;
                }
                return $this->resource;
@@ -674,7 +674,7 @@ class OC_Image implements \OCP\IImage {
                                $this->mimeType = $this->fileInfo->buffer($data);
                        }
                        if (!$this->resource) {
-                               $this->logger->debug('OC_Image->loadFromBase64, could not load', array('app' => 'core'));
+                               $this->logger->debug('OC_Image->loadFromBase64, could not load', ['app' => 'core']);
                                return false;
                        }
                        return $this->resource;
@@ -695,7 +695,7 @@ class OC_Image implements \OCP\IImage {
         */
        private function imagecreatefrombmp($fileName) {
                if (!($fh = fopen($fileName, 'rb'))) {
-                       $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName, array('app' => 'core'));
+                       $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName, ['app' => 'core']);
                        return false;
                }
                // read file header
@@ -703,7 +703,7 @@ class OC_Image implements \OCP\IImage {
                // check for bitmap
                if ($meta['type'] != 19778) {
                        fclose($fh);
-                       $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName . ' is not a bitmap!', array('app' => 'core'));
+                       $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName . ' is not a bitmap!', ['app' => 'core']);
                        return false;
                }
                // read image header
@@ -727,7 +727,7 @@ class OC_Image implements \OCP\IImage {
                                $meta['imagesize'] = @filesize($fileName) - $meta['offset'];
                                if ($meta['imagesize'] < 1) {
                                        fclose($fh);
-                                       $this->logger->warning('imagecreatefrombmp: Can not obtain file size of ' . $fileName . ' is not a bitmap!', array('app' => 'core'));
+                                       $this->logger->warning('imagecreatefrombmp: Can not obtain file size of ' . $fileName . ' is not a bitmap!', ['app' => 'core']);
                                        return false;
                                }
                        }
@@ -735,7 +735,7 @@ class OC_Image implements \OCP\IImage {
                // calculate colors
                $meta['colors'] = !$meta['colors'] ? pow(2, $meta['bits']) : $meta['colors'];
                // read color palette
-               $palette = array();
+               $palette = [];
                if ($meta['bits'] < 16) {
                        $palette = unpack('l' . $meta['colors'], fread($fh, $meta['colors'] * 4));
                        // in rare cases the color value is signed
@@ -751,7 +751,7 @@ class OC_Image implements \OCP\IImage {
                        fclose($fh);
                        $this->logger->warning(
                                'imagecreatefrombmp: imagecreatetruecolor failed for file "' . $fileName . '" with dimensions ' . $meta['width'] . 'x' . $meta['height'],
-                               array('app' => 'core'));
+                               ['app' => 'core']);
                        return false;
                }
 
@@ -768,7 +768,7 @@ class OC_Image implements \OCP\IImage {
                                        case 32:
                                        case 24:
                                                if (!($part = substr($data, $p, 3))) {
-                                                       $this->logger->warning($error, array('app' => 'core'));
+                                                       $this->logger->warning($error, ['app' => 'core']);
                                                        return $im;
                                                }
                                                $color = @unpack('V', $part . $vide);
@@ -776,7 +776,7 @@ class OC_Image implements \OCP\IImage {
                                        case 16:
                                                if (!($part = substr($data, $p, 2))) {
                                                        fclose($fh);
-                                                       $this->logger->warning($error, array('app' => 'core'));
+                                                       $this->logger->warning($error, ['app' => 'core']);
                                                        return $im;
                                                }
                                                $color = @unpack('v', $part);
@@ -823,7 +823,7 @@ class OC_Image implements \OCP\IImage {
                                                break;
                                        default:
                                                fclose($fh);
-                                               $this->logger->warning('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', array('app' => 'core'));
+                                               $this->logger->warning('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', ['app' => 'core']);
                                                return false;
                                }
                                imagesetpixel($im, $x, $y, $color[1]);
@@ -845,7 +845,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function resize($maxSize) {
                if (!$this->valid()) {
-                       $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
                        return false;
                }
                $widthOrig = imagesx($this->resource);
@@ -871,14 +871,14 @@ class OC_Image implements \OCP\IImage {
         */
        public function preciseResize(int $width, int $height): bool {
                if (!$this->valid()) {
-                       $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
                        return false;
                }
                $widthOrig = imagesx($this->resource);
                $heightOrig = imagesy($this->resource);
                $process = imagecreatetruecolor($width, $height);
                if ($process === false) {
-                       $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): Error creating true color image', ['app' => 'core']);
                        return false;
                }
 
@@ -891,7 +891,7 @@ class OC_Image implements \OCP\IImage {
 
                $res = imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
                if ($res === false) {
-                       $this->logger->error(__METHOD__ . '(): Error re-sampling process image', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): Error re-sampling process image', ['app' => 'core']);
                        imagedestroy($process);
                        return false;
                }
@@ -908,7 +908,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function centerCrop($size = 0) {
                if (!$this->valid()) {
-                       $this->logger->error('OC_Image->centerCrop, No image loaded', array('app' => 'core'));
+                       $this->logger->error('OC_Image->centerCrop, No image loaded', ['app' => 'core']);
                        return false;
                }
                $widthOrig = imagesx($this->resource);
@@ -935,7 +935,7 @@ class OC_Image implements \OCP\IImage {
                }
                $process = imagecreatetruecolor($targetWidth, $targetHeight);
                if ($process == false) {
-                       $this->logger->error('OC_Image->centerCrop, Error creating true color image', array('app' => 'core'));
+                       $this->logger->error('OC_Image->centerCrop, Error creating true color image', ['app' => 'core']);
                        imagedestroy($process);
                        return false;
                }
@@ -949,7 +949,7 @@ class OC_Image implements \OCP\IImage {
 
                imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
                if ($process == false) {
-                       $this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, array('app' => 'core'));
+                       $this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, ['app' => 'core']);
                        imagedestroy($process);
                        return false;
                }
@@ -969,12 +969,12 @@ class OC_Image implements \OCP\IImage {
         */
        public function crop(int $x, int $y, int $w, int $h): bool {
                if (!$this->valid()) {
-                       $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
                        return false;
                }
                $process = imagecreatetruecolor($w, $h);
                if ($process == false) {
-                       $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): Error creating true color image', ['app' => 'core']);
                        imagedestroy($process);
                        return false;
                }
@@ -988,7 +988,7 @@ class OC_Image implements \OCP\IImage {
 
                imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
                if ($process == false) {
-                       $this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, ['app' => 'core']);
                        imagedestroy($process);
                        return false;
                }
@@ -1008,7 +1008,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function fitIn($maxWidth, $maxHeight) {
                if (!$this->valid()) {
-                       $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
                        return false;
                }
                $widthOrig = imagesx($this->resource);
@@ -1031,7 +1031,7 @@ class OC_Image implements \OCP\IImage {
         */
        public function scaleDownToFit($maxWidth, $maxHeight) {
                if (!$this->valid()) {
-                       $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+                       $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
                        return false;
                }
                $widthOrig = imagesx($this->resource);
@@ -1075,7 +1075,7 @@ if (!function_exists('imagebmp')) {
         * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
         */
        function imagebmp($im, $fileName = '', $bit = 24, $compression = 0) {
-               if (!in_array($bit, array(1, 4, 8, 16, 24, 32))) {
+               if (!in_array($bit, [1, 4, 8, 16, 24, 32])) {
                        $bit = 24;
                } else if ($bit == 32) {
                        $bit = 24;
index 29d0029a3a0a5c219616471f833af476062581c6..f83fca0a4337f1c04ce242e3951bc41ba4719adb 100644 (file)
@@ -44,7 +44,7 @@ class OC_JSON{
        public static function checkAppEnabled($app) {
                if( !\OC::$server->getAppManager()->isEnabledForUser($app)) {
                        $l = \OC::$server->getL10N('lib');
-                       self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' )));
+                       self::error([ 'data' => [ 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' ]]);
                        exit();
                }
        }
@@ -60,7 +60,7 @@ class OC_JSON{
                        || $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
                        $l = \OC::$server->getL10N('lib');
                        http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED);
-                       self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' )));
+                       self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]);
                        exit();
                }
        }
@@ -78,7 +78,7 @@ class OC_JSON{
 
                if( !\OC::$server->getRequest()->passesCSRFCheck()) {
                        $l = \OC::$server->getL10N('lib');
-                       self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' )));
+                       self::error([ 'data' => [ 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' ]]);
                        exit();
                }
        }
@@ -91,7 +91,7 @@ class OC_JSON{
        public static function checkAdminUser() {
                if( !OC_User::isAdminUser(OC_User::getUser())) {
                        $l = \OC::$server->getL10N('lib');
-                       self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' )));
+                       self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]);
                        exit();
                }
        }
@@ -101,7 +101,7 @@ class OC_JSON{
         * @deprecated Use a AppFramework JSONResponse instead
         * @suppress PhanDeprecatedFunction
         */
-       public static function error($data = array()) {
+       public static function error($data = []) {
                $data['status'] = 'error';
                header( 'Content-Type: application/json; charset=utf-8');
                echo self::encode($data);
@@ -112,7 +112,7 @@ class OC_JSON{
         * @deprecated Use a AppFramework JSONResponse instead
         * @suppress PhanDeprecatedFunction
         */
-       public static function success($data = array()) {
+       public static function success($data = []) {
                $data['status'] = 'success';
                header( 'Content-Type: application/json; charset=utf-8');
                echo self::encode($data);
@@ -133,7 +133,7 @@ class OC_JSON{
         */
        public static function encode($data) {
                if (is_array($data)) {
-                       array_walk_recursive($data, array('OC_JSON', 'to_string'));
+                       array_walk_recursive($data, ['OC_JSON', 'to_string']);
                }
                return json_encode($data, JSON_HEX_TAG);
        }
index ed1e56279615fca1897cc6883f30a45a8e9d59a5..279ceb8de0f9580f8f180a385cf562227708b682 100644 (file)
@@ -54,7 +54,7 @@ class OC_Template extends \OC\Template\Base {
        private $path; // The path to the template
 
        /** @var array */
-       private $headers = array(); //custom headers
+       private $headers = []; //custom headers
 
        /** @var string */
        protected $app; // app id
@@ -154,7 +154,7 @@ class OC_Template extends \OC\Template\Base {
                $locator = new \OC\Template\TemplateFileLocator( $dirs );
                $template = $locator->find($name);
                $path = $locator->getPath();
-               return array($path, $template);
+               return [$path, $template];
        }
 
        /**
@@ -165,11 +165,11 @@ class OC_Template extends \OC\Template\Base {
         * element will be written as empty element. So use "" to get a closing tag.
         */
        public function addHeader($tag, $attributes, $text=null) {
-               $this->headers[]= array(
+               $this->headers[]= [
                        'tag' => $tag,
                        'attributes' => $attributes,
                        'text' => $text
-               );
+               ];
        }
 
        /**
@@ -238,7 +238,7 @@ class OC_Template extends \OC\Template\Base {
         * @param array $parameters Parameters for the template
         * @return boolean|null
         */
-       public static function printUserPage( $application, $name, $parameters = array() ) {
+       public static function printUserPage( $application, $name, $parameters = [] ) {
                $content = new OC_Template( $application, $name, "user" );
                foreach( $parameters as $key => $value ) {
                        $content->assign( $key, $value );
@@ -253,7 +253,7 @@ class OC_Template extends \OC\Template\Base {
         * @param array $parameters Parameters for the template
         * @return bool
         */
-       public static function printAdminPage( $application, $name, $parameters = array() ) {
+       public static function printAdminPage( $application, $name, $parameters = [] ) {
                $content = new OC_Template( $application, $name, "admin" );
                foreach( $parameters as $key => $value ) {
                        $content->assign( $key, $value );
@@ -268,7 +268,7 @@ class OC_Template extends \OC\Template\Base {
         * @param array|string $parameters Parameters for the template
         * @return bool
         */
-       public static function printGuestPage( $application, $name, $parameters = array() ) {
+       public static function printGuestPage( $application, $name, $parameters = [] ) {
                $content = new OC_Template($application, $name, $name === 'error' ? $name : 'guest');
                foreach( $parameters as $key => $value ) {
                        $content->assign( $key, $value );
@@ -297,7 +297,7 @@ class OC_Template extends \OC\Template\Base {
                http_response_code($statusCode);
                try {
                        $content = new \OC_Template( '', 'error', 'error', false );
-                       $errors = array(array('error' => $error_msg, 'hint' => $hint));
+                       $errors = [['error' => $error_msg, 'hint' => $hint]];
                        $content->assign( 'errors', $errors );
                        $content->printPage();
                } catch (\Exception $e) {
index d931e4d129f04406f085f4e8fdc67428aa642dfe..9184da21bdb574f807af318b6343f741e592ee03 100644 (file)
@@ -196,11 +196,11 @@ function component($app, $file) {
        if(is_array($file)) {
                foreach($file as $f) {
                        $url = link_to($app, 'component/' . $f . '.html');
-                       OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url));
+                       OC_Util::addHeader('link', ['rel' => 'import', 'href' => $url]);
                }
        } else {
                $url = link_to($app, 'component/' . $file . '.html');
-               OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url));
+               OC_Util::addHeader('link', ['rel' => 'import', 'href' => $url]);
        }
 }
 
@@ -213,7 +213,7 @@ function component($app, $file) {
  *
  * For further information have a look at \OCP\IURLGenerator::linkTo
  */
-function link_to( $app, $file, $args = array() ) {
+function link_to( $app, $file, $args = [] ) {
        return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
 }
 
@@ -305,9 +305,9 @@ function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false)
        return $formatter->formatTimeSpan($timestamp, $fromTime);
 }
 
-function html_select_options($options, $selected, $params=array()) {
+function html_select_options($options, $selected, $params=[]) {
        if (!is_array($selected)) {
-               $selected=array($selected);
+               $selected=[$selected];
        }
        if (isset($params['combine']) && $params['combine']) {
                $options = array_combine($options, $options);
index 6a88706352530cd3ecee5f1afebdd914c74d0a46..736fc2d97023adba40ff26a09f7ddff8760041c9 100644 (file)
@@ -59,9 +59,9 @@ use OCP\ILogger;
  */
 class OC_User {
 
-       private static $_usedBackends = array();
+       private static $_usedBackends = [];
 
-       private static $_setupedBackends = array();
+       private static $_setupedBackends = [];
 
        // bool, stores if a user want to access a resource anonymously, e.g if they open a public link
        private static $incognitoMode = false;
@@ -113,7 +113,7 @@ class OC_User {
         * remove all used backends
         */
        public static function clearBackends() {
-               self::$_usedBackends = array();
+               self::$_usedBackends = [];
                \OC::$server->getUserManager()->clearBackends();
        }
 
@@ -165,7 +165,7 @@ class OC_User {
 
                $uid = $backend->getCurrentUserId();
                $run = true;
-               OC_Hook::emit("OC_User", "pre_login", array("run" => &$run, "uid" => $uid, 'backend' => $backend));
+               OC_Hook::emit("OC_User", "pre_login", ["run" => &$run, "uid" => $uid, 'backend' => $backend]);
 
                if ($uid) {
                        if (self::getUser() !== $uid) {
@@ -385,7 +385,7 @@ class OC_User {
         * @deprecated Use \OC::$server->getUserManager->searchDisplayName($search, $limit, $offset) instead.
         */
        public static function getDisplayNames($search = '', $limit = null, $offset = null) {
-               $displayNames = array();
+               $displayNames = [];
                $users = \OC::$server->getUserManager()->searchDisplayName($search, $limit, $offset);
                foreach ($users as $user) {
                        $displayNames[$user->getUID()] = $user->getDisplayName();
index 63edf34e029988425827bf5cfef0fa8ea55af04a..044c3fee7bc248d152379f4f59cd520687d8ed9f 100644 (file)
@@ -69,9 +69,9 @@ use OCP\ILogger;
 use OCP\IUser;
 
 class OC_Util {
-       public static $scripts = array();
-       public static $styles = array();
-       public static $headers = array();
+       public static $scripts = [];
+       public static $styles = [];
+       public static $headers = [];
        private static $rootMounted = false;
        private static $fsSetup = false;
 
@@ -88,7 +88,7 @@ class OC_Util {
                //first set up the local "root" storage
                \OC\Files\Filesystem::initMountManager();
                if (!self::$rootMounted) {
-                       \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', array('datadir' => $configDataDirectory), '/');
+                       \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', ['datadir' => $configDataDirectory], '/');
                        self::$rootMounted = true;
                }
        }
@@ -107,7 +107,7 @@ class OC_Util {
                        \OCP\Util::writeLog('files', 'No class given for objectstore', ILogger::ERROR);
                }
                if (!isset($config['arguments'])) {
-                       $config['arguments'] = array();
+                       $config['arguments'] = [];
                }
 
                // instantiate object store implementation
@@ -141,7 +141,7 @@ class OC_Util {
                        \OCP\Util::writeLog('files', 'No class given for objectstore', ILogger::ERROR);
                }
                if (!isset($config['arguments'])) {
-                       $config['arguments'] = array();
+                       $config['arguments'] = [];
                }
 
                // instantiate object store implementation
@@ -194,7 +194,7 @@ class OC_Util {
                }
 
                // load all filesystem apps before, so no setup-hook gets lost
-               OC_App::loadApps(array('filesystem'));
+               OC_App::loadApps(['filesystem']);
 
                // the filesystem will finish when $user is not empty,
                // mark fs setup here to avoid doing the setup from loading
@@ -254,7 +254,7 @@ class OC_Util {
                                        $user = $storage->getUser()->getUID();
                                        $quota = OC_Util::getUserQuota($user);
                                        if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
-                                               return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files'));
+                                               return new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => $quota, 'root' => 'files']);
                                        }
                                }
                        }
@@ -279,7 +279,7 @@ class OC_Util {
                        return $storage;
                });
 
-               OC_Hook::emit('OC_Filesystem', 'preSetup', array('user' => $user));
+               OC_Hook::emit('OC_Filesystem', 'preSetup', ['user' => $user]);
 
                \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($prevLogging);
 
@@ -309,7 +309,7 @@ class OC_Util {
                        //jail the user into his "home" directory
                        \OC\Files\Filesystem::init($user, $userDir);
 
-                       OC_Hook::emit('OC_Filesystem', 'setup', array('user' => $user, 'user_dir' => $userDir));
+                       OC_Hook::emit('OC_Filesystem', 'setup', ['user' => $user, 'user_dir' => $userDir]);
                }
                \OC::$server->getEventLogger()->end('setup_fs');
                return true;
@@ -695,11 +695,11 @@ class OC_Util {
         * @param bool $prepend prepend the header to the beginning of the list
         */
        public static function addHeader($tag, $attributes, $text = null, $prepend = false) {
-               $header = array(
+               $header = [
                        'tag' => $tag,
                        'attributes' => $attributes,
                        'text' => $text
-               );
+               ];
                if ($prepend === true) {
                        array_unshift (self::$headers, $header);
 
@@ -716,7 +716,7 @@ class OC_Util {
         */
        public static function checkServer(\OC\SystemConfig $config) {
                $l = \OC::$server->getL10N('lib');
-               $errors = array();
+               $errors = [];
                $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data');
 
                if (!self::needUpgrade($config) && $config->getValue('installed', false)) {
@@ -744,23 +744,23 @@ class OC_Util {
 
                $availableDatabases = $setup->getSupportedDatabases();
                if (empty($availableDatabases)) {
-                       $errors[] = array(
+                       $errors[] = [
                                'error' => $l->t('No database drivers (sqlite, mysql, or postgresql) installed.'),
                                'hint' => '' //TODO: sane hint
-                       );
+                       ];
                        $webServerRestart = true;
                }
 
                // Check if config folder is writable.
                if(!OC_Helper::isReadOnlyConfigEnabled()) {
                        if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
-                               $errors[] = array(
+                               $errors[] = [
                                        'error' => $l->t('Cannot write into "config" directory'),
                                        'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
                                                [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. '
                                                . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s',
                                                [ $urlGenerator->linkToDocs('admin-config') ] )
-                               );
+                               ];
                        }
                }
 
@@ -770,12 +770,12 @@ class OC_Util {
                                || !is_writable(OC_App::getInstallPath())
                                || !is_readable(OC_App::getInstallPath())
                        ) {
-                               $errors[] = array(
+                               $errors[] = [
                                        'error' => $l->t('Cannot write into "apps" directory'),
                                        'hint' => $l->t('This can usually be fixed by giving the webserver write access to the apps directory'
                                                . ' or disabling the appstore in the config file. See %s',
                                                [$urlGenerator->linkToDocs('admin-dir_permissions')])
-                               );
+                               ];
                        }
                }
                // Create root dir.
@@ -812,12 +812,12 @@ class OC_Util {
                }
 
                if (!OC_Util::isSetLocaleWorking()) {
-                       $errors[] = array(
+                       $errors[] = [
                                'error' => $l->t('Setting locale to %s failed',
-                                       array('en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/'
-                                               . 'pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8')),
+                                       ['en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/'
+                                               . 'pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8']),
                                'hint' => $l->t('Please install one of these locales on your system and restart your webserver.')
-                       );
+                       ];
                }
 
                // Contains the dependencies that should be checked against
@@ -828,13 +828,13 @@ class OC_Util {
                // If the dependency is not found the missing module name is shown to the EndUser
                // When adding new checks always verify that they pass on Travis as well
                // for ini settings, see https://github.com/owncloud/administration/blob/master/travis-ci/custom.ini
-               $dependencies = array(
-                       'classes' => array(
+               $dependencies = [
+                       'classes' => [
                                'ZipArchive' => 'zip',
                                'DOMDocument' => 'dom',
                                'XMLWriter' => 'XMLWriter',
                                'XMLReader' => 'XMLReader',
-                       ),
+                       ],
                        'functions' => [
                                'xml_parser_create' => 'libxml',
                                'mb_strcut' => 'mbstring',
@@ -848,14 +848,14 @@ class OC_Util {
                                'curl_init' => 'cURL',
                                'openssl_verify' => 'OpenSSL',
                        ],
-                       'defined' => array(
+                       'defined' => [
                                'PDO::ATTR_DRIVER_NAME' => 'PDO'
-                       ),
+                       ],
                        'ini' => [
                                'default_charset' => 'UTF-8',
                        ],
-               );
-               $missingDependencies = array();
+               ];
+               $missingDependencies = [];
                $invalidIniSettings = [];
                $moduleHint = $l->t('Please ask your server administrator to install the module.');
 
@@ -894,10 +894,10 @@ class OC_Util {
                }
 
                foreach($missingDependencies as $missingDependency) {
-                       $errors[] = array(
-                               'error' => $l->t('PHP module %s not installed.', array($missingDependency)),
+                       $errors[] = [
+                               'error' => $l->t('PHP module %s not installed.', [$missingDependency]),
                                'hint' => $moduleHint
-                       );
+                       ];
                        $webServerRestart = true;
                }
                foreach($invalidIniSettings as $setting) {
@@ -921,10 +921,10 @@ class OC_Util {
                 */
                if($iniWrapper->getBool('mbstring.func_overload') !== null &&
                        $iniWrapper->getBool('mbstring.func_overload') === true) {
-                       $errors[] = array(
+                       $errors[] = [
                                'error' => $l->t('mbstring.func_overload is set to "%s" instead of the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]),
                                'hint' => $l->t('To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini')
-                       );
+                       ];
                }
 
                if(function_exists('xml_parser_create') &&
@@ -935,24 +935,24 @@ class OC_Util {
                        $minor = floor($version/100);
                        $version -= ($minor * 100);
                        $patch = $version;
-                       $errors[] = array(
+                       $errors[] = [
                                'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]),
                                'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.')
-                       );
+                       ];
                }
 
                if (!self::isAnnotationsWorking()) {
-                       $errors[] = array(
+                       $errors[] = [
                                'error' => $l->t('PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible.'),
                                'hint' => $l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')
-                       );
+                       ];
                }
 
                if (!\OC::$CLI && $webServerRestart) {
-                       $errors[] = array(
+                       $errors[] = [
                                'error' => $l->t('PHP modules have been installed, but they are still listed as missing?'),
                                'hint' => $l->t('Please ask your server administrator to restart the web server.')
-                       );
+                       ];
                }
 
                $errors = array_merge($errors, self::checkDatabaseVersion());
@@ -970,7 +970,7 @@ class OC_Util {
         */
        public static function checkDatabaseVersion() {
                $l = \OC::$server->getL10N('lib');
-               $errors = array();
+               $errors = [];
                $dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite');
                if ($dbType === 'pgsql') {
                        // check PostgreSQL version
@@ -980,10 +980,10 @@ class OC_Util {
                                if (isset($data['server_version'])) {
                                        $version = $data['server_version'];
                                        if (version_compare($version, '9.0.0', '<')) {
-                                               $errors[] = array(
+                                               $errors[] = [
                                                        'error' => $l->t('PostgreSQL >= 9 required'),
                                                        'hint' => $l->t('Please upgrade your database version')
-                                               );
+                                               ];
                                        }
                                }
                        } catch (\Doctrine\DBAL\DBALException $e) {
index 6642c332d52d3fdfe793c42a4ae49ea9fd85c49a..f9d53bf1129cddb1a42004342c4a7ad953a79fc5 100644 (file)
@@ -77,7 +77,7 @@ abstract class Controller {
                $this->request = $request;
 
                // default responders
-               $this->responders = array(
+               $this->responders = [
                        'json' => function ($data) {
                                if ($data instanceof DataResponse) {
                                        $response = new JSONResponse(
@@ -95,7 +95,7 @@ abstract class Controller {
                                }
                                return new JSONResponse($data);
                        }
-               );
+               ];
        }
 
 
index 287c991b587c183ca7263151b4ff44e36ab45030..7340df55fc40a761a9171a04974b4fd85968f788 100644 (file)
@@ -38,8 +38,8 @@ abstract class Entity {
 
        public $id;
 
-       private $_updatedFields = array();
-       private $_fieldTypes = array('id' => 'integer');
+       private $_updatedFields = [];
+       private $_fieldTypes = ['id' => 'integer'];
 
 
        /**
@@ -95,7 +95,7 @@ abstract class Entity {
         * @since 7.0.0
         */
        public function resetUpdatedFields(){
-               $this->_updatedFields = array();
+               $this->_updatedFields = [];
        }
 
        /**
index d6068f9c51530af6ebbefcb194c64115f29e0241..29c042def7cde50b84eb88239644b719c9d006fd 100644 (file)
@@ -51,8 +51,8 @@ class DataResponse extends Response {
         * @param array $headers additional key value based headers
         * @since 8.0.0
         */
-       public function __construct($data=array(), $statusCode=Http::STATUS_OK,
-                                   array $headers=array()) {
+       public function __construct($data=[], $statusCode=Http::STATUS_OK,
+                                   array $headers=[]) {
                parent::__construct();
 
                $this->data = $data;
index abe0190488736d638d3d466f10bead0da41bb4cd..e84042dbe19b37a79eeed90804751a0b5f5f03f9 100644 (file)
@@ -53,7 +53,7 @@ class JSONResponse extends Response {
         * @param int $statusCode the Http status code, defaults to 200
         * @since 6.0.0
         */
-       public function __construct($data=array(), $statusCode=Http::STATUS_OK) {
+       public function __construct($data=[], $statusCode=Http::STATUS_OK) {
                parent::__construct();
 
                $this->data = $data;
index 15318f30bbde3f8804acb00fe553f1558c848def..2fc985aabfbf6c1f5f2a733e6227c40171a79a4d 100644 (file)
@@ -49,16 +49,16 @@ class Response {
         * Headers - defaults to ['Cache-Control' => 'no-cache, no-store, must-revalidate']
         * @var array
         */
-       private $headers = array(
+       private $headers = [
                'Cache-Control' => 'no-cache, no-store, must-revalidate'
-       );
+       ];
 
 
        /**
         * Cookies that will be need to be constructed as header
         * @var array
         */
-       private $cookies = array();
+       private $cookies = [];
 
 
        /**
@@ -138,7 +138,7 @@ class Response {
         * @since 8.0.0
         */
        public function addCookie($name, $value, \DateTime $expireDate = null) {
-               $this->cookies[$name] = array('value' => $value, 'expireDate' => $expireDate);
+               $this->cookies[$name] = ['value' => $value, 'expireDate' => $expireDate];
                return $this;
        }
 
index d6d1fc1d72a4b7fac2c7ef4325c9149567b0e1a2..801c0a2347c561a846292b73f5a8e13bf667e73e 100644 (file)
@@ -48,7 +48,7 @@ class PublicTemplateResponse extends TemplateResponse {
         * @param array $params
         * @since 14.0.0
         */
-       public function __construct(string $appName, string $templateName, array $params = array()) {
+       public function __construct(string $appName, string $templateName, array $params = []) {
                parent::__construct($appName, $templateName, $params, 'public');
                \OC_Util::addScript('core', 'public/publicpage');
        }
index 8ceeed5b8aa676db66ac39af01883337f6048083..fb02c9d265cb8a8beac6543b0d1f37686fb22141 100644 (file)
@@ -75,7 +75,7 @@ class TemplateResponse extends Response {
         * @param string $renderAs how the page should be rendered, defaults to user
         * @since 6.0.0 - parameters $params and $renderAs were added in 7.0.0
         */
-       public function __construct($appName, $templateName, array $params=array(),
+       public function __construct($appName, $templateName, array $params=[],
                                    $renderAs='user') {
                parent::__construct();
 
index 9dd19c4cbf4134ea4088920d2e67105cdbdcd6c9..7fcd59f571594c82698387fa648d1b212f1c6048 100644 (file)
@@ -98,7 +98,7 @@ interface IManager {
         * @return array an array of contacts which are arrays of key-value-pairs
         * @since 6.0.0
         */
-       public function search($pattern, $searchProperties = array(), $options = array());
+       public function search($pattern, $searchProperties = [], $options = []);
 
        /**
         * This function can be used to delete the contact identified by the given id
index 2b3cb9388ce55c60c35282839c32cbd126dbce62..4752616d41d5135a342fedb000892613759f2af7 100644 (file)
@@ -36,7 +36,7 @@ interface ICompositeExpression {
         * @return ICompositeExpression
         * @since 8.2.0
         */
-       public function addMultiple(array $parts = array());
+       public function addMultiple(array $parts = []);
 
        /**
         * Adds an expression to composite expression.
index 6cef23bfb9223565d509de32be9406e2327f8135..3cee49e3aaadc2d8e99750c5eeb7ea57c38d67c1 100644 (file)
@@ -206,7 +206,7 @@ interface IQueryBuilder {
         * @return $this This QueryBuilder instance.
         * @since 8.2.0
         */
-       public function setParameters(array $params, array $types = array());
+       public function setParameters(array $params, array $types = []);
 
        /**
         * Gets all defined query parameters for the query being constructed indexed by parameter index or name.
index d1e20fd530af7417e67d7c84ef16eb80ce43bb5f..23a6b554ce632a93901946d6419c482855ebde46 100644 (file)
@@ -48,7 +48,7 @@ class LockNotAcquiredException extends \Exception {
         * @since 7.0.0
         */
        public function __construct($path, $lockType, $code = 0, \Exception $previous = null) {
-               $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', array($lockType, $path));
+               $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', [$lockType, $path]);
                parent::__construct($message, $code, $previous);
        }
 
index 5be4935906d55522cc95df3aac8d598391c5ec27..30010bb4cefa5dd4289170b38639d9b81c1ca1a0 100644 (file)
@@ -81,7 +81,7 @@ interface IDBConnection {
         * @return \Doctrine\DBAL\Driver\Statement The executed statement.
         * @since 8.0.0
         */
-       public function executeQuery($query, array $params = array(), $types = array());
+       public function executeQuery($query, array $params = [], $types = []);
 
        /**
         * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
@@ -95,7 +95,7 @@ interface IDBConnection {
         * @return integer The number of affected rows.
         * @since 8.0.0
         */
-       public function executeUpdate($query, array $params = array(), array $types = array());
+       public function executeUpdate($query, array $params = [], array $types = []);
 
        /**
         * Used to get the id of the just inserted element
index 7d1940983e1c5ee7e1f30880506e4a2198d9ccfa..d92beab0b4cf64c6a88339359331534294646dc8 100644 (file)
@@ -42,7 +42,7 @@ interface ISearch {
         * @return array An array of OCP\Search\Result's
         * @since 8.0.0
         */
-       public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30);
+       public function searchPaged($query, array $inApps = [], $page = 1, $size = 30);
 
        /**
         * Register a new search provider to search with
@@ -50,7 +50,7 @@ interface ISearch {
         * @param array $options optional
         * @since 7.0.0
         */
-       public function registerProvider($class, array $options = array());
+       public function registerProvider($class, array $options = []);
 
        /**
         * Remove one existing search provider
index 98c3f831a7451e8083e29e2c96fad965826c9e7c..f45ac25965257e3f1c4091686fa5adc3c2c93570 100644 (file)
@@ -60,5 +60,5 @@ interface ITagManager {
         * @return \OCP\ITags
         * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
        */
-       public function load($type, $defaultTags = array(), $includeShared = false, $userId = null);
+       public function load($type, $defaultTags = [], $includeShared = false, $userId = null);
 }
index ac680654b50ac7e696c72f47433851660537eb27..52fde15d0371c40736e8d81c689ded38b68000a6 100644 (file)
@@ -42,7 +42,7 @@ interface IURLGenerator {
         * @return string the url
         * @since 6.0.0
         */
-       public function linkToRoute(string $routeName, array $arguments = array()): string;
+       public function linkToRoute(string $routeName, array $arguments = []): string;
 
        /**
         * Returns the absolute URL for a route
@@ -51,7 +51,7 @@ interface IURLGenerator {
         * @return string the absolute url
         * @since 8.0.0
         */
-       public function linkToRouteAbsolute(string $routeName, array $arguments = array()): string;
+       public function linkToRouteAbsolute(string $routeName, array $arguments = []): string;
 
        /**
         * @param string $routeName
@@ -70,7 +70,7 @@ interface IURLGenerator {
         * @return string the url
         * @since 6.0.0
         */
-       public function linkTo(string $appName, string $file, array $args = array()): string;
+       public function linkTo(string $appName, string $file, array $args = []): string;
 
        /**
         * Returns the link to an image, like linkTo but only with prepending img/
index 4414988c91015f87c131998d18d46c7c2ccf22b2..f2c43cf8c7ec0bdd79e96560c444cfee52c1ec10 100644 (file)
@@ -91,7 +91,7 @@ interface IRouter {
         * @since 7.0.0
         * @deprecated 9.0.0
         */
-       public function create($name, $pattern, array $defaults = array(), array $requirements = array());
+       public function create($name, $pattern, array $defaults = [], array $requirements = []);
 
        /**
         * Find the route matching $url.
@@ -122,6 +122,6 @@ interface IRouter {
         * @since 7.0.0
         * @deprecated 9.0.0
         */
-       public function generate($name, $parameters = array(), $absolute = false);
+       public function generate($name, $parameters = [], $absolute = false);
 
 }
index c756daa449a9595199cfc580629821671e809505..3bf8d59eccbf4e91fded05238bf185d373a391e2 100644 (file)
@@ -49,7 +49,7 @@ abstract class Provider {
         * @param array $options as key => value
         * @since 7.0.0 - default value for $options was added in 8.0.0
         */
-       public function __construct($options = array()) {
+       public function __construct($options = []) {
                $this->options = $options;
        }
 
@@ -76,7 +76,7 @@ abstract class Provider {
         * @return bool
         * @since 8.0.0
         */
-       public function providesResultsFor(array $apps = array()) {
+       public function providesResultsFor(array $apps = []) {
                $forApps = $this->getOption(self::OPTION_APPS);
                return empty($apps) || empty($forApps) || array_intersect($forApps, $apps);
        }
index 85ab0ac23bccc6e8d3b9a0bc617ec42deff3616a..a19c9fae9918f6c06305bacebaf48838fba96783 100644 (file)
@@ -124,7 +124,7 @@ class Template extends \OC_Template {
         * @since 8.0.0
         * @suppress PhanDeprecatedFunction
         */
-       public static function html_select_options($options, $selected, $params=array()) {
+       public static function html_select_options($options, $selected, $params=[]) {
                return \html_select_options($options, $selected, $params);
        }
 }
index 74a4b18f5d4c8fcea94c203b24ea3dec3af50fd2..d28eda72014057fb5214294d59a8e175dc3a334a 100644 (file)
@@ -215,7 +215,7 @@ class Util {
         * @return string the url
         * @since 4.0.0 - parameter $args was added in 4.5.0
         */
-       public static function linkToAbsolute( $app, $file, $args = array() ) {
+       public static function linkToAbsolute( $app, $file, $args = [] ) {
                $urlGenerator = \OC::$server->getURLGenerator();
                return $urlGenerator->getAbsoluteURL(
                        $urlGenerator->linkTo($app, $file, $args)
@@ -348,7 +348,7 @@ class Util {
         * TODO: write example
         * @since 4.0.0
         */
-       static public function emitHook($signalclass, $signalname, $params = array()) {
+       static public function emitHook($signalclass, $signalname, $params = []) {
                return \OC_Hook::emit($signalclass, $signalname, $params);
        }
 
index a63e1c78f2ab6564846c7760b2910c5f8655419d..41753dc8a1d4a050bad928e49f4b27ccf9218638 100644 (file)
@@ -66,8 +66,8 @@ try {
 
        // Load all required applications
        \OC::$REQUESTEDAPP = $app;
-       OC_App::loadApps(array('authentication'));
-       OC_App::loadApps(array('filesystem', 'logging'));
+       OC_App::loadApps(['authentication']);
+       OC_App::loadApps(['filesystem', 'logging']);
 
        if (!\OC::$server->getAppManager()->isInstalled($app)) {
                http_response_code(404);
index 1a0b2966f13561189122872f35f7929a62e643eb..7d20b4fbdf45fff20981c0dc97f05e13e237ebae 100644 (file)
@@ -146,8 +146,8 @@ try {
 
        // Load all required applications
        \OC::$REQUESTEDAPP = $app;
-       OC_App::loadApps(array('authentication'));
-       OC_App::loadApps(array('filesystem', 'logging'));
+       OC_App::loadApps(['authentication']);
+       OC_App::loadApps(['filesystem', 'logging']);
 
        switch ($app) {
                case 'core':
index cd90918144d0b9aae59f865fa638c5b59d2a3b2f..211f08b929fb2068acf266a930546e9c32758234 100644 (file)
@@ -83,7 +83,7 @@ class ClientFlowLoginControllerTest extends TestCase {
                $this->l10n
                        ->expects($this->any())
                        ->method('t')
-                       ->willReturnCallback(function($text, $parameters = array()) {
+                       ->willReturnCallback(function($text, $parameters = []) {
                                return vsprintf($text, $parameters);
                        });
                $this->defaults = $this->createMock(Defaults::class);
index fdbca1ea3b17d9def8854edd5e0dcc82443ebd69..750547473b1eea6a364585e7bfe5aa9aafb1a880 100644 (file)
@@ -110,7 +110,7 @@ class LostControllerTest extends \Test\TestCase {
                $this->l10n
                        ->expects($this->any())
                        ->method('t')
-                       ->willReturnCallback(function($text, $parameters = array()) {
+                       ->willReturnCallback(function($text, $parameters = []) {
                                return vsprintf($text, $parameters);
                        });
                $this->defaults = $this->getMockBuilder('\OCP\Defaults')
@@ -256,7 +256,7 @@ class LostControllerTest extends \Test\TestCase {
                $this->urlGenerator
                        ->expects($this->once())
                        ->method('linkToRouteAbsolute')
-                       ->with('core.lost.setPassword', array('userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword'))
+                       ->with('core.lost.setPassword', ['userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword'])
                        ->willReturn('https://example.tld/index.php/lostpassword/');
 
                $this->initialStateService->expects($this->at(0))
@@ -280,10 +280,10 @@ class LostControllerTest extends \Test\TestCase {
                $this->userManager
                        ->expects($this->any())
                        ->method('userExists')
-                       ->willReturnMap(array(
-                               array(true, $existingUser),
-                               array(false, $nonExistingUser)
-                       ));
+                       ->willReturnMap([
+                               [true, $existingUser],
+                               [false, $nonExistingUser]
+                       ]);
 
                $this->logger->expects($this->exactly(0))
                        ->method('logException');
@@ -338,7 +338,7 @@ class LostControllerTest extends \Test\TestCase {
                $this->urlGenerator
                        ->expects($this->once())
                        ->method('linkToRouteAbsolute')
-                       ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'))
+                       ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'])
                        ->willReturn('https://example.tld/index.php/lostpassword/');
                $message = $this->getMockBuilder('\OC\Mail\Message')
                        ->disableOriginalConstructor()->getMock();
@@ -416,7 +416,7 @@ class LostControllerTest extends \Test\TestCase {
                $this->urlGenerator
                        ->expects($this->once())
                        ->method('linkToRouteAbsolute')
-                       ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'))
+                       ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'])
                        ->willReturn('https://example.tld/index.php/lostpassword/');
                $message = $this->getMockBuilder('\OC\Mail\Message')
                        ->disableOriginalConstructor()->getMock();
@@ -489,7 +489,7 @@ class LostControllerTest extends \Test\TestCase {
                $this->urlGenerator
                        ->expects($this->once())
                        ->method('linkToRouteAbsolute')
-                       ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'))
+                       ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'])
                        ->willReturn('https://example.tld/index.php/lostpassword/');
                $message = $this->createMock(Message::class);
                $message
@@ -568,7 +568,7 @@ class LostControllerTest extends \Test\TestCase {
                        )->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword');
 
                $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
-               $expectedResponse = array('status' => 'error', 'msg' => '');
+               $expectedResponse = ['status' => 'error', 'msg' => ''];
                $this->assertSame($expectedResponse, $response);
        }
 
@@ -598,7 +598,7 @@ class LostControllerTest extends \Test\TestCase {
                        )->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword');
 
                $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
-               $expectedResponse = array('user' => 'ValidTokenUser', 'status' => 'success');
+               $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
                $this->assertSame($expectedResponse, $response);
        }
 
@@ -802,7 +802,7 @@ class LostControllerTest extends \Test\TestCase {
                        )->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword');
 
                $response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', false);
-               $expectedResponse = array('user' => 'ValidTokenUser', 'status' => 'success');
+               $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
                $this->assertSame($expectedResponse, $response);
        }
 
index f0fbce86b8c49dcd164e2b149dd6c4fbcc5c7a24..af776274e5ccc9b7ac0902ce1b29e6e507c05ddb 100644 (file)
@@ -92,14 +92,14 @@ class OCSControllerTest extends TestCase {
                list($major, $minor, $micro) = \OCP\Util::getVersion();
 
                $result = [];
-               $result['version'] = array(
+               $result['version'] = [
                        'major' => $major,
                        'minor' => $minor,
                        'micro' => $micro,
                        'string' => \OC_Util::getVersionString(),
                        'edition' => '',
                        'extendedSupport' => false
-               );
+               ];
 
                $capabilities = [
                        'foo' => 'bar',
@@ -124,14 +124,14 @@ class OCSControllerTest extends TestCase {
                list($major, $minor, $micro) = \OCP\Util::getVersion();
 
                $result = [];
-               $result['version'] = array(
+               $result['version'] = [
                        'major' => $major,
                        'minor' => $minor,
                        'micro' => $micro,
                        'string' => \OC_Util::getVersionString(),
                        'edition' => '',
                        'extendedSupport' => false
-               );
+               ];
 
                $capabilities = [
                        'foo' => 'bar',
index cdf2e6acc6e0ed50245fefcbba698fd5dcee3c56..745f522d874ba17e7f8ecc4496624605ed9984e6 100644 (file)
@@ -44,7 +44,7 @@ class FileListContext implements Context, ActorAwareInterface {
         * @BeforeScenario
         */
        public function initializeFileListAncestors() {
-               $this->fileListAncestorsByActor = array();
+               $this->fileListAncestorsByActor = [];
                $this->fileListAncestor = null;
        }
 
index 81587e40682a4316ddd190fc8c57c06f4e8cf734..9ef34cae29fcc79e306a9fffdc8c9edce3d94672 100644 (file)
@@ -132,8 +132,8 @@ class ActorContext extends RawMinkContext {
         * are used in an "I act as XXX" step.
         */
        public function initializeActors() {
-               $this->actors = array();
-               $this->sharedNotebook = array();
+               $this->actors = [];
+               $this->sharedNotebook = [];
 
                $this->actors["default"] = new Actor("default", $this->getSession(), $this->getMinkParameter("base_url"), $this->sharedNotebook);
                $this->actors["default"]->setFindTimeoutMultiplier($this->actorTimeoutMultiplier);
index e670a5b8065a54bbd9f4c3a6f32b675f3239a89d..e3577f296f4c6a8fe35823a699c13b746bc0b5d6 100644 (file)
@@ -134,7 +134,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function id($value) {
-               return $this->customSelector("named_exact", array("id", $value));
+               return $this->customSelector("named_exact", ["id", $value]);
        }
 
        /**
@@ -142,7 +142,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function idOrName($value) {
-               return $this->customSelector("named_exact", array("id_or_name", $value));
+               return $this->customSelector("named_exact", ["id_or_name", $value]);
        }
 
        /**
@@ -150,7 +150,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function link($value) {
-               return $this->customSelector("named_exact", array("link", $value));
+               return $this->customSelector("named_exact", ["link", $value]);
        }
 
        /**
@@ -158,7 +158,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function button($value) {
-               return $this->customSelector("named_exact", array("button", $value));
+               return $this->customSelector("named_exact", ["button", $value]);
        }
 
        /**
@@ -166,7 +166,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function linkOrButton($value) {
-               return $this->customSelector("named_exact", array("link_or_button", $value));
+               return $this->customSelector("named_exact", ["link_or_button", $value]);
        }
 
        /**
@@ -174,7 +174,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function field($value) {
-               return $this->customSelector("named_exact", array("field", $value));
+               return $this->customSelector("named_exact", ["field", $value]);
        }
 
        /**
@@ -182,7 +182,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function selectField($value) {
-               return $this->customSelector("named_exact", array("select", $value));
+               return $this->customSelector("named_exact", ["select", $value]);
        }
 
        /**
@@ -190,7 +190,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function checkbox($value) {
-               return $this->customSelector("named_exact", array("checkbox", $value));
+               return $this->customSelector("named_exact", ["checkbox", $value]);
        }
 
        /**
@@ -198,7 +198,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function radioButton($value) {
-               return $this->customSelector("named_exact", array("radio", $value));
+               return $this->customSelector("named_exact", ["radio", $value]);
        }
 
        /**
@@ -206,7 +206,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function fileInput($value) {
-               return $this->customSelector("named_exact", array("file", $value));
+               return $this->customSelector("named_exact", ["file", $value]);
        }
 
        /**
@@ -214,7 +214,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function optionGroup($value) {
-               return $this->customSelector("named_exact", array("optgroup", $value));
+               return $this->customSelector("named_exact", ["optgroup", $value]);
        }
 
        /**
@@ -222,7 +222,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function option($value) {
-               return $this->customSelector("named_exact", array("option", $value));
+               return $this->customSelector("named_exact", ["option", $value]);
        }
 
        /**
@@ -230,7 +230,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function fieldSet($value) {
-               return $this->customSelector("named_exact", array("fieldset", $value));
+               return $this->customSelector("named_exact", ["fieldset", $value]);
        }
 
        /**
@@ -238,7 +238,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function table($value) {
-               return $this->customSelector("named_exact", array("table", $value));
+               return $this->customSelector("named_exact", ["table", $value]);
        }
 
 }
index ff1296ba18aaba738df45b098a48fbbd92653282..8540a71a4f44dcaa14a04d7234be5ea1042ae42b 100644 (file)
@@ -78,7 +78,7 @@ class NextcloudTestServerContext implements Context {
                $nextcloudTestServerHelperClass = new ReflectionClass($nextcloudTestServerHelper);
 
                if ($nextcloudTestServerHelperParameters === null) {
-                       $nextcloudTestServerHelperParameters = array();
+                       $nextcloudTestServerHelperParameters = [];
                }
 
                $this->nextcloudTestServerHelper = $nextcloudTestServerHelperClass->newInstanceArgs($nextcloudTestServerHelperParameters);
index 63895cbd56942313105ef0f7308d89cd84708b60..1ed2a6bdde6bdbd53f70c69c1d3746591b1ef4ae 100644 (file)
@@ -28,7 +28,7 @@ function loadDirectory($path) {
 }
 
 function getSubclasses($parentClassName) {
-       $classes = array();
+       $classes = [];
        foreach (get_declared_classes() as $className) {
                if (is_subclass_of($className, $parentClassName))
                        $classes[] = $className;
index 4e78272fab4f34356604a9bb9bb300d212ab1903..528673950a4cc3876b6f08fc842b8890ccc27277 100644 (file)
@@ -1,5 +1,5 @@
 <?php
 
-$CONFIG = array(
+$CONFIG = [
        'mysql.utf8mb4' => true,
-);
+];
index 97af541085b16f2c2f7dd7ff91b04a86b5830005..9e30977e29bfb29c88993368be656a62fe6574fc 100644 (file)
@@ -44,14 +44,14 @@ class AllConfigTest extends \Test\TestCase {
                $this->connection->executeUpdate(
                        'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
                        '`configkey`, `configvalue`) VALUES (?, ?, ?, ?)',
-                       array('userDelete', 'appDelete', 'keyDelete', 'valueDelete')
+                       ['userDelete', 'appDelete', 'keyDelete', 'valueDelete']
                );
 
                $config->deleteUserValue('userDelete', 'appDelete', 'keyDelete');
 
                $result = $this->connection->executeQuery(
                                'SELECT COUNT(*) AS `count` FROM `*PREFIX*preferences` WHERE `userid` = ?',
-                               array('userDelete')
+                               ['userDelete']
                        )->fetch();
                $actualCount = $result['count'];
 
@@ -64,28 +64,28 @@ class AllConfigTest extends \Test\TestCase {
 
                $config->setUserValue('userSet', 'appSet', 'keySet', 'valueSet');
 
-               $result = $this->connection->executeQuery($selectAllSQL, array('userSet'))->fetchAll();
+               $result = $this->connection->executeQuery($selectAllSQL, ['userSet'])->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userSet',
                        'appid'       => 'appSet',
                        'configkey'   => 'keySet',
                        'configvalue' => 'valueSet'
-               ), $result[0]);
+               ], $result[0]);
 
                // test if the method overwrites existing database entries
                $config->setUserValue('userSet', 'appSet', 'keySet', 'valueSet2');
 
-               $result = $this->connection->executeQuery($selectAllSQL, array('userSet'))->fetchAll();
+               $result = $this->connection->executeQuery($selectAllSQL, ['userSet'])->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userSet',
                        'appid'       => 'appSet',
                        'configkey'   => 'keySet',
                        'configvalue' => 'valueSet2'
-               ), $result[0]);
+               ], $result[0]);
 
                // cleanup - it therefore relies on the successful execution of the previous test
                $config->deleteUserValue('userSet', 'appSet', 'keySet');
@@ -98,28 +98,28 @@ class AllConfigTest extends \Test\TestCase {
 
                $config->setUserValue('userPreCond', 'appPreCond', 'keyPreCond', 'valuePreCond');
 
-               $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond'))->fetchAll();
+               $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond'])->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userPreCond',
                        'appid'       => 'appPreCond',
                        'configkey'   => 'keyPreCond',
                        'configvalue' => 'valuePreCond'
-               ), $result[0]);
+               ], $result[0]);
 
                // test if the method overwrites existing database entries with valid precond
                $config->setUserValue('userPreCond', 'appPreCond', 'keyPreCond', 'valuePreCond2', 'valuePreCond');
 
-               $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond'))->fetchAll();
+               $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond'])->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userPreCond',
                        'appid'       => 'appPreCond',
                        'configkey'   => 'keyPreCond',
                        'configvalue' => 'valuePreCond2'
-               ), $result[0]);
+               ], $result[0]);
 
                // cleanup
                $config->deleteUserValue('userPreCond', 'appPreCond', 'keyPreCond');
@@ -155,28 +155,28 @@ class AllConfigTest extends \Test\TestCase {
 
                $config->setUserValue('userPreCond1', 'appPreCond', 'keyPreCond', 'valuePreCond');
 
-               $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond1'))->fetchAll();
+               $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond1'])->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userPreCond1',
                        'appid'       => 'appPreCond',
                        'configkey'   => 'keyPreCond',
                        'configvalue' => 'valuePreCond'
-               ), $result[0]);
+               ], $result[0]);
 
                // test if the method overwrites existing database entries with valid precond
                $config->setUserValue('userPreCond1', 'appPreCond', 'keyPreCond', 'valuePreCond2', 'valuePreCond3');
 
-               $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond1'))->fetchAll();
+               $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond1'])->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userPreCond1',
                        'appid'       => 'appPreCond',
                        'configkey'   => 'keyPreCond',
                        'configvalue' => 'valuePreCond'
-               ), $result[0]);
+               ], $result[0]);
 
                // cleanup
                $config->deleteUserValue('userPreCond1', 'appPreCond', 'keyPreCond');
@@ -197,7 +197,7 @@ class AllConfigTest extends \Test\TestCase {
                        ->method('executeQuery')
                        ->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` '.
                                        'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'),
-                               $this->equalTo(array('userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged')))
+                               $this->equalTo(['userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged']))
                        ->willReturn($resultMock);
                $connectionMock->expects($this->never())
                        ->method('executeUpdate');
@@ -218,19 +218,19 @@ class AllConfigTest extends \Test\TestCase {
 
                $result = $this->connection->executeQuery(
                        'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?',
-                       array('userGet')
+                       ['userGet']
                )->fetchAll();
 
                $this->assertEquals(1, count($result));
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'userid'      => 'userGet',
                        'appid'       => 'appGet',
                        'configkey'   => 'keyGet',
                        'configvalue' => 'valueGet'
-               ), $result[0]);
+               ], $result[0]);
 
                // drop data from database - but the config option should be cached in the config object
-               $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?', array('userGet'));
+               $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?', ['userGet']);
 
                // testing the caching mechanism
                $value = $config->getUserValue('userGet', 'appGet', 'keyGet');
@@ -239,7 +239,7 @@ class AllConfigTest extends \Test\TestCase {
 
                $result = $this->connection->executeQuery(
                        'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?',
-                       array('userGet')
+                       ['userGet']
                )->fetchAll();
 
                $this->assertEquals(0, count($result));
@@ -249,15 +249,15 @@ class AllConfigTest extends \Test\TestCase {
                $config = $this->getConfig();
 
                // preparation - add something to the database
-               $data = array(
-                       array('userFetch', 'appFetch1', 'keyFetch1', 'value1'),
-                       array('userFetch', 'appFetch1', 'keyFetch2', 'value2'),
-                       array('userFetch', 'appFetch2', 'keyFetch3', 'value3'),
-                       array('userFetch', 'appFetch1', 'keyFetch4', 'value4'),
-                       array('userFetch', 'appFetch4', 'keyFetch1', 'value5'),
-                       array('userFetch', 'appFetch5', 'keyFetch1', 'value6'),
-                       array('userFetch2', 'appFetch', 'keyFetch1', 'value7')
-               );
+               $data = [
+                       ['userFetch', 'appFetch1', 'keyFetch1', 'value1'],
+                       ['userFetch', 'appFetch1', 'keyFetch2', 'value2'],
+                       ['userFetch', 'appFetch2', 'keyFetch3', 'value3'],
+                       ['userFetch', 'appFetch1', 'keyFetch4', 'value4'],
+                       ['userFetch', 'appFetch4', 'keyFetch1', 'value5'],
+                       ['userFetch', 'appFetch5', 'keyFetch1', 'value6'],
+                       ['userFetch2', 'appFetch', 'keyFetch1', 'value7']
+               ];
                foreach ($data as $entry) {
                        $this->connection->executeUpdate(
                                'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
@@ -267,10 +267,10 @@ class AllConfigTest extends \Test\TestCase {
                }
 
                $value = $config->getUserKeys('userFetch', 'appFetch1');
-               $this->assertEquals(array('keyFetch1', 'keyFetch2', 'keyFetch4'), $value);
+               $this->assertEquals(['keyFetch1', 'keyFetch2', 'keyFetch4'], $value);
 
                $value = $config->getUserKeys('userFetch2', 'appFetch');
-               $this->assertEquals(array('keyFetch1'), $value);
+               $this->assertEquals(['keyFetch1'], $value);
 
                // cleanup
                $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
@@ -288,15 +288,15 @@ class AllConfigTest extends \Test\TestCase {
                $config = $this->getConfig();
 
                // preparation - add something to the database
-               $data = array(
-                       array('userFetch1', 'appFetch2', 'keyFetch1', 'value1'),
-                       array('userFetch2', 'appFetch2', 'keyFetch1', 'value2'),
-                       array('userFetch3', 'appFetch2', 'keyFetch1', 3),
-                       array('userFetch4', 'appFetch2', 'keyFetch1', 'value4'),
-                       array('userFetch5', 'appFetch2', 'keyFetch1', 'value5'),
-                       array('userFetch6', 'appFetch2', 'keyFetch1', 'value6'),
-                       array('userFetch7', 'appFetch2', 'keyFetch1', 'value7')
-               );
+               $data = [
+                       ['userFetch1', 'appFetch2', 'keyFetch1', 'value1'],
+                       ['userFetch2', 'appFetch2', 'keyFetch1', 'value2'],
+                       ['userFetch3', 'appFetch2', 'keyFetch1', 3],
+                       ['userFetch4', 'appFetch2', 'keyFetch1', 'value4'],
+                       ['userFetch5', 'appFetch2', 'keyFetch1', 'value5'],
+                       ['userFetch6', 'appFetch2', 'keyFetch1', 'value6'],
+                       ['userFetch7', 'appFetch2', 'keyFetch1', 'value7']
+               ];
                foreach ($data as $entry) {
                        $this->connection->executeUpdate(
                                'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
@@ -306,20 +306,20 @@ class AllConfigTest extends \Test\TestCase {
                }
 
                $value = $config->getUserValueForUsers('appFetch2', 'keyFetch1',
-                       array('userFetch1', 'userFetch2', 'userFetch3', 'userFetch5'));
-               $this->assertEquals(array(
+                       ['userFetch1', 'userFetch2', 'userFetch3', 'userFetch5']);
+               $this->assertEquals([
                                'userFetch1' => 'value1',
                                'userFetch2' => 'value2',
                                'userFetch3' => 3,
                                'userFetch5' => 'value5'
-                       ), $value);
+                       ], $value);
 
                $value = $config->getUserValueForUsers('appFetch2', 'keyFetch1',
-                       array('userFetch1', 'userFetch4', 'userFetch9'));
-               $this->assertEquals(array(
+                       ['userFetch1', 'userFetch4', 'userFetch9']);
+               $this->assertEquals([
                        'userFetch1' => 'value1',
                        'userFetch4' => 'value4'
-               ), $value, 'userFetch9 is an non-existent user and should not be shown.');
+               ], $value, 'userFetch9 is an non-existent user and should not be shown.');
 
                // cleanup
                $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
@@ -329,15 +329,15 @@ class AllConfigTest extends \Test\TestCase {
                $config = $this->getConfig();
 
                // preparation - add something to the database
-               $data = array(
-                       array('userFetch3', 'appFetch1', 'keyFetch1', 'value1'),
-                       array('userFetch3', 'appFetch1', 'keyFetch2', 'value2'),
-                       array('userFetch3', 'appFetch2', 'keyFetch3', 'value3'),
-                       array('userFetch3', 'appFetch1', 'keyFetch4', 'value4'),
-                       array('userFetch3', 'appFetch4', 'keyFetch1', 'value5'),
-                       array('userFetch3', 'appFetch5', 'keyFetch1', 'value6'),
-                       array('userFetch4', 'appFetch2', 'keyFetch1', 'value7')
-               );
+               $data = [
+                       ['userFetch3', 'appFetch1', 'keyFetch1', 'value1'],
+                       ['userFetch3', 'appFetch1', 'keyFetch2', 'value2'],
+                       ['userFetch3', 'appFetch2', 'keyFetch3', 'value3'],
+                       ['userFetch3', 'appFetch1', 'keyFetch4', 'value4'],
+                       ['userFetch3', 'appFetch4', 'keyFetch1', 'value5'],
+                       ['userFetch3', 'appFetch5', 'keyFetch1', 'value6'],
+                       ['userFetch4', 'appFetch2', 'keyFetch1', 'value7']
+               ];
                foreach ($data as $entry) {
                        $this->connection->executeUpdate(
                                'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
@@ -363,15 +363,15 @@ class AllConfigTest extends \Test\TestCase {
                $config = $this->getConfig();
 
                // preparation - add something to the database
-               $data = array(
-                       array('userFetch5', 'appFetch1', 'keyFetch1', 'value1'),
-                       array('userFetch5', 'appFetch1', 'keyFetch2', 'value2'),
-                       array('userFetch5', 'appFetch2', 'keyFetch3', 'value3'),
-                       array('userFetch5', 'appFetch1', 'keyFetch4', 'value4'),
-                       array('userFetch5', 'appFetch4', 'keyFetch1', 'value5'),
-                       array('userFetch5', 'appFetch5', 'keyFetch1', 'value6'),
-                       array('userFetch6', 'appFetch2', 'keyFetch1', 'value7')
-               );
+               $data = [
+                       ['userFetch5', 'appFetch1', 'keyFetch1', 'value1'],
+                       ['userFetch5', 'appFetch1', 'keyFetch2', 'value2'],
+                       ['userFetch5', 'appFetch2', 'keyFetch3', 'value3'],
+                       ['userFetch5', 'appFetch1', 'keyFetch4', 'value4'],
+                       ['userFetch5', 'appFetch4', 'keyFetch1', 'value5'],
+                       ['userFetch5', 'appFetch5', 'keyFetch1', 'value6'],
+                       ['userFetch6', 'appFetch2', 'keyFetch1', 'value7']
+               ];
                foreach ($data as $entry) {
                        $this->connection->executeUpdate(
                                'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
@@ -415,14 +415,14 @@ class AllConfigTest extends \Test\TestCase {
                $config = $this->getConfig($systemConfig);
 
                // preparation - add something to the database
-               $data = array(
-                       array('user1', 'appFetch9', 'keyFetch9', 'value9'),
-                       array('user2', 'appFetch9', 'keyFetch9', 'value9'),
-                       array('user3', 'appFetch9', 'keyFetch9', 'value8'),
-                       array('user4', 'appFetch9', 'keyFetch8', 'value9'),
-                       array('user5', 'appFetch8', 'keyFetch9', 'value9'),
-                       array('user6', 'appFetch9', 'keyFetch9', 'value9'),
-               );
+               $data = [
+                       ['user1', 'appFetch9', 'keyFetch9', 'value9'],
+                       ['user2', 'appFetch9', 'keyFetch9', 'value9'],
+                       ['user3', 'appFetch9', 'keyFetch9', 'value8'],
+                       ['user4', 'appFetch9', 'keyFetch8', 'value9'],
+                       ['user5', 'appFetch8', 'keyFetch9', 'value9'],
+                       ['user6', 'appFetch9', 'keyFetch9', 'value9'],
+               ];
                foreach ($data as $entry) {
                        $this->connection->executeUpdate(
                                'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
@@ -432,7 +432,7 @@ class AllConfigTest extends \Test\TestCase {
                }
 
                $value = $config->getUsersForUserValue('appFetch9', 'keyFetch9', 'value9');
-               $this->assertEquals(array('user1', 'user2', 'user6'), $value);
+               $this->assertEquals(['user1', 'user2', 'user6'], $value);
 
                // cleanup
                $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
index 50c1e13b3f938c420421b77a0158b514883d4f97..68e4a5beaf1962dc909bf38cde940ab7fc15cde6 100644 (file)
@@ -35,7 +35,7 @@ class AppManagerTest extends TestCase {
         * @return AppConfig|MockObject
         */
        protected function getAppConfig() {
-               $appConfig = array();
+               $appConfig = [];
                $config = $this->createMock(AppConfig::class);
 
                $config->expects($this->any())
@@ -47,7 +47,7 @@ class AppManagerTest extends TestCase {
                        ->method('setValue')
                        ->willReturnCallback(function ($app, $key, $value) use (&$appConfig) {
                                if (!isset($appConfig[$app])) {
-                                       $appConfig[$app] = array();
+                                       $appConfig[$app] = [];
                                }
                                $appConfig[$app][$key] = $value;
                        });
@@ -57,7 +57,7 @@ class AppManagerTest extends TestCase {
                                if ($app) {
                                        return $appConfig[$app];
                                } else {
-                                       $values = array();
+                                       $values = [];
                                        foreach ($appConfig as $appid => $appData) {
                                                if (isset($appData[$key])) {
                                                        $values[$appid] = $appData[$key];
@@ -346,7 +346,7 @@ class AppManagerTest extends TestCase {
                $this->groupManager->expects($this->once())
                        ->method('getUserGroupIds')
                        ->with($user)
-                       ->willReturn(array('foo', 'bar'));
+                       ->willReturn(['foo', 'bar']);
 
                $this->appConfig->setValue('test', 'enabled', '["foo"]');
                $this->assertTrue($this->manager->isEnabledForUser('test', $user));
@@ -357,7 +357,7 @@ class AppManagerTest extends TestCase {
                $this->groupManager->expects($this->once())
                        ->method('getUserGroupIds')
                        ->with($user)
-                       ->willReturn(array('bar'));
+                       ->willReturn(['bar']);
 
                $this->appConfig->setValue('test', 'enabled', '["foo"]');
                $this->assertFalse($this->manager->isEnabledForUser('test', $user));
@@ -377,7 +377,7 @@ class AppManagerTest extends TestCase {
                $this->groupManager->expects($this->once())
                        ->method('getUserGroupIds')
                        ->with($user)
-                       ->willReturn(array('foo', 'bar'));
+                       ->willReturn(['foo', 'bar']);
 
                $this->appConfig->setValue('test', 'enabled', '["foo"]');
                $this->assertTrue($this->manager->isEnabledForUser('test'));
@@ -410,7 +410,7 @@ class AppManagerTest extends TestCase {
                $this->groupManager->expects($this->any())
                        ->method('getUserGroupIds')
                        ->with($user)
-                       ->willReturn(array('foo', 'bar'));
+                       ->willReturn(['foo', 'bar']);
 
                $this->appConfig->setValue('test1', 'enabled', 'yes');
                $this->appConfig->setValue('test2', 'enabled', 'no');
index 30d1fec6c9e9cefe700af63e962f53055c3f9b17..f18c24f2f610a52b877a549937572112436031ad 100644 (file)
@@ -57,16 +57,16 @@ class AppFetcherTest extends TestCase  {
        static $responseJson =  <<<'EOD'
 [{"id":"direct_menu","categories":["customization"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/juliushaertl/direct_menu/issues","website":"","created":"2016-10-01T09:16:06.030994Z","lastModified":"2016-10-06T14:01:05.584192Z","releases":[{"version":"0.9.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/juliushaertl/direct_menu/releases/download/v0.9.2/direct_menu.tar.gz","created":"2016-10-06T14:01:05.578297Z","licenses":["agpl"],"lastModified":"2016-10-06T14:01:05.643813Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"ERBS9G5bZ3vwCizz2Ht5DehsVJmb63bzF3aYcH7xjbDVMPagOFWdUAiLDwTeZR1n\ni4gdZ73J/IjHQQJoOPwtCjgbZgLPFqL5x13CLUO9mb/33dZe/+gqEDc/3AuJ4TlA\nXUdLxHRb1bwIlJOwuSr/E24452VG20WUhLXBoM0Zm7WcMxvJWo2zAWnuqnLX3dy9\ncPB4PX+6JU2lUMINj8OYQmM1QnqvjG8YV0cYHbBbnSicOGwXEnni7mojsC8T0cn7\nYEJ2O2iO9hh3fvFEXUzDcL7tDQ5bZqm63Oa991bsAJxFo/RbzeJRh//DcOrd8Ufn\nu2SqRhwybS8j4YvfjAL9RPdRfPLwf6X2gx/Y6QFrKHH0QMI/9J/ZFyoUQcqKbsHV\n85O+yuWoqVmza71tkp4n9PuMdprCinaVvHbHbNGUf2SIh9BWuEQuVvvnvB+ZW8XY\n+Cl+unzk3WgOgT0iY3uEmsQcrLIo4DSKhcNgD1NS13fR/JTSavvmOqBarUMFZfVC\nbkR1DTBCyDjdpNBidpa3/26675dz5IT5Zedp4BBBREQzX08cIhJx5mgqDdX3CU09\nuWtzoaLi71/1BWTFAN+Y9VyfZ8/Z3Pg3vKedRJ565mztIj0geL3riEsC5YnPS0+C\n+a3B9sDiiOa101EORzX3lrPqL7reEPdCxrIwN+hKFBQ=","translations":{}}],"screenshots":[{"url":"https://bitgrid.net/~jus/direct_menu_nc.png"}],"translations":{"en":{"name":"Direct Menu","summary":"Provide easy access to all apps in the header.","description":"Provide easy access to all apps in the header."}},"isFeatured":false,"authors":[{"name":"Julius Härtl","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEBjCCAu4CAhADMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE0MTI1MDU0WhcNMjYxMjIxMTI1MDU0WjAWMRQwEgYD\r\nVQQDDAtkaXJlY3RfbWVudTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB\r\nAMkzWsAkKP/40ktvJMpnr0IJNVoPOR0hvh24igcDskL1WKiD2eiRUenj5LE0Nvn+\r\nsiGmWsAqRVpdiz+Y8ghQqQMzKi43IrRN0AxlCrHWrSqBZT3wIAUcFz4RzEoFxc1N\r\nUZzWma6ljukGnvt4V1ZyT+H/cjqxUkBhh/y9SS0jUen1a1grND6Rw54X46V2dlCu\r\nFH+pLsfPJJGw+QLeTGHn7dqdv18cYMAlWDCzPixVnNiCXHZcUtKMmstU2xU4R2e6\r\nzimp2rgkE4TNHrafpjH8xGdNi2FG5Dmokob/L5Q2r8jyNaW7UsFfrvLTRj371b3/\r\n2FhhxoGUvDzaG2An02Exwm52LJfdTVMHAMPZub5poHfy5vAEdZGPQ/m02l8ZK/Y2\r\n7yT807GlfPMXfdfjCxR6wNtmv7rvBDdrUZmIRNJfpFSdvlH/+MOTWnabyfQv2K4Q\r\nBIwltX6Elh0lh4ntvt1ZVtvFv+PL1Dc7QLV+w19+/LJA0mnsh7GIFYKFlbA65gA0\r\nc/w+uqDy0+5MxkR9WGPpd79KRA1tKWTis4Ny1lApK5y3zIsVGa3DfBHXcwqkWHbV\r\nwIpyuyyDsFtC1b9LTFONX7iU9cbNk5C5GTM331MdA2kLcD/D5k42GNTBSca7MkPx\r\nFx/ETSn0Ct167el30symf2AxvXjw+mBYPN71rVTMDwe9AgMBAAEwDQYJKoZIhvcN\r\nAQELBQADggEBAC0fJKnbEhXA8M283jA9GxABxLyTBcQyVVNnz2L/bYYNi81Y9iZv\r\n+U0S3qaIfoqNcV9FTKAutbsKvWyolnI7MRRK6feNuFfoP2jKubM1CnawpyT/RF2Q\r\ne/zxnB1EmeI2X5D2xceJDLB7Fy5W0EGrLixRIdFaSUommWFUm9E2hSIaNlziSBdc\r\n1J/mOQeNYO5zg5ouEt1rzQW4Mhh1I2uNQmGe4ip+Jl/2LAv3FZuu4NrSEcoXH3ro\r\nG2dF9Gtu4GiQ5fuaJknaxlgXHovfqeZwZJX9o4M+Ug81AqiY7XjdiaCPdh0Tthcx\r\n2OmWZo7UBREWenjKyFZZ/iKoqH5sdenBtpo=\r\n-----END CERTIFICATE-----"},{"id":"apporder","categories":["customization"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/juliushaertl/apporder/issues","website":"","created":"2016-10-01T09:16:47.111889Z","lastModified":"2016-10-12T19:50:16.038821Z","releases":[{"version":"0.3.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/juliushaertl/apporder/releases/download/0.3.3/apporder.tar.gz","created":"2016-10-12T19:14:10.802359Z","licenses":["agpl"],"lastModified":"2016-10-12T19:50:16.104357Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"nhlT9lhrmBxIsqh/e3RLm2NDw/U8ZvvoMyYQTLMM3H19DQmVcPYPYC9QWVTsowUzXblVaOXVGylbpKma9yOlOAqJtF3qyXecLl4+tA/Awb6BBhKPgHFdcLDAL5yy1K7/uei3SgEojMlJoI9vEK5I1C5YTh43yNH+//Im6MAuNYFUTlMXK426zdOe6ogpCI5GlYdXopqYANxcpT+WXWET6DDSM5Ev+MYwMcSAY4r8+tvARRU4ZAenRgjkBT6R5z6cD76emRax14tbV6vkjjwRcO+dQtM0tFPbd+5fsNInbauv50VzIMgjA6RnKTOI17gRsSdGlsV4vZn2aIxEPWauu6T/UohMvAE9HMn13vtbpPBSFwJAktj6yHASYGzupNQLprA0+OdyALoLZPpQAKNEXA42a4EVISBKu0EmduHJlUPeqhnIGkkGgVNWS8AWqzP2nFoPdXBgUWateiMcBTHxgEKDac5YmNc9lsXpzf1OxBaXHBhGYKuXPwIfyH3jTWb1OdwixJEuRe9dl63T9qOTRre8QWns/bMqKLibGfMtFhVB21ARJayBuX70eVvabG/2N7Y5t1zUlFygIKu51tvo3AVCRDdRrFWDvkAjxzIz5FIdALVZ+DReFYu/r4WF/w3V9rInFuEDSwb/OH4r8sQycs07tSlMyA74Y3FpjKTBxso=","translations":{}},{"version":"0.3.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/juliushaertl/apporder/releases/download/0.3.2/apporder.tar.gz","created":"2016-10-06T14:00:51.532409Z","licenses":["agpl"],"lastModified":"2016-10-06T14:00:51.598455Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"gRVFOtj9414ZNSdRH/qNB2SwVZUQh+gaFnNLFjjXjJ1MdRMCISzvwb+QU1qYuK/y\nuL8K0pn1+fFQf8A3VsC2pb6yaLQ5U9C3Guf886Flf4qtYw1P8UWRA9yOJ+6Md+PH\n6pTEiDIdm4xbmM0KkBhsE5kL8dvLIq4EwwcAh2Qq8fjytzAk1YiP+KrTaYrVwskM\nDmm0lgP4NVnjRBTX9myW6tr6N3w0tq2jJ/+a/vEDJv+5ozKJx8N5gbJNdrtI4k7I\nyaQNWJ7cngtAHmUREeoBggV5uJayDceu83PPQR6N9/WVyNyZjw1Q8/Q6e/NyiXT2\no8mGv5tHl3DBOVuv8v7gBQgDh6ppp12M81aiCZymn2XIgjw50VQ+K15KHnLHuFFw\nwuHZVcoQ7b6oR4K4TURSfPFUeNgGS4R9v6gjg1RUcSm1Pnryc6pYnh10AUY8dk6q\n1CZ6Upt6SScP2ZEGWsFwVjjQhY/ZJmNfnhaGoFOZ5L9CnzyNCkGXFg0rL36i6djb\naqFy/z+Brnklng5ct6XWoP7uDt5BaHznQj1NHSfHn0GUQ0N968zWm9vQvy+dyXyC\nxR7vKeu2ppZ2ydoeQ9CVwfhOEsGs5OvrpapQdh9KbUHcX7b7ql01J7/P6dFuNuHe\n+7/y4ex3sEVg5YBmDtF8iZ6d7zsHd6peL1s1EsLnenQ=","translations":{}}],"screenshots":[{"url":"https://bitgrid.net/~jus/apporder-nc.gif"}],"translations":{"en":{"name":"AppOrder","summary":"Sort apps in the menu with drag and drop","description":"\nEnable sorting for icons inside the app menu. The order will be saved for each\nuser individually. Administrators can define a custom default order.\nAppOrder works with the default owncloud menu as well as with the direct_menu\napp.\n\n## Set a default order for all new users\n\nGo to the Admin settings > Additional settings and drag the icons under App order.\n\n## Use first app as default app\n\nYou can easily let Nextcloud redirect your user to the first app in their\npersonal order by changing the following parameter in your config/config.php:\n\n'defaultapp' => 'apporder',\n\nUsers will now get redirected to the first app of the default order or to the\nfirst app of the user order.\n    "}},"isFeatured":false,"authors":[{"name":"Julius Härtl","mail":"jus@bitgrid.net","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhAEMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE0MTI1MjQ4WhcNMjYxMjIxMTI1MjQ4WjATMREwDwYD\r\nVQQDDAhhcHBvcmRlcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKVK\r\nKn5jivCu+eRfe5BECjDOzNaGHlpiegb49Hf4nh0W7DqcoLHip5c1O2BcEYdH6rkw\r\n20WclvjoQpgavG5aFXzXzur6eKTT5TpgY5oZTLoWjbx4e+fKdhyDPTpqNZzs1pxz\r\nsZLDL/ElpbSErE0s+QK/pzP11WNPylAkI9AKSyDMO3Mbllg8I8Bt+bT7LJKYOO/T\r\nLhv9m0anLZ4HrdfimhVIoMiu3RpyRigk8titXZA94+F8Fbf7ZQ9f14Y/v3+rfJFQ\r\nii9cDoox5uUrjplH2LrMr5BodfCfydLu4uVpPWYkdccgvcZ1sugjvNXyCQgdzQDK\r\npOpiwVkkiQFaQJYbGSDblFWPl/cLtA/P/qS7s8tWyTQuc1rYlEpCHG/fG8ZFkSVK\r\n9eCMGxK908VB4IU2DHZHOHi7JvtOz8X/Ak6pIIFdARoW3rfKlrz6DD4T9jEgYq0n\r\nRe7YwCKEIU3liZJ+qG6LCa+rMlp/7sCzAmqBhaaaJyX4nnZCa2Q2cNZpItEAdwVc\r\nqxLYL1FiNFMSeeYhzJJoq5iMC3vp2LScUJJNoXZj9zv+uqTNGHr+bimchR2rHUBo\r\nPzDLFJmat03KdWcMYxcK5mxJNGHpgyqM7gySlbppY/cgAospE8/ygU2FlFWIC9N0\r\neDaY+T8QA1msnzsfMhYuOI8CRYigan1agGOMDgGxAgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBAGsECd+meXHg1rr8Wb6qrkDz/uxkY1J+pa5WxnkVcB6QrF3+HDtLMvYm\r\nTTS02ffLLyATNTOALZFSy4fh4At4SrNzl8dUaapgqk1T8f+y1FhfpZrEBsarrq+2\r\nCSKtBro2jcnxzI3BvHdQcx4RAGo8sUzaqKBmsy+JmAqpCSk8f1zHR94x4Akp7n44\r\n8Ha7u1GcHMPzSeScRMGJX/x06B45cLVGHH5GF2Bu/8JaCSEAsgETCMkc/XFMYrRd\r\nTu+WGOL2Ee5U4k4XFdzeSLODWby08iU+Gx3bXTR6WIvXCYeIVsCPKK/luvfGkiSR\r\nCpW1GUIA1cyulT4uyHf9g6BMdYVOsFQ=\r\n-----END CERTIFICATE-----"},{"id":"twofactor_totp","categories":["tools"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"","website":"","created":"2016-10-08T14:13:54.356716Z","lastModified":"2016-10-12T14:38:56.186269Z","releases":[{"version":"0.4.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0 <7.1.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/ChristophWurst/twofactor_totp/releases/download/0.4.1/twofactor_totp.tar.gz","created":"2016-10-12T14:38:56.174612Z","licenses":["agpl"],"lastModified":"2016-10-12T14:38:56.248223Z","isNightly":false,"rawPhpVersionSpec":">=5.4 <=7.0","rawPlatformVersionSpec":">=10 <=11","signature":"bnwWxmHEn8xkoWbtwhC1kIrJ0dQfAI3PUtU62k+Tru/BHt1G2aVxqO8bCdghojZ7\nzdFMlIJw4kekYFsVfLk8jzjUTZKVbNVKCdkHrVTQ0bUUryMAMLqGQ3PSRI5NX6D5\nFpkvwO1coYwU0XVWF8KAS0meX0ztSkT3Mv96LLrxr8F8SrB/MGmKIE4WTjt1fAIa\nZLAVEUo/3sNFTGLYBtL3wjctrkZvJltP8abeRfls9FkRHu+rN7R3uLFzk42uZn3X\nWpt5BBmlYm5ORbnJ2ApsxEkMNK+rOy8GIePaz5277ozTNrOnO04id1FXnS9mIsKD\n20nRzjekZH+nneQYoCTfnEFg2QXpW+a+zINbqCD5hivEU8utdpDAHFpNjIJdjXcS\n8MiCA/yvtwRnfqJ5Fy9BxJ6Gt05/GPUqT8DS7P1I1N+qxhsvFEdxhrm2yIOhif8o\nh7ro5ls+d3OQ8i3i4vdZm821Ytxdu/DQBHiVoOBarvFWwWAv2zd2VAvpTmk6J5yv\n3y+csRqpEJYd9fcVMPsTu7WBRRrpBsAqdAHJcZEwak2kz1kdOgSf8FIzP1z6Q71d\nMl2RKcPeutMHHSLiGIN/h7fM5aSs49wGgGZmfz28fHVd7/U0HFSMYmkT/GMq5tMP\nIyc+QZAN4qbX8G0k/QSTkK/L4lOT2hQiQqiSqmWItMk=","translations":{}}],"screenshots":[],"translations":{"en":{"name":"Two Factor TOTP Provider","summary":"A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)","description":"A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)"}},"isFeatured":true,"authors":[{"name":"Christoph Wurst","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIECTCCAvECAhASMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYxMDEyMDkzNDMxWhcNMjcwMTE4MDkzNDMxWjAZMRcwFQYD\r\nVQQDDA50d29mYWN0b3JfdG90cDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC\r\nggIBALC1K94104L/nOtmTygx7QNjUcnHs3yrn71mw4pMxTlonXOnMTpwxsfL1Hhu\r\n/5GMSgupTbQPlevSl6J86UMs455/sPShd6ifmAuhb8VFaAsjpizjs0RMaUg1sjmF\r\nuV18PD9FXLourx51V/c4MG5kpavlV+bLUrVMAjbsJY2+k30tCC/XkP5u8jUWmM/T\r\n5REChn7/obPgaeddhuJoILYhKEW3VNrR8Fm9SYiviB3FLhM7URDZ97IBnXYqbvbT\r\nZnvq+E74Zc7HgYwQwrjU/AqQAInhNpAR4ZM6CkWWWWaL96O1q3lCfKJNaxqC0Kg/\r\nkGn/pxYkl9062jtMUz60s9OPDyuisfyl68UyM68Ozyz4SMRLmDVbewOqQAwmAbtz\r\n8p9AQrX3Pr9tXhARR4pDSsQz1z+8ExEd6EKbhMyiTtHtZQ1Vm9qfoR52snpznb5N\r\ne4TcT2qHAkOWV9+a9ESXmQz2bNjgThxEl5edTVY9m4t248lK5aBTGq5ZKGULNHSQ\r\nGGpr/ftMFpII45tSvadexUvzcR/BHt3QwBAlPmA4rWtjmOMuJGDGk+mKw4pUgtT8\r\nKvUMPQpnrbXSjKctxb3V5Ppg0UGntlSG71aVdxY1raLvKSmYeoMxUTnNeS6UYAF6\r\nI3FiuPnrjVFsZa2gwZfG8NmUPVPdv1O/IvLbToXvyieo8MbZAgMBAAEwDQYJKoZI\r\nhvcNAQELBQADggEBAEb6ajdng0bnNRuqL/GbmDC2hyy3exqPoZB/P5u0nZZzDZ18\r\nLFgiWr8DOYvS+9i6kdwWscMwNJsLEUQ2rdrAi+fGr6dlazn3sCCXrskLURKn5qCU\r\nfIFZbr2bGjSg93JGnvNorfsdJkwpFW2Z9gOwMwa9tAzSkR9CsSdOeYrmdtBdodAR\r\ndIu2MkhxAZk9FZfnFkjTaAXcBHafJce7H/IEjHDEoIkFp5KnAQLHsJb4n8JeXmi9\r\nVMgQ6yUWNuzOQMZpMIV7RMOUZHvxiX/ZWUFzXNYX0GYub6p4O2uh3LJE+xXyDf77\r\nRBO7PLY3m4TXCeKesxZlkoGke+lnq7B8tkADdPI=\r\n-----END CERTIFICATE-----"},{"id":"contacts","categories":["office","organization","social"],"userDocs":"https://docs.nextcloud.com/server/11/user_manual/pim/contacts.html","adminDocs":"https://docs.nextcloud.com/server/11/admin_manual/configuration_server/occ_command.html?highlight=occ%20commands#dav-label","developerDocs":"https://github.com/nextcloud/contacts#building-the-app","issueTracker":"https://github.com/nextcloud/contacts/issues","website":"https://github.com/nextcloud/contacts#readme","created":"2016-10-30T14:00:58.922766Z","lastModified":"2016-11-22T22:08:01.904319Z","releases":[{"version":"1.5.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/contacts/releases/download/v1.5.0/contacts.tar.gz","created":"2016-11-22T22:08:01.861942Z","licenses":["agpl"],"lastModified":"2016-11-22T22:08:02.306939Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"ZqqhqtbHcNB+rzGCQ7FDIjjvHjit+dhAE1UhFgiXApkx3tmPP4nJOBAGNjHe+2Ao\nVcTIX2SrWEfieRrA4Gp+0k7pUPWag1Z0T1OVOwO4cmS1AVFyGIOE1bRvDhMfsWTU\n4CI4oXaKBFAY6mtnf7VJ7EeIdNqhImkohyWDQ88NiPRLM1XNkJJk6AvZBcT0fvCv\no145X4dLpbixSXsN99QFNJ/oXvK+9tBGwTd5i/WnNFY90vcNRLia8aRo7SA0YJRx\nLnxnj2HMqwTTDQEKE+1elYKWsqQ2DeqwScP97UIKe5bZXnrwOi9kH9PDmR4abtzd\nlHL8E1Wgw25ePDeHG7APrx0tVOJy1bP+g8vcarpGynWZoizDkBvYZD+xtxizpBXC\nJsDOSzczApptY6dnOtv0Vat8oh/Z/F99gBUahEu4WZ16ZgR1nj40PDK1Snl18Cgk\nMe1EZcde8SLEpTbCWYIfIw/O9Fkp5cWD/dAqoiO6g+gNxSZ/gGp57qoGfFxn7d/x\nH3aH8GljatAFjrwItw1JzR0THt0ukkOK+bw/pfCslk10sjHMitmz/GXa4qMS91DZ\nBKLUd0dSfQUQzkfwcojImbzJRvca4/DYe3mfG7+RCH0tDL6t72dKL9joB++u5R1u\nVZPgkToexlXcKWpiDB8H2/SEShKr4udAOjR5de9CYWM=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Contacts/contacts.png"}],"translations":{"en":{"name":"Contacts","summary":"The new and improved app for your Contacts.","description":"The new and improved app for your Contacts."}},"isFeatured":true,"authors":[{"name":"Alexander Weidinger","mail":"","homepage":""},{"name":"Jan-Christoph Borchardt","mail":"","homepage":""},{"name":"Hendrik Leppelsack","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhATMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYxMDEyMjAzNzIyWhcNMjcwMTE4MjAzNzIyWjATMREwDwYD\r\nVQQDDAhjb250YWN0czCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANzx\r\n/zJF+5/s4lOJLWIlfKQgTy+UpvIpiUXCgrsHsDZTx+hjQAhIWukH88a+7NVAL7Ys\r\nkQNC0Tlm755FJi/T6EdR7edOwIRdo2ZwakOWLZXd209+6cCd2UloHL0bgnbWepTl\r\nR/4YgbLg/G+FVKCfkEiYc3PuDZ3EVrcwQFcg7h74X9ne6CHH0Z1WQLydxJuVEb2n\r\nX9I+nIRpPHcVostkSiUmzHR7C5TjTIo2PzzgnCU6GC0iBa6z6dDYfz24QEp/b8UA\r\nZaLhjkyKghVGMnoF/s9KPgH4NM8pvvtadQN8pxlOPju4wbmKPUrsXo4ujurDXbbc\r\nYkzNt8ojobGwdTXoyDogAsGZLQd2FQksWpRvY+I3zVPokBfPMdUPLllG5VcV0VA5\r\nDRK+h2ms+XmspdBvGonjF+XdbFm9hEmDoFmoi9aU6C6AdofjmG/e9+pw/20dXUWk\r\nmMorWwXQ5yLmIn5LnpRXrOuK7CS28VRhBYuVNMlsyKhzU0rophbsD9OFXxYLjr6s\r\n7UPNwZ5h+kjXZDBKD89QctBSViT8RhLe8nulRIm0iJn1sb9hca/CF63KmsFzENfK\r\nQeM6MO0H34PB84iNyz5AX1OIy+1wHD4Wrzt9O/i2LkWK6tBhL69aZiBqdLXWKffj\r\nARDCxxIfews51EZFyHzwsw65I97y46aBKxY382q7AgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBACLypX0spxAVAwQIS9dlC9bh1X/XdW2nAvSju2taUTBzbp074SnW6niI\r\nbnY4ihYs4yOuGvzXxnp/OlvWH7qhOIchJUq/XPcEFMa7P03XjVpcNnD3k0zQWlZb\r\ntGonX9EUOeLZKdqI4fkrCkMLScfjgJzoHGYQrm8vlIg0IVuRLCKd5+x4bS7KagbG\r\niuPit2pjkw3nWz0JRHneRXz/BNoAWBnJiV7JMF2xwBAHN4ghTM8NSJzrGTurmpMI\r\nGld7yCP47xNPaAZEC66odcClvNtJ2Clgp8739jD6uJJCqcKDejeef0VU1PG7AXId\r\n52bVrGMxJwOuL1393vKxGH0PHDzcB1M=\r\n-----END CERTIFICATE-----"},{"id":"mail","categories":["tools"],"userDocs":"","adminDocs":"https://github.com/nextcloud/mail#readme","developerDocs":"","issueTracker":"","website":"","created":"2016-10-19T19:41:41.710285Z","lastModified":"2016-10-19T19:57:33.689238Z","releases":[{"version":"0.6.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0 <7.1.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/mail/releases/download/v0.6.0/mail.tar.gz","created":"2016-10-19T19:57:33.676730Z","licenses":["agpl"],"lastModified":"2016-10-19T19:57:33.834580Z","isNightly":false,"rawPhpVersionSpec":">=5.4 <=7.0","rawPlatformVersionSpec":">=10 <=11","signature":"VbMsvDpt+gSPeFM8LrZXEK10rk8kkLlgCcblgqNdCSeGZeVpwDAYv3CccVSLa0+l\nlTSqQ0VIoH+OIU6vIQNBKHmSCzTplk7OrY0+L5FajXx8LnBaOh892GfGSlEt1neN\nKyM0i0uOjO/xpCP/NoUlgkz6hnmYY5XEdN6DTsJtJ/XZhDQ45IYuIkMkHE/eFehS\n0JnOagIz+PSipeBY2Ry+tV8YbRa7bC1JAvZzlod0dyI015AHZESeitRUY+MwMWkt\nN/me7g7/Kev0wggIQQZm9aYcw63GMk/1VHUPB7Y0ESW9tx2nR5+KwTDn/Jy4DGf1\nrg8h0t5I+aPhHOBLrpczH0qaZWY2lsVZWq8KWjJI9aR9P0v2f2aXixXzD/Cuz1cK\nhvhKWkOSla4D+/FxeyHGjQvdXMG8gXm0ZmTimKChCoVuCbncDd8pzkdyNoGXcvuk\nsP8OrkQFooL4E7S4BWfdSiN/a8jUITJQkuXp/OVrVGeCupLWJh7qegUw6DvoqyGy\nD4c6b+qYn68kx3CLaPPiz+tFAZQZQdj7+Kx/lohso8yTnVSiGYrMj4IvvCbpsQjg\nWF3WSqF/K/tTnPYTWb9NUPSihTbVNv6AXOfTsPEp/ba2YSS5DjvjVjkr5vhR9eg1\nikQ3Cw6lW3vaA4LVCC+hFkMRnI4N0bo5qQavP3PnZPc=","translations":{"en":{"changelog":"### Added\n- Alias support\n  [#1523](https://github.com/owncloud/mail/pull/1523) @tahaalibra\n- New incoming messages are prefetched\n  [#1631](https://github.com/owncloud/mail/pull/1631) @ChristophWurst\n- Custom app folder support\n  [#1627](https://github.com/owncloud/mail/pull/1627) @juliushaertl\n- Improved search\n  [#1609](https://github.com/owncloud/mail/pull/1609) @ChristophWurst\n- Scroll to refresh\n  [#1595](https://github.com/owncloud/mail/pull/1593) @ChristophWurst\n- Shortcuts to star and mark messages as unread\n  [#1590](https://github.com/owncloud/mail/pull/1590) @ChristophWurst\n- Shortcuts to select previous/next messsage\n  [#1557](https://github.com/owncloud/mail/pull/1557) @ChristophWurst\n\n## Changed\n- Minimum server is Nextcloud 10/ownCloud 9.1\n  [#84](https://github.com/nextcloud/mail/pull/84) @ChristophWurst\n- Use session storage instead of local storage for client-side cache\n  [#1612](https://github.com/owncloud/mail/pull/1612) @ChristophWurst\n- When deleting the current message, the next one is selected immediatelly\n  [#1585](https://github.com/owncloud/mail/pull/1585) @ChristophWurst\n\n## Fixed\n- Client error while composing a new message\n  [#1609](https://github.com/owncloud/mail/pull/1609) @ChristophWurst\n- Delay app start until page has finished loading\n  [#1634](https://github.com/owncloud/mail/pull/1634) @ChristophWurst\n- Auto-redirection of HTML mail links\n  [#1603](https://github.com/owncloud/mail/pull/1603) @ChristophWurst\n- Update folder counters when reading/deleting messages\n  [#1585](https://github.com/owncloud/mail/pull/1585)"}}}],"screenshots":[],"translations":{"en":{"name":"Mail","summary":"Easy to use email client which connects to your mail server via IMAP and SMTP.","description":"Easy to use email client which connects to your mail server via IMAP and SMTP."}},"isFeatured":false,"authors":[{"name":"Christoph Wurst, Thomas Müller, Jan-Christoph Borchardt, Steffen Lindner & many more …","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIID/zCCAucCAhAVMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDE5MTkzMDM0WhcNMjcwMTI1MTkzMDM0WjAPMQ0wCwYD\nVQQDDARtYWlsMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp++RuliQ\nlBeeiPtP0ecBn00OaU1UCpft/NVI5pnSiT9nU4l2kc5IvKjA8UxDB3gWfYTOeBFh\ntUHQ2P6UKCmHZT9sApHhqLu2n0V+YhlFIViuaxndSID/M414cl56xOYQusV3Pcae\no2dOSeRRzLab3tEaVHlkBSFkGmAwPZItsmTklvV3h1sUysDicYgfXPCkf7K+JgWA\nBP7vsWC8B7MDRhcB3enYv5tTcpsyvtGX7bb1oTIWVypcmKsGYfTX12VNBxKzNBIG\n8pwdb8Xo0o14TytWsWN7mSHf1XbwfwYMjDWOlMqiRc+mcoKMBH41TfM/CXslSivI\nsyvxasEaFdlj8lmKPENdzw1OfYRs43usIf4szwyt4rb8ocXfDipnY3P2hccN6YcZ\nl8y8Vsr69ASluDj2A2Pl5vH6xp6tNybZRnN5G6sghhaYaLNDU/TdMyYzz4AY33Ra\nHSaMypfcXjd76Aj8jZvcwk1BH+ZsvFqNK7ZKCb7WVcMH8KRcU1sxZ4rp9vviM2fL\nL7EVtznm3bSI9jjHXbiwq7RvNRRy+F6YRpAdWGwTU8uUkDabPFi41FikYyzNWauK\nJhlDJXl514XjKyMVBjAZYVr5gZZkO1J7C4XzLFbC5UzYNSzW5Iwx/1j5OeYJRxh6\n5rhiUwR+COT1wdVsl6khMC8MfBR4unSd338CAwEAATANBgkqhkiG9w0BAQsFAAOC\nAQEATBvpqz75PUOFPy7Tsj9bJPaKOlvBSklHH7s43fDDmQbJwswXarZi3gNdKf8D\nyO/ACZvO8ANWAWL/WahkOyQtKOYzffaABGcEIP7636jzBdKtgwSGzW3fMwDghG10\nqBr2dE6ruOEdSpuZxgMgh2EulgknZUXaHAMI2HjjtAMOBScLQVjOgUqiOHmICrXy\nZETmzhx0BXDt5enJYs8R2KMYJNIme1easQRYmWKliXogNY09W7ifT9FHtVW1HX+K\nxRS4JXbapjolkxyGSpP+iYSgItVnYzl6o9KZResR4yDsBv7G/8fpV4GQU9IS3zLD\nPiZOosVHWJdpUKCw9V4P1prGTQ==\n-----END CERTIFICATE-----"},{"id":"audioplayer","categories":["multimedia"],"userDocs":"https://github.com/rello/audioplayer/wiki#user-documentation","adminDocs":"https://github.com/rello/audioplayer/wiki#admin-documentation","developerDocs":"","issueTracker":"https://github.com/rello/audioplayer/issues","website":"https://github.com/rello/audioplayer","created":"2016-09-16T05:44:24.857567Z","lastModified":"2016-11-17T22:34:34.637028Z","releases":[{"version":"1.3.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/Rello/audioplayer/releases/download/1.3.1/audioplayer-1.3.1.tar.gz","created":"2016-11-17T22:34:34.215350Z","licenses":["agpl"],"lastModified":"2016-11-17T22:34:34.867778Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=9 <=11","signature":"p6Zz0IEFrxvw6y/3jHgGWWCxR6qpMzvU2HKfxcIVsK6sJnoRUhWLeAXwZ432fH2a S2llj+IGS9OvW+5VQElrXgPtEjDK1BT00DRJnp5RFCRlUv0LNoedJMzx6B6AHqPP JBufk3cG1O/CO0M0L1ITGSmSOzfKvWTRo3lxVGF792NyBaP/SyZCkH1N1TzBQzUi Ywl3+HiglPcXbHjtJm/arnKorbJWVKoaN93xFuaBapd2ozQSpi0fE0uGRsici+U7 HNa1M5WFE1rzUJoufE0E9246At07rFY1e+TdNEq8IlLgCXg5vGCKkEyuWpWno6aX LfRaIiT9x39UTAwNvuDKS0c+n4uWDYPsGfKhDx9N7CXpUrthfXVEWRzZEXG7as10 6ANvrRPJemSZH8FUSrdJhD7k12qa9R825y7mIG68Li8P71V92EOxFfo9tNXqXwBt VuDGxBqByFVPqSCj5I8hrzJzQl2Xt40g8+8ZcSF96RMg/pM+bwRMTv+mz0V+vQQ4 DWjqnWVPalaJ1PPD5/QFFErtXuNRbyxKZ6BMWxfJlLM9Kz66P75K+8fYaSwz+2KG NxY7I3svzS2K9LGH3fBLUy1t3Hl+c3zGFq/ll1MJrf9NswV4yxt2WmISfM/KDww8 yELkGs2cRzbw2tCvnmYlJJhIqRLkyFAbDzWRH/XdVx4=","translations":{"en":{"changelog":"2016-11-17\n- fix: one-click-play for wav not working\n- fix: wrong sql statement for PostgreSQL [#90](https://github.com/rello/audioplayer/issues/90)"}}},{"version":"1.3.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/Rello/audioplayer/releases/download/1.3.0/audioplayer-1.3.0.tar.gz","created":"2016-11-15T18:11:19.539636Z","licenses":["agpl"],"lastModified":"2016-11-15T18:11:19.592881Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=9 <=11","signature":"lbp7wd3JhMHW5mC8kVnQFvcwzf3aTIhYhq3ak/C/vfDXJDIPFuQ1odVRWtaHXEKQ XmKYIoTobV1TAU5q9G0O0Kds73T/XtHG4ATLxMZE8RsUWNSj5v3H4YDub6A0uoX6 rzyLEYV6SGEtdPFMwLcUjDExKpzAzKpgxcd9uyz2NhcHJEO8FJmirn34bm69//TO vjjiMW4zpL+dho+7LQbOX+L1SmwmdBqwypE9zzeuIuhUWDEQtImHAvjIO6Temajm lX0H5JaowJa8kvP6Jkh3KAvsHQ4sJklvWTPGcv0gboN+o6CmjWNOb+3LeSH0nhe6 BmiPloUDJcPQwq2gQejH2pY+qJEdRcULSKS09/dRbE3gOSlG36FThN0INpv6uNP4 qVIiYs3/SEHMmlS5CHvJDt2S2XN9LT9IX7QPeuS/0CMcuopaG/+cdC4KscVCq4D4 bllgew9asiBqix8iV8C4oerYOiC5vWcgBrZhGShoJT1Qq+NKz+H10dFgjFCAZuPj nVagJkbXmf2NdcvpSC7qsufhyEZyCSp+I7QEYsbo1PW3aUU35Syt47lgeVFX0hVQ jC1wMIhEW5Rm2nCkRSZkRupKDQ+N6uWuB0lykeMV2ShcDvvUZrhN3c49sooWgigB yIqKryzM4fLErjjNHdYgwCq6bbgPDLK3ic9b3B4rF3E=","translations":{"en":{"changelog":"2016-11-15\n- fix: handling of temporary scanner files [#68](https://github.com/rello/audioplayer/issues/68)\n- fix: simpler analysis of incorrect files in scanner [#57](https://github.com/rello/audioplayer/issues/57)\n- fix: album sorted correctly by artist and album [#80](https://github.com/rello/audioplayer/issues/80)\n- fix: neutral cover for unknown album [#16](https://github.com/rello/audioplayer/issues/16)\n- fix: error message from ID3 editor shown in front-end [#77](https://github.com/rello/audioplayer/issues/77)\n- enhancement: occ support for library scan and reset [#72](https://github.com/rello/audioplayer/issues/72)\n- enhancement: select a dedicated folder for scanning in personal settings [#79](https://github.com/rello/audioplayer/issues/79)\n- enhancement: exclude folders from scanning via .noaudio file [#79](https://github.com/rello/audioplayer/issues/79)\n- enhancement: significantly reduce database reads during scanning [#79](https://github.com/rello/audioplayer/issues/79)\n- enhancement: cleanup of classes; move from \\OC\\Files\\View to \\OCP\\Files\\IRootFolder [#72](https://github.com/rello/audioplayer/issues/72)"}}},{"version":"1.2.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/Rello/audioplayer/releases/download/1.2.2/audioplayer-1.2.2.tar.gz","created":"2016-10-06T21:21:05.414691Z","licenses":["agpl"],"lastModified":"2016-10-06T21:21:05.483224Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=9 <=11","signature":"toeS45z50Lm0djgrQokOTN7gA8a113IZtiKKiLsGUKWrCV/6AKJBmEFcSun6rhLH\nbz/RtIdFKwQql6O3E0m1Zch2y1A8aLWHzFTO+5orLCVi7y15SshrJYbb9aI5Pj3i\nSR7+kMHGS8uNx2uIn3B4mO6UYF8AzCfp+ule18DOjnpu86KWvEOGtFXsQkLtgepp\nbJhOGWW/uOVIos/T1xPP4GCmtVmgn7U3b9q0pMYRH7ONXEiNsfQxDrR66EZH3Jfo\nlVyM9UvQmMKoDSdBUlvLlhCEGJGqFOD7hFntLYloI4oXv9uGqcagaJVh3TkEysY2\nMbBZpVhch5zRJ/HGlZOvmEzZ8Inxkk3iap+JmJ5/gZTefwfKUyYHALsILlh820U2\nNA/1B5A015XH5a5uflGE/tnlPtrOeecIN4mg+1njo2RG89HJWJNHM2ZDO4SkXjSR\njgygmAS5aR5+KKifiA/pwjhLozDWPU4lNzsj3Foz3bx3Okopy7eq83LORqieT4Jp\nFvP64q/45LOSRBWIWLitYzRzZp7HYywMsnz12WpxtqxIjO7+7y/ByeWWOBNU1IJC\nK2D+035ZGWZr0CxDJte33WOISwjVoSwrcov++O3BQW8lM5IkcDNcJFyzNPKAXcQU\nPUXmQpYurHoIw6odAYcbrG6iOiSesuNOf2kQWbjV3/c=","translations":{"en":{"changelog":"2016-09-18\n- fix: icon issues with alternative apps folder [#65](https://github.com/rello/audioplayer/issues/65)"}}}],"screenshots":[{"url":"https://github.com/rello/screenshots/raw/master/audioplayer_main.png"},{"url":"https://github.com/rello/screenshots/raw/master/audioplayer_lists.png"},{"url":"https://github.com/rello/screenshots/raw/master/audioplayer_share.png"}],"translations":{"en":{"name":"Audio Player","summary":"Audio Player for ownCloud and Nextcloud","description":"Audio Player for MP3, MP4, Ogg, and Wave with a lot of flexibility for all your needs."}},"isFeatured":false,"authors":[{"name":"Marcel Scherello","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEBjCCAu4CAhAIMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE1MjExMjA4WhcNMjYxMjIyMjExMjA4WjAWMRQwEgYD\r\nVQQDDAthdWRpb3BsYXllcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB\r\nALyC+iLscLs62NeNmUXEBmg+xMuUtDmZKr+xzJWtl6SSNRz+8K1JygvUIXFJ3RIL\r\nCYA3xyq8/wyZH1gNrLKyz5eTeYawG+eT3ges/FT6MWGUbZoRrBrikVcLC94QzxTH\r\nxOl8Dn+SCV/2bhcvPTQdhK+dqtvGilOtjHa40iMrk9gSdlKVys5CK/xdlEp8uiMa\r\nkz1WENn8MVCCJV58bAUbaCupDWXR9CCoSsw8XinNsCenZ2B2XlnmbM44280w0ojs\r\n72rfQRgj3yDG+ZUUyUOuxIuodu8liXYciLf0ph6t/f/qoSmctbBdsR5Fl1Upj1Ac\r\nqeHb5Yf/B3Vi6Mn3XfDx0H2EHk1v9Dhzxay+v9BHUzyIX2iH/q+7TE0/Jzo5AwBW\r\nvFKWXvG7wXaALcHYZf5v/M93IE0iCHsv2EsZKQPBnzXVGmp4DwFSP4po1B7hcog1\r\ngAMaellAzzvUAizgCovN6Qct3qDEANYniPlvtnlcaQGonajW4N019kFQRHLIzPFR\r\njab5iUMMwSnT8FhZO2ZOWuWhJven+gXjxC8mfMVgBfZnAVgydNfx9rN+KzTc88ke\r\nobUdZ0OOeBzA7pIxGEFg9V6KTEEWZ+qH048vxXz4HI9B1I+2wQLBrZl8CvweEZ5U\r\n5ID8XrrE/UaNZ1CvLKtCgB24gj/m1Elkh7wA3gEcEo2JAgMBAAEwDQYJKoZIhvcN\r\nAQELBQADggEBACtgUp+FCmjWIkQUuWSdzKWdO+IH4v9wBIrF9mo0OLIakFyDYyM5\r\nLlkYZXbplGXd4cfn3ruIqJNzlIb4xa5CU0bM4TMbD4oOSlLMKM/EamKPHI3bzr++\r\nzi7mQDFxmAE6FWSMBgKKUb4tqLc5oBap8e12tPEZl/UR6d9iUB2ltvrm3T3vrjjl\r\n2Worm0eYBNqnagXmX5+wS11AQqeJemGqRy5e1yXRlTgB0IJhH0dCsFNwifEigutp\r\nFNvGFVBn4r5qCiChEoq+rCXHRjPi/eCfbW21XeLFDiLxapcZyc85JIcA7znUYoFe\r\nP7Y/ekMscwWhLbF91OaQlcWpRtEMyde/DaI=\r\n-----END CERTIFICATE-----"},{"id":"calendar","categories":["organization"],"userDocs":"https://docs.nextcloud.com/server/10/user_manual/pim/calendar.html","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/nextcloud/calendar/issues","website":"https://github.com/nextcloud/calendar/","created":"2016-10-01T12:40:39.060903Z","lastModified":"2016-11-22T20:31:13.029921Z","releases":[{"version":"1.4.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/calendar/releases/download/v1.4.1/calendar.tar.gz","created":"2016-11-22T20:31:13.020268Z","licenses":["agpl"],"lastModified":"2016-11-22T20:31:13.087340Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"nThwe9CJBCan9nuDLdhfBiQyPhmum6Aa0UcYsIDdhGMw+C2acf81KhEmBJuTTWxo\nWGby6WcrcJJmeuCW+ePU91ju7Pd76RirprhVXIEceIDzSCxin+K0oZCZ1IGVIJjP\nIkVehTsLuCeTBbjvz1b3k5QFyhUhvd32Xt7k5d7VARyI4OqnqYYNBtH9vvgeRrFw\nAxsQr4o4axof6i3iykLg6WfWarYArY4dIuu5DkPuGPWf2bbgjwWEra4sQejhOs7G\nsk1xcsfYv2NpArIbpw/wnATdjiax+Gjz1URMD3NgL5ky0ecuZmNvN25QErg3nlVr\nhh1FBfA5pvCJbkJ6nr5bU4bKaffwDX1nr5h77FS5zzn0Pyd7ZIExmVmNtaeJfnfV\n5vnclapzXMNU+R6t/ATJQd1srvSJhyljQapzsqnrjNMEUojOEvqqygJp0KwNVPqs\n3g9XGSoOnO+WULWBeISW7UVOg8BOF8pwvHIU2++bSzOdpypW0Eq6p2DPWO6qL/H1\neFLKrUg3EvnTjvknbBxMB55h9jNJr0SAlkrmyEVm6+CE3BwRWpKB+cJMBuGiwPwv\nr/ASRiJrkDThbNWAUtX70rUmCqDV6/MujLXViqOc/Q2OHvcXd1oGDccJSQT92/1z\n7nonnedyYQIDqUt7u68WL8JRxp7pFsEqKLVuWSgxW3c=","translations":{}},{"version":"1.4.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/calendar/releases/download/v1.4.0/calendar.tar.gz","created":"2016-10-06T19:58:12.724588Z","licenses":["agpl"],"lastModified":"2016-10-06T19:58:12.790604Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"b//hJbICFMLR0Va1BGMzpLpaPREOo9QhjgfrHvDOfXVpddhvCM8ocz74X1s5hKyy\nGg67EE0pOp0dBf6RyJjduI+Dz1wQX55My7J9G1vXGCN30C/8zAcKSJoA218IWcub\nICavLkz2PkiitIOSZyBCAfEiSAeHPop/JGkq3KxQDC7QwFC78BnE9/adD9tO55c/\nDGLhvP/uTJIeH8RUifikTqVMmPH+aP3uPbZzl+AxhUezRiNCpEtZPA5QGqtQdJU4\nFc6x3d9y4IWbJV4TEIAP8jdfqtLVUQ6szFVnN8Oi1wtN9e8LIylBSYbmIZRj0+qh\nZcgntzEq6U843ZwXcAnL5jNYV0m+KNI+EkXFeWHkjvbwfCdvGPBvgFVbhc0YPzXU\nqHOe4Lvcx9X20ALG/MacV9zX69GzNnWgbBp9RnIHuaSRPFEKrNXUeXl2THuKsTyQ\nF9QtTwS5U5DcMyTO2RAN45NrRxIh8IL4stoIg5rmF7/ZaOm/Jza2gnUquOTarDE/\ntiWnNW5kWUAWyYYHvQgQix/of9qXvc2hhZaw0y623WDNrEwA+rngnjDMLA/vNv3B\nhgwQ6NbCOuHWsRK3S8DcJFpB9Kj/i7CDvDLEuJYnjSTvQ/q1XqawbJPDoRlydX43\n3/L0LvHvKVakYybv2OE5gy6bQ2Dw8e7D27DtZ6XTaBY=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/1.png"},{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/2.png"},{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/3.png"},{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/4.png"}],"translations":{"en":{"name":"Calendar","summary":"Calendar GUI for Nextcloud's CalDAV server","description":"The Nextcloud calendar app is a user interface for Nextcloud's CalDAV server.\n\nIt integrates with other apps, allows you to manage calendars and events, display external calendars and invite attendees to your events"}},"isFeatured":true,"authors":[{"name":"Georg Ehrke","mail":"","homepage":"https://georg.coffee"},{"name":"Raghu Nayyar","mail":"","homepage":"http://raghunayyar.com"},{"name":"Thomas Citharel","mail":"","homepage":"https://tcit.fr"}],"ratingRecent":0.944444444444444,"ratingOverall":0.944444444444444,"ratingNumRecent":9,"ratingNumOverall":9,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhARMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYxMDAzMTMyNjQwWhcNMjcwMTA5MTMyNjQwWjATMREwDwYD\r\nVQQDEwhjYWxlbmRhcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMm6\r\nFTeqgzCXprkU83VM4/DrZWn3kqtfaR/edkC4gYT3ug7RHa/Uv1C/S++vr7pvgpnk\r\nYzQoavl/0Qlh5sKEYX+0ud/LQDoiidwBRDckFUQ1bRfVLxAD9UAVvDRHxDqJMOx2\r\ngZArbeQ3ztdSHZp4ThzBFWq2FILsJD86weG7LwHjzhW6SWgLb/YTLbuuW6tRCDVV\r\nbtB0I/a0vCwj2u91Chw3u6pWWjPakc9DQrIDH4HCIBKQ4zVrYDxAmJDRFGDvVVWx\r\nuIAeux8sd8drqSMqAhX+XMcZPRD71NQTWbCupSwWO8kgjmZnBpIiBNpzvMQzJf3A\r\nQloZtjZ2RDXAQG88eTeT8pp8yEOCEoDLpGdraKxJrh/z2Dsk30JP3lOiNYJ9vBaB\r\nC8NJbJ3oAlG7THwUaFF9fsdAKoTwzs5Xms04TI7W/v4Z/GClOzMymnR1T4sR72Oy\r\n3WaMNHv/1QGffvQn2/TtZt23Ou3P083xWx2vn5FgTcac8+x85vRgWsVCA4hq9v6m\r\nAlktB0+UWDEXpDTKD9BdFNWM8Ig9jQf7EJrvTLNnS7FIJZMB4GK8lpvPxyvACWnh\r\nR2hQOe987Zvl3B1JZNO5RvtSeYld9Y9UfMgW1aPRweDNjSuZYAKlugx1ZoyI5HyA\r\nQjfzAwicIMwZsCJDV/P5ZO8FE+23rdWaoJczpBqDAgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBAHQXwvj8q5khWR/ilg3JGYpmMNBYHE9OeDaOcNArkKaGMd478SDPOXeu\r\nyW7hCvNEpiTk5g0h3g3yleZFws0xH8fPsQgZANgvQXb3RCcD61NL77d0cMTr7Xzr\r\nN3Lq/ML1YLc/WwL4uV1XvpMQMwALFL1p63BU2c0ysO31zbLOjMKAJi0hHFDYz5ZQ\r\nD3xxtc17ll3B5IqrMnMHRqmOQ39Sbe56Y7T4agaIz/sUWpseo85D5kt7UAIOR+Mr\r\nQ0Bl/QinETk72afGR46Qvc7tC1t9JjQQD3AUbEGuJdGvXjJJ9GREYu01XoODmPdT\r\njXXOI8XIOK6kxXhPHUc3iWu9b4KqGm0=\r\n-----END CERTIFICATE-----"},{"id":"gpxpod","categories":["multimedia","tools"],"userDocs":"https://gitlab.com/eneiluj/gpxpod-oc/wikis/userdoc","adminDocs":"https://gitlab.com/eneiluj/gpxpod-oc/wikis/admindoc","developerDocs":"https://gitlab.com/eneiluj/gpxpod-oc/wikis/devdoc","issueTracker":"https://gitlab.com/eneiluj/gpxpod-oc/issues","website":"https://gitlab.com/eneiluj/gpxpod-oc","created":"2016-10-31T10:57:44.387319Z","lastModified":"2016-11-23T17:27:37.793159Z","releases":[{"version":"1.0.8","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":">=9.4.0","rawVersionSpec":">=9.4"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":">=5.5.0","rawVersionSpec":">=5.5"}],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/963bbf246412bcbe8979bccadb3b8d03/gpxpod-1.0.8.tar.gz","created":"2016-11-23T17:27:37.783365Z","licenses":["agpl"],"lastModified":"2016-11-23T17:27:37.862469Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"hqhMh1l/mnwbYf4uPzEjjLFtZWHidzgR57X471OuXv2K/s87T5WhIkTSKk+2r8sp\nS7CtrF5+Pc5AgCCHvwzawN3e2+4eO4cK0+HD9CCzygzzHZEbSjufNHMMQucVoSD8\nPqR6MV9azzUpwHa/5d8fp3cFLVAle+aG0o4v5eHky9c7eaKxVJcgfjw3pjDE73N6\ngJVdtw1jf1kOFYk5pZQxDfBKFDrO5BRo5ZfZGuOuP2u/SmTwj42oTZiT7oTVWhqd\nLvJw+2TPv7B8s0Gin+J5e9K1Rs6CEWQ6WBxM+NhS5KgWB5Ig3pwm0QvMgza2cvoh\nlwVobOotfKLUBJzg0+wR7B2YH9Ao+m94h93vg7H0OKPReoTKhlDj2UExoTyeurV8\nhJdQv8sKVAxjC7/xrVaGSjM4YxFdBpzq8Zl8z4zq1o2voH5+u4ko3c62C1loDpsC\n8KrL1t6A7QpMk/XAMrPqwEPmFqlLEdv6FhzpOGyt4IEVnv6vdMTShcYw3tPvU/mD\njPtiVwpo8gWbGVIfpmwBg4wPaTrWK8V3+/1iTahIQHZfu4Lebb5mzht80HLQIcd8\n+oB4cGDEX4Rix1WxnCmE5ZzURY8xQXcvqYN+mTrUDh/3OtxQPSm5yC945SGoFNpr\nBYxfEyQcwulZrOMBdY0Ssj1AB5NOeC9OHwjJrnVe7dQ=","translations":{"en":{"changelog":"### Added\n- save/restore options for logged user\n- option to choose picture style (popup/small/big marker)\n  [#25](https://gitlab.com/eneiluj/gpxpod-oc/issues/25) @eneiluj\n- add average speed and average moving speed in comparison table\n\n### Changed\n\n### Fixed\n- bug when python PIL is not available\n- deletion of bad parameter given to getGeoPicsFromFolder() in controller\n  [#20](https://gitlab.com/eneiluj/gpxpod-oc/issues/20) @eneiluj\n- bug in file cleaning, bad use of array\\_unique\n  [#22](https://gitlab.com/eneiluj/gpxpod-oc/issues/22) @eneiluj\n- python script do not need to be exectuable now\n  [#23](https://gitlab.com/eneiluj/gpxpod-oc/issues/23) @eneiluj\n- jquery.colorbox was brought by \"First run wizard\" app, now included\n  [#21](https://gitlab.com/eneiluj/gpxpod-oc/issues/21) @eneiluj\n- avoid JS error when failed to get options values by ajax"}}},{"version":"1.0.8","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":">=9.4.0","rawVersionSpec":">=9.4"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":">=5.5.0","rawVersionSpec":">=5.5"}],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-nightly.tar.gz","created":"2016-11-16T14:06:33.937534Z","licenses":["agpl"],"lastModified":"2016-11-16T14:06:33.971502Z","isNightly":true,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"JtUhKRDFGYDx9xtHjdfEUFOb0O4idexUYw6ixlBhKPP8Dn7NfyBfV6KH6MJTIVLU\nQ5Jw6tv/Nr1YDOvVikcWPG0p23mQdn1+7w8DzzIGKmknxCat9/vKr83oJZdWYxS7\nTJ4I7qTvWNlbMfK8OEdl13VJXgc6ftX+1isluLYqLjEm3aBFCS+/awYNMmXO55a1\nyG0NgJRu3pw1CBCMhDaRLsunhpRNDVLsamZj1SPmeT8qy0I/arFaG6hQnAo6JosE\ndi1XkvK6TEt9g16L6eizd+JpGE7xiWFP9ZEmMmmQSOLQYwU5Sk1YWcrW3EX4vtz5\nWnEIC0SENyyAyzBO6YJfu/EP2lLnlbNJiuc4zzKLqRw/zyz3j+imJLcXHIA78ZkQ\nuyUOBkkk3xeyBGeUcYfDuBqYQOQs+F/7+cNMsIBKJhx9ef3OPURBc7X16upk3mxV\n6GsOktbHkgUwWk3WiXRriBIqbAZocvDp0+PN++PAEZVWFEZEJzztd4Fxaeo+QSN5\n5Pz/9yXYRsoSPZv82Tlh7dx5tIPUvYb+UsANh5eGWUGufTSwgYBN0H2KT/iO35D7\nkDzNyh1qNakfBhAgPjrC2p4mBKBJJjlM0D9erDwr5D4GSTW2fp92vlRHeD0X8sqo\n3kBbwGuWnmhdJhbd7zYy0jVM6tVX/zgbhycimNALG0I=","translations":{"en":{"changelog":"### Added\n- save/restore options for logged user\n- option to choose picture style (popup/small/big marker)\n  [#25](https://gitlab.com/eneiluj/gpxpod-oc/issues/25) @eneiluj\n\n### Changed\n\n### Fixed\n- bug when python PIL is not available\n- deletion of bad parameter given to getGeoPicsFromFolder() in controller\n  [#20](https://gitlab.com/eneiluj/gpxpod-oc/issues/20) @eneiluj\n- bug in file cleaning, bad use of array\\_unique\n  [#22](https://gitlab.com/eneiluj/gpxpod-oc/issues/22) @eneiluj\n- python script do not need to be exectuable now\n  [#23](https://gitlab.com/eneiluj/gpxpod-oc/issues/23) @eneiluj\n- jquery.colorbox was brought by \"First run wizard\" app, now included\n  [#21](https://gitlab.com/eneiluj/gpxpod-oc/issues/21) @eneiluj"}}},{"version":"1.0.7","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":">=9.4.0","rawVersionSpec":">=9.4"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":">=5.5.0","rawVersionSpec":">=5.5"}],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-1.0.7.tar.gz","created":"2016-11-14T00:57:37.521001Z","licenses":["agpl"],"lastModified":"2016-11-14T20:35:45.363487Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"SigBof6QJZ9IMZyFgc+B3LO2+EXaAPvnxUHjJQjIl3jLzomocpDGR6WjO6gtvB81\nzXUHjJ8+huc+P9TvgjUGRTmn9a/29HZ4IKTXnYBKIUY7wSLcJNMbJSp2Zd3OFHAG\nJwRaEdh/cIRk2X6NE1VT6dFCxB+LhTM4BXOEwuNYQvU1lZDVQgTz/r68zFLWBt6R\nqhBCNJHrVp87ecS4+XaGq/CfT4k1ihiOv+f4eX9iaPzUhxBJ71iYKF7wHpDoVmIk\nNrzWFUJH3BLBuW9oiC0PApli6Xu5RXrWUsOV7OAmxXgylRCPuTFwe09hw16JMbiS\nii8WFiUtp4qW53+7eoS7Fllm7CRi/Dg6Jvjtp3msrf1m+OiYM7dLyoKw22/S4P/a\nBIErZpSCHaCfrZ+DBXrAYcas27GWE7HizzG3yXk3aDJMa0Otcsq56bSPo01JDfNx\nm1y9iuwmlon8zKKoxsJCwxaFDnQpqazaLcUO0ATHUk8LdomTA7MCXVvNFPaO86Ea\n16iyw7Cfs0k3GrvN71+SdpvWss359CEEwBMpDwJZqwSFbLRyHtogUgbRWLIJqR4n\n5uVvJqirxWkr/EtXw6UkDWAI3ZoMhMRtjn4H4ekANP5mC8R0yp+UuFs2RkEC5uA0\nKzzh73WmxmpeUl6jcMZ49gXn3PTCC2fJNrdmSYch5Dc=","translations":{"en":{"changelog":"### Added\n- option to choose waypoint style\n- show elevation, lat, lng in waypoint popup\n- ability to display geotagged jpg pictures on the map\n- pictures slideshow with colorbox\n- pictures work in public dir link\n- use NC/OC thumbnails to display pictures on the map\n- options block hidden by default\n\n### Fixed\n- fix bug in geojson generation for waypoint-only files"}}},{"version":"1.0.6","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-1.0.6.tar.gz","created":"2016-11-07T12:11:00.619161Z","licenses":["agpl"],"lastModified":"2016-11-07T12:11:00.699921Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"WBts2fm2rW/7LMHYjcx9a0k0WTXV6PnGRxTl+158cjfV7ruMpNvhK58iTjrox69k\nFWAoIi1wNAlLBu9Xet1j7HKi4TC9q61IEN+lPlnwBCu0uHawiqS2gqB4i8A019Ei\noLsgAPWh8ndy6+gyUtPhVLVduLH76aT6KTwAiHPknV0zPtxsUy1P6nbbNOS5A5rG\nSQBqljy0TbcjOctTudEPp1IqjJIwcd12eZ9MLG4CEIO13n53pMAsuXJf4jnKSCm0\ngimvsFOwFRjBab3ZPwtOqeVw6aIh/lYF3U3/k8YBpaDN74m30nDtkp8teXBgshSY\nVYvX3yOAYe0PIR419IX0eoHb61K0VfZYvPT4FsOqjDr0zlVB8Rjq+6SiK4vMD2+6\neGE0aHbjR9HV5jymUnFYdm/hlhcZGaKrAiQKfBY6Vh0SWKfIv7bdGfQYauePAdZt\njlsV8lIwOy7FGAeP81CcjzWWfDeBgYr+MSzfoDNoTi41MvUaT14iWPIU/s5P1/Qv\nALGxgsbmB19wEgNbdh1UtTUY3xARLpWPYdUqU7yDcsddX9vCoCG2G5wCcbYJRj8o\nC+H7wdgPJoiMY/p4Go/lyWkvmzhfXrOeXytZIFXjb3ERVd1vD9WSt1DSy/7gsFYt\nxzzOPgqMvL3BbeluNuzNv366oT872s3OuFKa1ZOYY7A=","translations":{}},{"version":"1.0.5","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-1.0.5.tar.gz","created":"2016-10-31T11:08:41.017766Z","licenses":["agpl"],"lastModified":"2016-10-31T11:08:41.068782Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"UXeZVh5f0/WZE+r/dHWc1pu9q4qr/zACX6XraMhhIuKIp7vNCwUESeqJtVc99QZw\nw9kJp0isvib6l0zbQBRS1vI7xwKKBQyeaEhIciEs1JjsaCiato1Gyi26N+fY2N0Z\nFWlTwCsF3DdlwERXTYfeCpsOWCoxLxHKhnJIjUc0PVme/Ste4zxYj+5Su1RpadSw\n4vGnkW8zy/0tzua50NQCrOg+B4jXzH9kMWAP47w3sdP5CYalHSHl8EX0D1RjgGU5\n7vZYX3wF853FvQDbL4JXXCJupj3wZe8py8McWpQIcgz1p3KmE7A7d/rdNWExT+T+\nDxtStJ56qTRMz4aFwoSFxJrrEfgHIsE9Gv+Vo7nshCUYA8gkfHeckiaUtH1EiFTh\nVNeO6mTIqGpRosFvfUrZMKcuF5j74vGQjNM1o+M5N31gtLoPSkU605f/U4v+j2oC\n3/N1rYF2SEDFO0EgAGXaXVhB0ltSDkHJw6vZJ1L8Qz6tooUMDxaMri8vycA6LHvE\nqN+z+S6TXMfLvN/6ATYPGhicrWmkMT/k7v1az/hcnfH+zRyLZyFx94s88JWF7Jf+\nI+tgDbfqTMAIcytJUC+KfdQW1ueXh5F0owrOYM6jgBRvhqj1T8s+Twgw8orGmRPe\n9h8G9Z3wZAooQvmC0KdVhLuOeIkqt/S5krELNFFBRnk=","translations":{}}],"screenshots":[{"url":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/db5af6ba7ae1cd4d22ea81d418f5c762/screen1.jpg"},{"url":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/123588561a8067185572a8d1887ef906/screen2.jpg"},{"url":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/427688b80bf8428dd45bd15d69b19075/screen3.jpg"}],"translations":{"en":{"name":"GpxPod","summary":"Display, analyse, compare and share gpx tracks","description":"\n# GpxPod owncloud/nextcloud application\n\nIf you want to help to translate this app in your language, take the english=>french files in \"l10n\" directory as examples.\n\nThis app's purpose is to display gpx, kml and tcx files collections,\nview elevation profiles and tracks stats, filter tracks,\n color tracks by speed, slope, elevation and compare divergent parts of similar tracks.\n\nIt's compatible with SQLite, MySQL and PostgreSQL databases.\n\nIt works with gpx/kml/tcx files anywhere in your files, files shared with you, files in folders shared with you.\nkml and tcx files will be displayed only if GpsBabel is found on the server system.\nElevations can be corrected for entire folders or specific track if SRTM.py (gpxelevations) is found.\nPersonal map tile servers can be added.\nIt works with encrypted data folder (server side encryption).\nA public link pointing to a specific track/folder can be shared if the corresponding gpx file/folder is already shared by public link.\n!!! GpxPod now uses the owncloud database to store meta-information. If you want to get rid of the .geojson, .geojson.colored and .markers produced by previous gpxpod versions, there are two buttons at the bottom of the \"Settings\" tab in user interface. !!!\nGeolocated pictures can be displayed if python PIL is installed on the server.\n\nGpxPod proudly uses Leaflet with lots of plugins to display the map.\n\nThis app is tested under Owncloud/Nextcloud 9.0/10 with Firefox and Chromium.\nThis app is under development.\n\nLink to Owncloud application website : https://apps.owncloud.com/content/show.php/GpxPod?content=174248\n\n## Install\n\nNo special installation instruction except :\n!! Server needs python2.x or 3.x \"gpxpy\" and \"geojson\" module to work !!\nThey may be installed with pip.\n\nFor example, on Debian-like systems :\n\n```\nsudo apt-get install python-pip\nsudo pip install gpxpy geojson\n```\nor on Redhat-like systems :\n```\nsudo yum install python-pip\nsudo pip install gpxpy geojson\n```\n\nThen put gpxpod directory in the Owncloud/Nextcloud apps to install.\nThere are several ways to do that.\n\n### Clone the git repository\n\n```\ncd /path/to/owncloud/apps\ngit clone https://gitlab.com/eneiluj/gpxpod-oc.git gpxpod\n```\n\n### Download from apps.owncloud.org\n\nExtract gpxpod archive you just downloaded from apps.owncloud.org :\n```\ncd /path/to/owncloud/apps\ntar xvf 174733-gpxpod-1.0.0.tar.gz\n```\n\n### Post install precautions\n\nJust in case, make python scripts executables :\n```\ncd /path/to/owncloud/apps\nchmod +x gpxpod/*.py\n```\n\n## Known issues\n\n* bad management of file names including simple or double quotes\n* _WARNING_, kml conversion will NOT work with recent kml files using the proprietary \"gx:track\" extension tag.\n\nAny feedback will be appreciated.\n\n    "}},"isFeatured":false,"authors":[{"name":"Julien Veyssier","mail":"","homepage":""},{"name":"Fritz Kleinschroth","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEATCCAukCAhAaMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDMxMTA1MTI2WhcNMjcwMjA2MTA1MTI2WjARMQ8wDQYD\nVQQDDAZncHhwb2QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCq9p5l\nzNzR98l/xPgrplWrGQBhF6aQSLpnIyCdLAYKk+CmXn47W1pHh5CRYyCCyB8YPBBG\nTwbpP69pP1updfK2vUt+ShYmCXLxOLB3qEdhnwgqFfwpC48Ocev9d6XcacYp7jwu\nRNtv0ocMkm5o0TWWupcutQWkmqzCVq+OkrqM0xrf3mfPymuM6edEREshukoL86Ei\ngTuMMGT0XO99LikszvdceNQYEATix1MHzSVhkE7jHCNBXb95H6nQGr0v7R1MIbrI\nGFlgqxwwNNKwBFNfPMWZVnKwz9hoIwW6WOuu7ntwVcPqwB/gUsRZJTu7EjIW0trX\nnhA6xLlc4X66W1sdUCkJOxsV+Y21akz6wynI0SzIfjALLI2Ls4QWrPM8GOX8nPVM\nm+Y5WXzqLJScdWYoefFJKS7kxwUJRewREB9ykCG5OdDubV+Iu/6jh6HWx3h4p3ih\nqkDypPWoxpfLgA8VZkLD1RRKGkRa858QBGdF/RHbYT3JfLEp9l9gJVKZE/yw7HKk\nwsZ/T6CMpLyorpd1XWtp2wLX8lr3pp9ecVDOdAMSqD2thDMDsZA82JrJ/vITwkCF\nBlqtDZmT0UnpxYNYTfYBam5Cd00jsqCt+Hr+QkODNe8Yae9c/D0zE3h2Vt7g9H+W\n7Ei+rF5nDYTBAApoETxK7+aUZpycBf3THAJOcwIDAQABMA0GCSqGSIb3DQEBCwUA\nA4IBAQBbCGAEwg3M5QJDMnZgu0zNOH2f9bamAS9ksyCZqzLoeQic1W7GYYe9NqAi\n7lO5jXRZpTN4L133IUQPtxCxuDooD2vFmCne92tLxJbc7uqlSVfhL8uMVOlnrA99\nKTAhySTZU5so8/OibrngnBmcdWwbhaWoCQ671M8aXM1wg2FVYDqB2GP3RvbpW11L\nOc+4tfh4mO4TwXygf7KYMOJyJW8mNNY7PZ+XW2Qe3vSXR3DuN8H8fgMh5wppXPJf\nE0+yNs42hwFjSojtI8BCb0s5DTleaakpDo8HQGNzEXP8tBlUYudtjzdP0jxFXbFa\nsT9pcMdeJ0/t5HqJSx1EjUCLYS4y\n-----END CERTIFICATE-----"},{"id":"ownpad","categories":["tools"],"userDocs":"https://github.com/otetard/ownpad/blob/master/README.md#mimetype-detection","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/otetard/ownpad/issues","website":"","created":"2016-09-29T15:58:52.814912Z","lastModified":"2016-11-19T17:37:52.278497Z","releases":[{"version":"0.5.6","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/otetard/ownpad/releases/download/v0.5.6/ownpad.tar.gz","created":"2016-11-19T17:37:52.234684Z","licenses":["agpl"],"lastModified":"2016-11-19T17:37:52.423930Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"dh+Txg1iVfqXr8+cxplNQuBZGErSnXUo0ewGwnybNMJqp8/EjEo72+zPpW3dVnhY\n67YCvhrm2bo+VRdFFymEfymzSJu9nWVFkGJhEwvTxPyIdAtuD5YAVrzmnR6L+H7m\n7Q1nXE63ICPCAQpHkxIfIXLh25OhWeyofBB8AVsjDUNn58FEYJ8fFkr6dCgPriZS\nsM2J+xtZMDYufy+xFMsVf/Q3WopjFuBjMC3qOecW76ZTwtREaswOC2RtpzUku2r1\nsogrfFlFer3Ii9/CWgOktnLfjB1DzbTwdEkM2xNVBRJgdMXt2VLA9FsxFFkjmr5A\nl7x9cNLWA8RLpOIpIMBbaef75u5HgRBvSvq114UsA9GCu/EYbIgD8YxEt7xuKd4t\nenksJB5gJ2IQNdHrPbsil59AsJ/dismDN6ktYgWQEk5dINzvm9EAvucueW0Gt+Jr\nqEC5WBgJucsFxSvkHh52v43M8jgPYBfHWEL/M/+377z3+mbuIh+BcQ+vcDdiqxTF\no3n0+gw3QYIhLEe75sUhxG6ynVUdW25AKKju1kVj3KJnZTBH1R8t8/zy4DnJG8d4\nuRGqyU4BXpZjEC3nVlsC7vCncWWhxl0WZQ/MWKqsfjVAU4I88E518D6NioqMnPEJ\niCZ2x+69UCDEQyfCSKajgAYT17r3OhZei8F9KSCH8Vw=","translations":{}},{"version":"0.5.5","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <11.0.0","minIntSize":32,"download":"https://github.com/otetard/ownpad/releases/download/v0.5.5/ownpad.tar.gz","created":"2016-10-06T07:51:05.278637Z","licenses":["agpl"],"lastModified":"2016-10-06T07:51:05.348825Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=10","signature":"nYsQ9U5r7uXwtcquaWGm2XMJBNYCcA95aUx9gLZ/wEmjCHqId7+MzcCdBnom33+j\nat2XR2a4R96UAUP78bfSC4Yb7nPepFT51Y8CSpV3mDT85/+SgJdq500fXldq+qGY\nffXLneadAztyOfZO9TXljaCLdREYI0LJIGVENsxBQVKM/eyGIuZO7fF70cH5vbfS\ns37+BXB+fxcDTlP2Xuulra8HsNoS81bzjsdVMLM7B7QwwO6rZ1zd5c3UzQ1LmY5g\npQUBNd0KjfHfZ6+Fd64XZO6NGfgucGNmL3lgxdsfUqKiLtikvFxK39dYW5MckV8p\nvLoS2nZ7cgETQmAW9Ahn3ro7gXWcPxzL41oWtZOOHRRC2Yz5zlZ3Bky1o+bF9g5a\nYdDF13zV6utUkhlplZhWbjKaXa04rzOvmut8Iqhx/tmDtZRYtaQXJZWutVJYtPC3\nH86uJJnUHHNFHeoT560mp1Hq0dTeR+G+yWsPacPD1rTYgZOUVEtj3Y+YdbTODR2o\nOdGzeYFl+6CL/OcY4wPGRUCTFwvc31lIUd4DK5SPfN+IGtuuXhAqVhwy6lpkcKRs\ncj8sBoVXbMvEtMnt5uARBvA4tyVffUL4oyoIsUnvXz4u+q4WVt3T17swLm6HjGVC\nNVqU0srHN7EeBRhHlXP1CrKQWGQlS4k9j9Li4Iw+X8s=","translations":{}}],"screenshots":[],"translations":{"en":{"name":"Ownpad","summary":"\n    Create and open Etherpad and Ethercalc documents.\n  ","description":"\n    Ownpad is an ownCloud application that allows to create and open\n    Etherpad and Ethercalc documents.\n\n    This application requires to have access to an instance of\n    Etherpad and/or Ethercalc to work properly.\n  "}},"isFeatured":false,"authors":[{"name":"Olivier Tétard","mail":"olivier.tetard@miskin.fr","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEATCCAukCAhAPMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYwOTI5MTU1NDA3WhcNMjcwMTA1MTU1NDA3WjARMQ8wDQYD\nVQQDDAZvd25wYWQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC6CY7I\nHRJTaqDu376vt+kruX+QOL864joScxRuh3IOVcQktCvxasuA0EtrX7TCAQrV1tBK\nfkqJxU9uOV54RTgyh30yH/ZtnF2bYQwViGM06Snc0riqWydFrN5fxK52dpZWs63o\nUFCNhHxrX4aUGyfXu5nQMISLm4QHoZ3LDLofk1ZsiK62fM/Jz8N2PM8qeHzf1ATo\nSKcAOd3UeaS9C8bv2DuiZM7unkSO/tjrBzkMiq8ds9sIzBBsyk6BRh2HQjHPOtmO\ned+pS9mIZmc2xhssXoHL4IfZwTqwhktpsaTl7v0ROw2dwDATz/QoKMkUpboQ5lkz\nwgLQhoIZw6uAZ1R/Qjze59I3iU8zIo9quDarHBotZNXboYCmg9FRfE4mHtegVaa8\nv1a1JvFQ5gvsWEsKSV6Bzb65GTp4KG4q7YnUrzh6HJyDCGLvLlWm5OWsFj6sNzXX\nwLOv6JLORMbF4ZIo2iybb3x7gdfCu9JxMZ4JtOUC8KSJ6+ub15C1Aia3lN68dNts\nY6KwUF1Ted0o4OQPAulq5pUc+g6dTYmIKsavIiPKhMtl86AbUK50vRTeuGdFsT7X\nav73IanPdFI9bKth+tajgvB6dxcVnvBXbrsLUyEcsxsxtBJvQcMYS4aZ6ZJYLTep\n7AdK0Zt1iMdXB8+4PCps4rcG6bYB/uJeEAVm7QIDAQABMA0GCSqGSIb3DQEBCwUA\nA4IBAQCM10O+sCYhIExnx01vGzKlnRS7MSQNx8ZMmbR5Elfz4AVJAEJ96ytS2DXH\n2c+hcD0wAenXQEFk920AEqFQBT8DP34p0FmF83aMHW08ovzFiu4MdlhcqrLnko0h\ncZTXHVyS/8JZh+o6SVm8R0/BBLF1MQQ5TqRkJehbmk6gL0+MSYxehUDKWTjJITkR\nifneTw/Ba1d0AXBOq0c0HFyGxMPIlWe4qn5LtxH5t0wyVGeSj4jyv4nvd3ZGuAgY\nEUa2uYht/z475k4+vf0YhV98iQH07GnmlfD2TDZgmOCQGKlNfJh1v88OZyLLa3dz\ngRHzGwKbAiJ8T8bbpZ3e2ozXxADr\n-----END CERTIFICATE-----"},{"id":"announcementcenter","categories":["organization"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/nextcloud/announcementcenter/issues","website":"https://github.com/nextcloud/announcementcenter","created":"2016-09-14T10:38:53.939634Z","lastModified":"2016-11-24T11:21:50.324839Z","releases":[{"version":"2.0.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=10.0.0 <11.0.0","minIntSize":32,"download":"https://github.com/nextcloud/announcementcenter/releases/download/v2.0.1/announcementcenter-2.0.1.tar.gz","created":"2016-11-24T11:21:50.317635Z","licenses":["agpl"],"lastModified":"2016-11-24T11:21:50.386203Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=10 <=10","signature":"lmqeE6xBqUJfhuXPbjCfuWiIP0FEB4V/SsF/OvYar6rLpvDpJVf3DJoeIoxXurRP\nE9/xCcNN44P8PreRRDnFLCa0XsKOtwoGa56Lxk7IKvtiQG6xu4J6PKM+q/tIeF9K\nakw0LQXtjZB5InPhnCDDbY5YS9jgGEBylSHsgNgrElipcW+BzOBu1Amw4FECVlQw\ncQ83bio+YPZvsnE5+v3/bAx0m6QNxfyN9Sn6rMEqRkY3jfA3vejXGQH/XkputfV+\n5hOz48KbOVg7cKxg+ieJlSwC0aYjb+RXiopjc3icCoIF1llltOOeSsVYSflOb080\nupociPgQ6qIab/VNNXa2YQ==","translations":{}},{"version":"2.0.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/announcementcenter/releases/download/v2.0.0/announcementcenter-2.0.0.tar.gz","created":"2016-10-06T12:41:56.195206Z","licenses":["agpl"],"lastModified":"2016-10-06T12:41:56.263124Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=10 <=11","signature":"NVWYz73KtuoZ7ti2sluztJO5aFUc7PzhlDcg0VWyAQd1H7sk5wjw7i0bhrjw8O7M\nLsrb+PegnsL9eMlYM2WrRom+RF1PDP482xymZf1T8vh8qcTCm3TK89xSuiSm8yoA\niWUb/Uv/ODj74wVDWqWxAFKaAG/FestCB3InOOZQqQZLzlAV0U9ziYDGNzBjFqof\n9rLNxJ2IOqZOA7hhMIKhSrpA0KkSfNhBsVf8CWClYnVkZQiq0LoYkHkHIlXmXUr3\nOfQFKEjtsx+bNLa6CkAaocHGHJXAofX3GQZ9cjBsjZqiTfbXfcVk0kRfz7pwL92L\nI1McfJYvgMxDQG5bjRpNJw==","translations":{}}],"screenshots":[{"url":"https://github.com/nextcloud/announcementcenter/raw/stable10/docs/AnnouncementCenterFrontpage.png"}],"translations":{"en":{"name":"Announcement Center","summary":"An announcement center for Nextcloud","description":"An announcement center for Nextcloud"}},"isFeatured":true,"authors":[{"name":"Joas Schilling","mail":"","homepage":""}],"ratingRecent":0.75,"ratingOverall":0.75,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIDDTCCAfUCAhABMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwODIzMDkyNTQ0WhcNMjYxMTI5MDkyNTQ0WjAdMRswGQYD\r\nVQQDDBJhbm5vdW5jZW1lbnRjZW50ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\r\nggEKAoIBAQDPx4Hp1HdBo5v7bDEiVcv2UrVjNW+fPPKS/5rwbagtPcE/1v3WDcwX\r\nvFwaXk8qCn2UpPSQ2b1rTuTDm51G1ZmEZhNiio+rBfEe9F+3tLsq9lElqIPKhkAq\r\nEUVI6dcN+jSqvLmLhuwloEoQQSYaLrX75mY3lGqTb83h1l2Pk/brVixuVf4vJW31\r\nTgeieuGKnC+keLzKOrvTHffJakU8ktwB2Nuu1o+jN5a7u1bxKkP3LjEWPjq236hk\r\nAoOcW/wi1dUEyUKUZsZQeJyvTJh1UXdLHKwYywtUu1/VLZ1IUtNyPBfiQ8ukPp3T\r\nTnSSmG3ZnvsfM6DmAvLZ8bBQkMBzEcTLAgMBAAEwDQYJKoZIhvcNAQELBQADggEB\r\nAAB3i2NgiZ4rpNag7cXYdaFxAxdDWnke1+LX2V2R3hzGmx73/W6cKLpo3JBn9+zT\r\n1aEjlqkt0yHu4aAPVYQzOa5zIV8mjP84p3ODSyV9J8lfjFNXT7wdA8+9PVx3lVki\r\n2ONoCNBh1kOxnxI4+BsMlQfF00ZbBSuGcMm3Ep3lTFWXzuUn3MQITzPwkL5LkW6a\r\nsli/yAYQRTVDsXD8A3ACYT7BG31jGxyXtIHzqCci0MhZFdKKayMYkwfjZchIUtGN\r\nJJoU8LQoHwGRtp3wutk0GlFzpEQEvSsn/Lsvvot5IfIe46tnzA6MVj5s64s5G8+Q\r\nphhXFlzXqO/VxquPdbfYjvU=\r\n-----END CERTIFICATE-----"},{"id":"ocsms","categories":["tools"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/nerzhul/ocsms/issues","website":"https://github.com/nerzhul/ocsms","created":"2016-09-19T21:56:04.745481Z","lastModified":"2016-11-11T16:29:55.864273Z","releases":[{"version":"1.10.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://ftp.unix-experience.fr/owncloud-sms/v1.10.1.tar.gz","created":"2016-11-11T16:29:55.856768Z","licenses":["agpl"],"lastModified":"2016-11-11T16:29:55.947926Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9.0","signature":"hVzbkmmtJCtiOkZGe1mkWElqS3IPQ8wLtSzikVvoKmcg+Zq3YLQjpQWzy0t3UVjo\n9I/BfnL0bF+kjtGc9xF6M8IQaFqPrfJmN+lNT8WYIKLI97TTsLmJGg8Q8PAux3nY\n8/NxMjWdByMw9nVBClKo0o9eSW4+EnaUSJ62Gl/XWjq728kbB16WZm+iesk8LjJJ\nqqAgczWGwz6lkZTCN5o9n0a/YoLJTf4iT+OItHZyS609Cqaxx9CAmZPj/Xn5g1fm\n8hqO2ITAXLoBj4rYS/QsZTMcubtGkJ8fq3XYKVSv2UXZfvGsNWbbGV7puKN33uWJ\n5MrdoMlJ8XnJRPDlCBcb00LY+AB+hAMooLnNy765/Ew6ztp4KNLEPWGG+Ut8/Lkk\n0jIULl1RF/FjlW8P26NfwH36K30RCJFY06OFcWnxGBkkQaNFORDIsKcqTAxkl4x5\nnfKBkNdQZppCVfOSKOZj4NkWfWx75Ouq1S0QksmOsMZoOcjy1TbBKR8h6dt9DQub\nWpYBL0QwyQShGp0Vb1qCKkP69ZQAHVUJNzIFPz9LyoguvFyv8iZmAPLYDnFBvlf2\nnSHtA19rnJmZ4H7RJ02r6BdkstxISvEiHU7RLjNQxcb+DptIWX5C03wH87HTNIhr\nvptPorEoSY1KwW9fqUvvLE/c+vfkr5cvIEwZlyVKVXU=","translations":{}}],"screenshots":[],"translations":{"en":{"name":"ownCloud SMS","summary":"A app to sync SMS with your ownCloud","description":"A app to sync SMS with your ownCloud"}},"isFeatured":false,"authors":[{"name":"Loic Blot","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEADCCAugCAhALMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE5MjE1MzU5WhcNMjYxMjI2MjE1MzU5WjAQMQ4wDAYD\r\nVQQDDAVvY3NtczCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANqZVIzM\r\nwBJuacuvgYKr2KnXuYhjKjZ58nfspSebsaGLr0ifBbo8L+NH5eaynnLCNhpegmu0\r\nO8D+KrbM1LtIkcdg1/eFpN5dTc6G2OAc9H9stmHs9nroF6MNhszgdZCz8Q8xkSoD\r\nGdSm8hdPg5GcfLrH27UilGtzdQlWJ1DralLMt3l+SfGJo152c/dc+e6SuT8+EbY2\r\nCeLdH5ImasXNpUgY+tAoEt2ZvhBrUghykBJTJVOjwL1jGLT37ybMtV4FBKo6hpeg\r\ntq/YzEk1ijBAC4pmoNWixDKCdolpVJVz0fijI9mlda3llurcp8eMhxfYJ9soXLHp\r\njvLX02YY6RfPcyy48uWVk4IEt9BvZWEVAAp7hCGA2yXrVSsR37E6sDbLsBcKav9A\r\n6dkGAgfmGkr2WT6O1/EhK/MakmnYO4WD1B+E7PnxtP/wOa+aQBmntQcd7igDiwzG\r\n6h05NYAWcRhqfZ4KWYsq0t0SezMbuHOhwzzi22q8wijC5YZbmhKSh+b3N8XwYKDi\r\nZaw+fSahPbRWaLyR3wn9zh7vKCwqrG3ugrNo6CtyoACAnmxKZ97ROFJIQTe3ndLL\r\nmv7Wy8iCZLhRYUaW/GKrF11AFwBVec9xmvkgU+PIKq2HSjwi9sCF+pFyhVjmq29C\r\nmZEPKUV7ySIpNHXpsXm8kTJJfqjSdb2ECbLfAgMBAAEwDQYJKoZIhvcNAQELBQAD\r\nggEBABvn97e8Nw8KAscf6FX/nZ99rEX+3IrZxTC8fmBgNwAvlbF2A+QZQcFI4G9/\r\n85nHK117+u7XDuwWl4QG3flWlI0hDE59Ud9Bd4AiTQ12VoXlNdYoTg/mXARxVozb\r\nKYqZ+1xRQclZKb2AqW8YiGo18okIKovn9VVRAFYPYx4O3Ve1FjgfsaMlIZLiXUFm\r\nkk+2qWo6kYsdU9FABLo6izx7RFOMbnYNre5FmDrWP1Dga/U7ErK/Dilh8g9b3HrP\r\nwP8OIZhdtFWw21wDTfyqrb9EhC/tsjPVP9u+bqyognHeiMhjbVYRbSvz5o8T7Mhj\r\nbxalCt4/LnMIfMwVyIvye7Uy2GY=\r\n-----END CERTIFICATE-----"},{"id":"rainloop","categories":["social","tools"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/RainLoop/rainloop-webmail/issues","website":"http://www.rainloop.net/","created":"2016-10-20T04:17:37.217555Z","lastModified":"2016-11-18T11:36:04.309739Z","releases":[{"version":"4.26.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/pierre-alain-b/rainloop-nextcloud/releases/download/v4.26.0/rainloop-4.26.0.tar.gz","created":"2016-10-20T04:28:21.491747Z","licenses":["agpl"],"lastModified":"2016-11-18T11:36:04.619927Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=10 <=11","signature":"nTYIVSB6mIwKtXIrKoVGsOGFflpLjed8jFem1VLQNtXQj4bztnNrdc4YaPIn0yzM\nyLpMSqRDNzdYNFuOeDiyKLPJPTA++MotLCNjEe7kxUekek+m+qzgnGBdcT7RQT6R\np9xWGecnVx94d6aA55uiRhgQRyHpdDMMLCOz1be+HvpwHy69DRFZ1+SPmGUt6eW0\nu5yS0vHCu1K22cbrVNXFKjxAOlGcIDm61oQuz7ycl3uAujZO4rZbWt55jilgKGak\new559A5gTp9W+j+TWKIcg6LIZ9zLRlGjcQrWJrsc+OBZQcqiYimSFyO6HhfT9TPS\nPof//I+dSsd+H0SRGGeL8DvSnK+NKZL1q5EX5pziqsv6nZFITpCDwmAN+I8AnXXL\nSNkFi53M8RZTOABpD2x7YPYP1cEvwrRweqV/C/oHcYnpfh7D2DjFeWwXsjeAXrHY\nhgFhPrg+7rf7g6UmJFOCp0dC9sBdyQ3KtJkv7bGqPr854r2cdA7xW0QHWQ2in9qQ\nLhIczc32ECi3ZVVgyF8zyT4Y/3MRS05oX3FHvHyt88mjni6bVaO78F7ZRSha8gHh\nNOAkku7AMXPvUCHaZP2iVCCoAViEso8GeR3O8xh2G42Ai61RLYwx8LB1+23EoJTr\nmfFuRYNSg+qAKCokXNnh+lDlwu4AkaQo3vtKGPXvU7A=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/pierre-alain-b/rainloop-nextcloud/master/screenshots/2016.10.20-screenshot.jpg"}],"translations":{"en":{"name":"RainLoop","summary":"RainLoop Webmail","description":"Simple, modern and fast web-based email client."}},"isFeatured":false,"authors":[{"name":"RainLoop Team","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEAzCCAusCAhAXMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDE5MTkzNDEwWhcNMjcwMTI1MTkzNDEwWjATMREwDwYD\nVQQDDAhyYWlubG9vcDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANqB\n5jnF9qZ/qjckt0kRjpHCOMtJumW/KiQoMeNP5nGv4ad0DS3KemOapUef8Zn7qCYb\nMnODhK7HBwPifFzI1j8bnT2hP6E0geFLb0MdN59d2NF0n4CCs1+BnepQPJ1kFbPK\n35wQRi0RDeTf/GQ+/owEVCU9a9W1P/VUXk8Z0vMoQxCXEdRqnB63SgsKl7DB9G/C\n4SYrgGor+OHVGl4ntMZhJujiM996DttrNK3iZRGkQ07L+lfUIwQ52XOhQNRdic4p\nB03lw7PpChwPGMv/EEvdR5HpCJQBJniqJbbu3Jh8bMBKTE/8fCzN3vMXICB2g3Bq\nlKkZW6fnJRGsrZ79fsQnl+WBPNSrWRLOxOfe1fyCFV1ljFB4nTH7uF3pC8ZRgJes\nkHIESHz3GJm28hn4+17ESMGHBCbs7L9FK2GY31cobU0VRntLxpSG+d9njbIAgMG1\nS7U+oKVFQhSVpdXNOaUNqhcQ3HkbQTLEP0k53A/lhLQb2+KPd8nntaELjwNyrmZg\nsVMgHj/zdlvrbguZjZFzUzDBFvkuv/5M58lNT/D1C6ufVp/R6eLsYI+nnk1ojAjz\nl7N6U8X5SXpD+Bm7+Kn1PH+bHl7cViCx8oXJXO2RhP+COXckw7BDZKtjItYHNG7M\npFwgYqWpvCu9LN6IN5a/eLqSI76dOOP3iYbaTH+NAgMBAAEwDQYJKoZIhvcNAQEL\nBQADggEBAGB0Vq0l6ndGTgNbZxSEFyBR3u3tiR3pWK81DYjsui7qBoO6P/BaGmf+\nraSwHPaBOwA9XNS8jcGLh5xdqY2p/m0dTS64xNjVL9nweWsG+FwVnPANo8C4nXdm\n9ajJ4cdg54stQK8qn1uh/xPcd23GKfYJazjYSwYmZ3pXXdzlGN9NxkeYJQxJ6B+5\npzAeVGiABI/e5URpxzz2UayRX7EE+vtpe3B84hzkLqsq0N39ZN6KLfaTyEBGLzqE\niLYeXQTV0XSRs8xVt+iyGlj7nPkv2DR0oCqRpWUFWeSBI//niDG5WxS3qg8kacSW\nfDSYhSN+IjrnIkwNtc8V9t7/GeQB5FE=\n-----END CERTIFICATE-----"},{"id":"richdocuments","categories":["integration","office"],"userDocs":"https://nextcloud.com/collaboraonline/","adminDocs":"https://nextcloud.com/collaboraonline/","developerDocs":"","issueTracker":"https://github.com/owncloud/richdocuments/issues","website":"","created":"2016-10-31T08:55:45.631429Z","lastModified":"2016-11-24T12:13:53.905352Z","releases":[{"version":"1.1.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=8.2.0 <9.3.0","minIntSize":32,"download":"https://github.com/owncloud/richdocuments/releases/download/1.1.3/richdocuments.tar.gz","created":"2016-10-31T09:03:40.389355Z","licenses":["agpl"],"lastModified":"2016-10-31T09:03:40.439510Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=8.2 <=9.2","signature":"s5giQeiU2zwV5X6FmxWXiG9LtNDeKBlFqK+hfvGNbGZ+nic77Y+AnXHodV4lb3Ko\n0C0ThFLuafaZRdp9rBIN2K/acCfCYKJewGuYErb7FlEl+P9J4OQbb9pva0htZJw6\niuG5eyeTufi5MKB4vuj4+jo9zhepOFAtZMa7o+ZCfJkt8vDBuq5AXxomEiZRtW+n\nf9PPUnq0z7DJVwINhHvvBZJlSLjkpJ6VIHAr+/ElWr8O/mDKq5S5ohbvpDcPqR7b\njnsBckFDLFUz1FX9dA0JCJEKMMfkcfGqZcjH17NdjKAxRW2soN5cEKluu5MkOhz9\nFEPKfshzbrfUIm5MaFGv6w==","translations":{}},{"version":"1.1.14","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/owncloud/richdocuments/releases/download/1.1.14/richdocuments.tar.gz","created":"2016-11-24T12:10:13.337165Z","licenses":["agpl"],"lastModified":"2016-11-24T12:13:53.963638Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"prDGlfRPxqT6LP0BsAFPwGww7P4Bngha2N4u5B6+F02N+RVOjGtTcXKqvM1KjZb1\nCo7qJvgJmjpvIvDmB+rup02i8ObfwP2ct6UdsD7ouzOWJG2sJANXK31bHyvOmQ2h\nvKu5eNcOkf+WFyFKYi51TbsfWn2+1Wge3WWujKAVcEvqtcOOz+uMWNtqzBptEupk\nE1aaRnQfTx488YB8Ubul06LIY0PNCHgGCWPgy817tOVT7JA+V0P0FFonl/PXE0dr\nWgtxRJmvGaNiFzYq+kQmdKMfayZTm3kdVgP0W52t5wp878K0i4s2KPg5lANvjTz7\nDCT+VV2IGIE52o4RpMUGyQ==","translations":{}}],"screenshots":[{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-document.png"},{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-app.png"},{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-presentation.png"},{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-spreadsheet.png"}],"translations":{"en":{"name":"Collabora Online","summary":"Edit office documents directly in your browser.","description":"Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that."}},"isFeatured":false,"authors":[{"name":"Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIDCDCCAfACAhAZMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDMxMDg1NDExWhcNMjcwMjA2MDg1NDExWjAYMRYwFAYD\nVQQDEw1yaWNoZG9jdW1lbnRzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEA1jk29m6JykcJ2Ld0YEpjPMYh6kwxY6GysNJnfkA/th7tPWL3+vBJ9oTYyVnZ\njwAE1Cqwfa9MyBKMZ2IdfIqtT8PeWzuFP7Ib942EdxUpwwh9F3lykeGsj0h4zQwX\nF9OooiS99PfLX+JpkKm15Ujb00iLB6xQmq0+3NeOT1CTD1ziJ1ueOcxBKMwaFp2a\nPuz3F5ywqCvpmxG/OBuOs0LI3/zStXhBNbUMxBrWblr7zaVNJXl/I2JCKj8Wah/H\nXUEEGbW15fAUP1f+90eQSxpEoCZDBHXOQCTJYzySGv+BjU+qlI9/gS0QbrsiyzUf\nO5lyvi8LvUZBzpBw+yg1U75rqQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQA9jU3m\nZmD0ywO3MUsG/GLigFtcWi/p7zp2BliR+NpuY2qNFYDcsIb8ZUudmUc/cJRRctzy\nAPaLLj/d+h5RFaxjTVvim1PSe6M7urK/IMSvyUVYCeQRYpG8ZJixKTCOVIBaWHMz\nxTfc51tm9EPlpJpK6JtaWrYYoWGE3k9sINdJ4JkvKkE2CBAqVhX6ZGyEQ0bnEhtk\nRu1DXn+LW7TJ4NZ8VtLWvmW/6Kfmi7dQ1V++Kmn0lO5ntRt5altePbStCHC8bhGp\nmyBOrjhrJgLIwvgH26MYZhdiSkFzoE38nMPZdrUmUDxcPCwucWJqgzDPudguFthj\nWCVZ3TTG/2z3+tWM\n-----END CERTIFICATE-----"},{"id":"ocr","categories":["files","tools"],"userDocs":"https://janis91.github.io/ocr/","adminDocs":"https://github.com/janis91/ocr/wiki","developerDocs":"https://github.com/janis91/ocr/wiki","issueTracker":"https://github.com/janis91/ocr/issues","website":"https://janis91.github.io/ocr/","created":"2016-09-19T12:07:49.220376Z","lastModified":"2016-11-21T11:22:21.024501Z","releases":[{"version":"1.0.0","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":"*","rawVersionSpec":"*"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"}],"shellCommands":["ocrmypdf","tesseract"],"phpVersionSpec":">=5.6.0 <8.0.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/janis91/ocr/releases/download/v1.0.0/ocr.tar.gz","created":"2016-10-24T06:50:43.283900Z","licenses":["agpl"],"lastModified":"2016-11-21T11:22:21.269108Z","isNightly":false,"rawPhpVersionSpec":">=5.6 <=7","rawPlatformVersionSpec":">=10 <=11","signature":"CBJkCIiUKyf2NuWfz2zJ3grhf8p7wJes7DPV/OxUzhlxIH0Fh7K54+U5A9JOOi6f\nWPhjXG1ylkyIVY1glr/B8svWNsD4jAclpnUi1/9ZW5UPT8LnRBfTbtF9Uoj0OgNs\ntsGQYbpuREoHnjbJWTRe0kq1OsOfX44xuf8PuX43B+lpQPW4iRSSz3ZIhdPcDGq1\n7pyqQM7gdKhBQ6/tOiwd7Enyt5Hi4V6jhwhUOCYeTNiLD2V3yKL+qA9DzpXUfNNw\nLGTjcaMrifibHQIZBZWbPPMmCfMJZ7GO9oR4gWHwkhWqt0yVWAJXAHJBLd5vXC5I\njtRTXRpHO/k6Dtqem8tZCVoDE5MAC7fDZ/0XzoFiXHciP6MenVasVcXo6xJOJc5y\nGsrecNftUEhP/ngxA6lMBVkLmmdpiexVisvsavPi64i34OUA6qOuxjgNVBDwg56i\n2lOEVvHa3nn0UX7ZZoQ/Nu6Mz7J3Hx/VDlttPuWe42eeJAphyDGubT1M62gW8dVB\nD3tJOF7spnK6I3BhVLviou/zs30AIRVBDTU0Orzx78cbInwy6/vyJib2a1olAaHz\nv05SzlQRnBWM4jYBe0mA/2ds9AO6VrXGrT/iLlHemj6JYoGBM185TGewA7OJyX3a\nHSlSDqaremmi+aS3onx3AKhXykDxTRkMVarePwTzzFs=","translations":{}},{"version":"0.8.8","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":"*","rawVersionSpec":"*"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"}],"shellCommands":["ocrmypdf","tesseract"],"phpVersionSpec":">=5.6.0 <8.0.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/janis91/ocr/releases/download/v0.8.8-beta/ocr-0.8.8-beta.tar.gz","created":"2016-10-10T18:01:16.076330Z","licenses":["agpl"],"lastModified":"2016-10-10T18:01:16.169733Z","isNightly":false,"rawPhpVersionSpec":">=5.6 <=7","rawPlatformVersionSpec":">=10 <=11","signature":"uEvhHfQCrzb6z+QuOoO8rYXiMsZFkrFWEqDvTyOTSgFKvo7dVoj3EfDfaApgcKEB\nIM/SqjLSO0lNhrp8F2mST3twbvLDprKsfrDWKFE6eiH0yKl2aNB+cHWE27utARaX\n/QZBD114vbWeDnbaBa4b9OwtBXDqKJrnO1LmqSLFP8guAlVTkU1jSPkRTpmwAcAZ\nJA/aiN/D2LSGfiNp/YdeTuzU+gPINIs9dCb6+PPkyam8PCBaXUSSaW+c0lAQHln+\ntb3EXxZ5YXdjPWrpEyHvFLk1N8s/w615QoMxr5fEs1M8D29aGbcL/wu7LXH4X0Yn\noiWwIFbpfrpJQlrIFumxWZR74JXiNr9J7ijnQ7SjxdHCcrLxMdnZ2cwq4iD6PnYm\nnIojhlhPOqUIzsWYCYutLWDQbUQz9eyWbj/+7XL+5KjetUUr/MnCu6xJ27IqFbAX\nHc8KRCO+9I0/qMQ2/rCZXBMeo39MGhhkgkVl5YAKwC1IEN/jlfyVNXZwYlfcHLKj\n6aNQ4zN6gGOerWWZ8qXtOeNJN+qv0nmXUKrZdnZUAhxOdB4G9Ym+JujxJZ9yNIWV\nsiqAI9J+OIzCwv/dzZhaHadONoo/RTF+Fl6Hy56HyBtMehb8w9p8ksVediqf33yt\nFAE/tzKtNK5NiRd+8MZkq/GbocaFUv3C7Y6pLMpTE1c=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc1.png"},{"url":"https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc2.png"},{"url":"https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc3.png"}],"translations":{"en":{"name":"OCR","summary":"Character recoginition for your images and pdf files.","description":"# Description\n\nNextcloud OCR (optical character recoginition) processing for images and PDF with tesseract-ocr and OCRmyPDF brings OCR capability to your Nextcloud 10.\nThe app uses tesseract-ocr, OCRmyPDF and a php internal message queueing service in order to process images (png, jpeg, tiff) and PDF (currently not all PDF-types are supported, for more information see [here](https://github.com/jbarlow83/OCRmyPDF)) asynchronously and save the output file to the same folder in nextcloud, so you are able to search in it.\nThe source data won&#39;t get lost. Instead:\n - in case of a PDF a copy will be saved with an extra layer of the processed text, so that you are able to search in it.\n - in case of a image the result of the OCR processing will be saved in a .txt file next to the image (same folder).\n\n**One big feature is the asynchronous ocr processing brought by the internal php message queueing system (Semaphore functions), which supports workers to handle tasks asynchronous from the rest of nextcloud.**\n\n## Prerequisites, Requirements and Dependencies\nThe OCR app has some prerequisites:\n - **[Nextcloud 10](https://nextcloud.com/)** or higher\n - **Linux** server as environment. (tested with Debian 8, Raspbian and Ubuntu 14.04 (Trusty))\n - **[OCRmyPDF](https://github.com/jbarlow83/OCRmyPDF)** &gt;v2.x (tested with v4.1.3 (v4 is recommended))\n - **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** &gt;v3.02.02 with corresponding language files (e.g. tesseract-ocr-eng)\n\nFor further information see the homepage or the appropriate documentation."},"de":{"name":"OCR","summary":"Schrifterkennung für Bilder (mit Text) und PDF Dateien.","description":"# Beschreibung\n\nOCR (Automatische Texterkennung) für Bilder (mit Text) und PDF Dateien mithilfe von tesseract-ocr und OCRmyPDF ermöglicht Ihnen automatische Schrifterkennung direkt in Ihrer Nextcloud 10.\nDie App nutzt Tesseract-ocr, OCRmyPDF und den internen Message Queueing Service von PHP, um so asynchron (im Hintegrund) Bilder (PNG, JPEG, TIFF) und PDFs (aktuell werden nicht alle Typen unterstützt, näheres [hier](https://github.com/jbarlow83/OCRmyPDF)) zu verarbeiten. Das Ergebnis, welches jetzt durchsuchbar, kopierbar und ähnliches ist, wird anschließend im selben Ordner gespeichert, wie die Ursprungsdatei.\nDie Ursuprungsdatei geht dabei nicht verloren:\n - im Falle einer PDF wird eine Kopie mit einer zusätzlichen Textebene gespeichert, damit sie durchsuchbar und kopierbar wird.\n - im Falle eines Bildes wird das Resultat in einer txt-Datei gespeichert.\n\n**Ein großer Vorteil ist, dass das Ausführen und Verarbeiten asynchron im Hintergrund stattfindet. Dies geschieht mithilfe der PHP internernen Unterstützung einer Message Queue (Semaphore Funktionen). Die Aufgaben werden somit getrennt von der Nextcloud in einem eigenen Arbeits-Prozess (Worker) abgearbeitet.**\n\n## Anforderungen und Abhängigkeiten\nFür die OCR App müssen folgende Anforderungen erfüllt sein:\n - **[Nextcloud 10](https://nextcloud.com/)** oder höher\n - **Linux** server als Betriebssystem. (getestet mit Debian 8, Raspbian und Ubuntu 14.04 (Trusty))\n - **[OCRmyPDF](https://github.com/jbarlow83/OCRmyPDF)** &gt;v2.x (getestet mit v4.1.3 (v4 empfohlen))\n - **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** &gt;v3.02.02 mit den dazugehörigen Übersetzungs- und Sprachdateien (z. B. tesseract-ocr-deu)\n\nFür weiter Informationen besuchen Sie die Homepage oder lesen Sie die zutreffende Dokumentation."}},"isFeatured":false,"authors":[{"name":"Janis Koehr","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIID/jCCAuYCAhAKMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYwOTE5MTEzNTAxWhcNMjYxMjI2MTEzNTAxWjAOMQwwCgYD\nVQQDDANvY3IwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDDpXiwec4f\nXAT//7YBPSb4z6ZsBJSMfBq0VTL/HagjJnQ7BL+WagzWlS69IStNDqlIlenamYRX\n4B40heJIUinzYKjTRbr5UAw6MX29HibZccm/qgrk36o1XTgIsoRhmvSxbXDVIo1k\nbDOJN8gc2Gvswa8X+uOe9pfcDgAdqGxOvFnoKW89GnB01pCNT+xakNErGAFqVLsr\n2AeademAZnbxJ1cB54tQn2Bygb/7DKKY8EmFfIq6/27n9Jbph1FG9HIlWRT4/M2H\nU2pG3cCScWMEBPsW7kpfpnzLk7Q30Oj6k/rEYjJgmNYgg6oVnn0D9uRmhBYBnGyx\nMab1ilsK53lyuzQY0pmU8V5ULqpnNFAK6DVFfofEamDUhBPO+TZXEA5cZmuULRpf\nQQXmGpUQSyV6pS9WirMIqXFp9wmQ4vtjMdhu/6CP7cmtYZdq9uOhWEHbQM0mZUkb\n8hMjeItPx9XITI7Cge1JUOI8ZIwiB3USnQXcMd3v82l++/VgqHB7s5OaKPhygsWI\nM6RCoBcGiuQB5/fEUOg5ACOpGVyJiBda0Mi57AdoxdJmfnr7Bxcf2tAWIJL9Y7T3\nE1+V2BMxJOWwvVz26Cq83F41yXK2hJS+SbfQTqNUR8Cfh50CS9POvgRxNrJK9yvI\nkKle3ITRtGVM1XU0njWjnsdGg3D3O2mmjQIDAQABMA0GCSqGSIb3DQEBCwUAA4IB\nAQAbFddMbgfPI1szT57V1FKZrOrdYqQ7qjewlIQOzshGydbMtqS/9XL5hYocJCMt\nY6w+C/i6iEzO2Jx8D/k4rcZMXoVR6y3ZvO0Ke0gzSRsU+5eYj2FK1VV+cNIQW5Iu\nCYYIVa7pVPVHdeQH2Bba680bLV0HMF6b1fI9IwkfdCAinvCYZLjyEXZlmB7YjyA8\nHR7qPCNz4uG2Va7mlUHE3UYUYnlv8JFOV3YdbVL0nxhWwIdzSri5sxFIhdlabpzY\nyA1z/MCBEyTRo80jxFmL+MpwbsdbUJi7Qxlnd56zb6HHDGrLHXZTh9LXgyVbnhWL\nkxomWjIXQh4aMHQL4QF7U4EK\n-----END CERTIFICATE-----"},{"id":"spreedme","categories":["tools"],"userDocs":"https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md","adminDocs":"https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md","developerDocs":"","issueTracker":"https://github.com/strukturag/nextcloud-spreedme/issues","website":"","created":"2016-09-27T08:43:07.835196Z","lastModified":"2016-11-21T16:51:23.703819Z","releases":[{"version":"0.3.4","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz","created":"2016-11-21T16:51:23.689599Z","licenses":["agpl"],"lastModified":"2016-11-21T16:51:23.826509Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"Mhy3hXeGWlIujx1Op39MMRdqHYOo360BCwr4FPWoTNNggH3aS0gWlh48DAfGYK9W\netNiOqIuRyA0NrVlsqR2vDILgFtODJSbKPyHd3PQn3hcGsjogjQ+dkKciLNLinw7\nOhbv6aDdRFLBeRHpX/7wOnWL5W3ko/gyn0Awvi88M9+nC5aARtqncQqPy2SxDGzH\nKlOZHSNDnEQCGMhA8hNWWKdVwNUJHod/wmBWpW5QVNSJq5DqrKZcNwpGM2UUJoql\nEqUMwDXk5uVH5r5k62Tr9kguDWoUEG1OqQSyeMY24AmA64tq/HSlAdZ+CX32bc4E\nZvm+n8poJBrdSVmWEaa4ZfYaLFdOc6Kcuid1B1Sv9kPhD9WD6T1sicdzjDzcorBK\n/MLReCuSb2E8aPTnFWRoAZ4xCUGs1IXzX5fmxI8VdzwR42R6RhGJ/rqMuZRFenZF\nbOks45K5gE1da4QpkYOUQa3GVMNPqPiT3CqjmJ8tjxq7bGpb6v+YoCLACjjPpPZL\n2Y28qLxwHVaINDFUUxD75WWdrlulRbqHwiSw8jolP9qrpXhDuLAqYam9tRwV5K5R\n8uNawnFwWkicBEYkN/WtBTouWzehOPn38tHXov6SyEyD6lkuxUBZrsGQ2ru+t33U\nk0kKCbV0GFw43I+3Ji5DiB4TUVNZYVoPG1B7Qve+UfA=","translations":{}},{"version":"0.3.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <11.0.0","minIntSize":32,"download":"https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz","created":"2016-10-20T09:09:26.520692Z","licenses":["agpl"],"lastModified":"2016-10-20T09:09:26.666738Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=10","signature":"D62Ck7JUnrYbrfFlX7xXVaYUMZIh2acmykIKapqfemD/tuX5Bvb08GYGTeFG61MA\nQzsqcIylDfGnC1UJbf8yWEX7PbyJD5w/R4WlbFv34njDvM8rBs4HpzSjkqQoykOF\nZpYAjH2ydfKqtZadgoIRm7et5B8X2AeoGg11ec52DId5t1wAEBcDIv824CDBUt8t\n0pVY8Z8n1MUYwU7DCjCbPy23br2+EBODFCHp+cFfMBLg3F0BJI5nY3Q8ku+0tqMR\n0NDxQcscNZ2Ck/wpVDWylfhpS+ICIxSMiyq7urP593mRrK3399SUyaMqDfgl/pxo\nqTzdBxHLaAqcnKZYglbqp+Gxbyj4teqCod8TiSMlp90VaxhC72ACuVQQRWQKuTNI\nZeW3YweWB5d7VErqBNmQR1tGnX5YFFHiKo41fVDQFsrOqHx4zP6AeU3nkl2ol/r/\n3pg553so1MOxMkyLEhGYGMfrdQqVEtajNWHUdj3B73LS+M3jcjBFIdOD+AGXPtDX\njCRymt07c1znhkL+aT8yY5SHMVbKBZj9mExL49hcLjAYYc4U++60uq9MFH5r9g4T\ndph+yT6VVEM/UH2HjvKsHv2wm937sNgG3EXQdh79JU8nCXIz7cVrJ8f5/9r6n1VP\nBbjtfDAPEjmfVCXX2gmgLuZHV+GMhLBS9bTh+61AhhE=","translations":{}},{"version":"0.3.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <11.0.0","minIntSize":32,"download":"https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz","created":"2016-10-06T08:14:05.212553Z","licenses":["agpl"],"lastModified":"2016-10-06T08:14:05.278533Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=10","signature":"X9zXDyMBPoXPMpZ+XXWK3MLufjY2MG8lJ+93LiW3rv0iq9yd8PafK4IvP9czO6o9\nf/vNilq+1mfl6mjTvL6QF5+sySlzbRGbT3uTBwYXyYL07HVYgl1ZLrwe0kxvxqaW\nxTvPem7+HzwClI3VnWc7ylQfzGrcYIaSIg7nNq1GOHocsgZVNyj/nVW/eQx24MjZ\nuLzZs9SJqYoBGq+mo63vRswhqv5OzGebo+G6dHm0hvRSOw9qsWCDWBugiSRU8zU4\nD9PQ0e8WbyrIrQhBoUvvkuijO3zCySx606S1HUyaHmbJzMc4Fbpwz6ggmi6IRBbT\nFBKB1DWJDwN/7mY4fhS4KhircVnAHDqiBVCTu5i3pSfMPrwFymcmbn9OBuFHAFuZ\nd9PZvWQg4v32w+Q/NNvZVW5lRi+l0w5DEqNREaj79hljk2reZMaB65lvtV9NCYw+\nHmwWqsGqZ1SgGZuhYkOzEIkCfJ2fF/VpyavJ4X6bHP9yYdkt1pxnSSoZ2HC8mkG4\nBnPf28mEXRcY8EJv0rEePqKSBIhAt8yfEW+joH/8nupe1qOdfPvP08ifLad5m76s\nt23UzlSljzq9kVO+d16z2uagKomN9USZaNnJcUDVblfjvCPpdiHLfRPEJnRsDZCm\nNffFWEMcz+TWmwBboZgTRO9v0bPDEuwfCCEW0zy8rT0=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/conference.gif"},{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/presentation.png"},{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/import.png"},{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/users.png"}],"translations":{"en":{"name":"Spreed.ME","summary":"Audio-, video- and text chat for your Nextcloud","description":"Securely communicate with your friends and family using rich audio-, video- and text chat, and much more right from your Nextcloud – in your browser"}},"isFeatured":false,"authors":[{"name":"struktur AG","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhANMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTI2MTYxNzMzWhcNMjcwMTAyMTYxNzMzWjATMREwDwYD\r\nVQQDEwhzcHJlZWRtZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKLx\r\n2dCPBLIgX948BnOdLij0YyI2+FKD6uZOvzxMaoi3rlxNf8MJgraNMzTBWEXtxT5b\r\n7ZISNp89WEXhaQ1dwwCocodd/xow4Ek63m5nUvTZXsm+YSbMgrFbxzsBhYU7KuIE\r\nT/jhKdzYgemzErwwN/gtwkLMfPo3jkgg6c8NPPohYv6k7V4VnsqtJ0JS0kX19FqM\r\nMiNz9XkcncBHy9x0BSxy4+YnwbFcgIx/MtYKlBL8NkPuuJaB/6C1O+IPYhdEdnpX\r\n+RaIue71nSStOYOqT4YDqHAIw7EmqgA1my09mmK+0Pn92GJVEAEN7JGBSQ+F32RI\r\ndB3ivGAOVtUtVvJlepWdbHxj1xqeP+LCjWzHMLQjm0TyH8VqU4Cg/wxwAEFnBATH\r\naOaWwrggzY2d9KBo1mp0k71NArLbBdlHykFU4bgiSDWrXXMz0fZzLQVwGI0Eqcxc\r\nouf6t0kvrK8oKjrnso+FjBoT7lHV/H6ny4ufxIEDAJ/FEBV/gMizt5fDZ+DvmMw4\r\nq+a088/lXoiI/vWPoGfOa77H5BQOt3y70Pmwv2uVYp46dtU8oat+ZvyW9iMmgP1h\r\nJSEHj1WGGGlp45d10l4OghwfTB0OSuPUYwWR+lZnV8sukGvQzC9iRV1DGl/rREMC\r\ncQ5ajRAtO5NPnThvN5/Zuh4n8JoDc0GK4jEZsIivAgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBAGHMRbPV0WTI9r1w6m2iJRrMbZtbBb+mQr8NtOoXQwvSXWT1lXMP2N8u\r\nLQ1a8U5UaUjeg7TnoUWTEOqU05HpwA8GZtdWZqPPQpe691kMNvfqF64g0le2kzOL\r\nhuMP9kpDGzSD8pEKf1ihxvEWNUBmwewrZTC3+b4gM+MJ3BBCfb5SCzMURLirfFST\r\naxCNzc7veb2M98hS73w5ZE6vO+C/wz0GTsxuK0AoLitApT5naQnjvxSvSsjFPEGD\r\nsUNUEU2Decyp0jxLVnrrpz6Y5UupfBR0V8yAv1t5Od/mCKLc5DxHsDWiKOpsob9U\r\nJN+bdzJil2NNftihD4Dm7Ha7OS3O8W0=\r\n-----END CERTIFICATE-----"},{"id":"nextant","categories":["files","tools"],"userDocs":"","adminDocs":"https://github.com/nextcloud/nextant/wiki","developerDocs":"","issueTracker":"https://github.com/nextcloud/nextant/issues","website":"https://github.com/nextcloud/nextant/wiki","created":"2016-09-14T14:34:35.977699Z","lastModified":"2016-11-22T16:02:57.758477Z","releases":[{"version":"0.6.6","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.6/nextant-0.6.6.tar.gz","created":"2016-11-16T15:11:14.344704Z","licenses":["agpl"],"lastModified":"2016-11-16T20:39:59.030384Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"aOZeEeThyZ0V/vXBcn6c+Z0vyCsZcN6nfSJ8oWEea4zXh4g705Si+MFZESqix3M2\nOPCnA/U8eASwdRTAEwQJrW5ECmu1THXSIsrzQzc9kFycvyOGzCgAWtuu0ayzZD2/\nU5aDWlzpLHC1Czg9QJ5UnfZR0AfChWQ402N1YzGqMShdJv6AHXFrVE+uYnIyxuYI\noPJQBUYbQwthVUjpYwFwSxw50YU17gmx5RZ0Y0OPz3i/EiuEUrxopXtfDVYAuCML\npDw37LOTRQ2JqxSU3teALh8LcrwJbTeOP0n4bTeV+vU3jvtiaEoRrwfVrK41F701\nQymGXy1/EFG0kxPGS2dRNPBAXYLZfeoWlROl3D5BWlbsCcXKU1S+22yn0TEdS7x1\nY44x8jRKnBddDE7qkn+QoQYHNNcxOREsFFLmIoyCUpdNOdDX2PvTFUYkIqdnXaJy\noAKv2GkvWPQ0aiiBtA1i4oXuzvHW/M2wOrK7v7DCpNfILrD/sjxpljxcX082nRCd\n9P3iPd2hQ6yOM9fG21LVN74b6wggI81BzFf/xJPd4ZqYLjfeG/yqd0zaiMOzMm1W\nse+kc/a4iB3BoCNX3E942pBBzew4ya8LkCXdCHUUsuelDf1va1ikTh/G7D84ll9/\n2avNqQnUh3hgOnxFCLI/5VrbqxfSTVdO6O/LTuAmwgw=","translations":{}},{"version":"0.6.5","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.5/nextant-0.6.5.tar.gz","created":"2016-11-09T16:58:06.856332Z","licenses":["agpl"],"lastModified":"2016-11-09T16:58:07.139404Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"DVOIbLEVggiLkNkuPW+pXqu8WYT15unUsMoqHSw81NiU6HF0Nuf3XiwnHJJDDqo5\nyX+QyHADO4ZiQpvXhGigvwD2eS1jVLatAztyxE0tEQv5eBU/7R0jQYxI8YCnC/jE\nZDa0qs+TI58EkDek0LBzueVQqrLubKgGU9P+E9H8gbWi1JHvl/2LdY7CplPqaJ+J\nMRokobPntzgx9m4DZC1RsCoXzSON7o2gp2cmunPJiXVHPhMUfIfolGEbNGJ1/xdp\nra7Y7XkPnDx4po98a38UpUh1x/2m5goOV54em35bWbh4ShNDykiE5ttz6tOywlYN\ngxceSsStTKyqscVaOV2Xu6Ive0pY9CInvrSfRnRktIWBYDyWdbK9sJuqs/s69kqn\nKQ/SjzE2smw0zwOUMnSaz0Jzr1vdPFgNu2xDYAVQO5G03V+wQ5AhxuhBz5Xp5Fll\nLaOhymZLCC7lq0DUqkeTeQ2QCfiG23hvG2VUPsIqW7xFe2YzKHZVXi9JuH//Gwym\nDmJmcyZDMvNwNiObx3ZRKsZNH2XwbldFZ9nTpb9AafyoSR/qbwd473NewaDLRTiY\nLrOP5Wx1xx6DOkRmDF2l2iT1bSJ6eoAoWQU2I0aYRH9NAr2Ugd4f2Um4o61EJaL+\nRHT9cERRySEloU/NdgmZEOi+CG0rEu+9LC5G/jGlHE8=","translations":{}},{"version":"0.6.4","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.4/nextant-0.6.4.tar.gz","created":"2016-11-05T18:17:47.622023Z","licenses":["agpl"],"lastModified":"2016-11-05T18:17:47.678445Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"RdkvnhNjw+kAnT6Or3+N9FzAv9DjJ9BAlmgANMwZZcaqo1gZRFewsGD2Rx1KEb9X\numSC28tl2B5/3r/+dprVJmOnYJny/7+kDmI/d+vigKfnaQJOUZ0ya5+f72pFgow7\nth8fw9rX/3+zIBs2IeEN66cis8ioFq97BJDsnDMBDr7wl7CnFJjYe6eviWuiFTnC\n4sBXlYjHoaIRRu561nwAooV+WXmWsparYPVhj2cXdyP/CnWo5HSF5jA51WCsz7Up\n7a0URXdh85xmxEbZtnjUymTW2BIegdxj9Erbfiuy/m3ApgnP+DiEQRcM13J7pXqg\n4cgFOBSzKDZgim599WBW2uNO1ztnDYOzz47GXDfJhcdvKiZZoQpUF9W4LMRtheMz\nxD9YArO3j3d+VOInSYU2Rpvhugwo1LExhwnRdT4+cOZfEeq0VojiM7yBZLDdEjIb\nGdYUJtNWSU0F6cPab2Au8FgZymLrHL9EpGvxuA1oAwtRxHAgMElJG2O6Jp89gGl9\nh/AptypeTvzNEc9/Kg24ueBKqmSUd5a45pZ3gM2pNATJhUK7fzLb/K6cq/kEzZtj\nOPra1ZfP0/20u8VP32Rgw1cFmIjqt8DFzUmOMpMfyoJkdldtTwQtGk+yIvtN1zp6\nT2zDknAKA2N/rZ/0SJl8KxVVNLhQWtYBJ+rFAdapuxI=","translations":{}},{"version":"0.6.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.3/nextant-0.6.3.tar.gz","created":"2016-11-03T21:51:27.654342Z","licenses":["agpl"],"lastModified":"2016-11-04T18:25:35.697130Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"Hf5GB4xd+rVXzWvVpGbbF5tqmnI+DGHlNHdLYPImFLS/Z4K5wKeNp80E5sd/RkAi\nhyuEsdWHlGDVMT6s7oeCmH/ClyWqLNSz9VH4KYqyFgD4+usHZp9PrEeEKbvPDPKv\nD3eB7Ats34cWcpf4E1oR5wsPicgmdgIgb2uMXzc/1G9xUBRWzocwCstzjEEAB/VJ\nvJuHvhDTGG294P4gOb82MxKCQ8LZ4i1QXzOf/mLETOubiUbZtJgTReYvpdAo2Wct\nbdfDFw13LYZkCf71r9jIQ3PSPlIpD+0BwAlE1fi0Br9dP2JjIfiKN6CGVaki6O0v\nKR42jtcE9xXiAop0Ym1FYMWJvQUy5PFLMwYDfEd6CvfEFJl+fi+RjXNDNZcTyw00\nHa48sACoGzxwts2JknWMU57mwvi0Z4uwpE0cFp/PRzBsXmSlCzWHjJhu7+2qambE\nAabdP9nH2NvqJHUJyPsxtDSrSWCBY4CoL3wYu36UrIA4NepyudMPNe9fhKTEU0bg\n8DLclw6hYdj5p9Zj3OUuwOZLz6r85KwnooTsUjOYkBXvdUuHWkgONqqZlPMApS4i\nChRQ7ysHAinPyyzsvr0PR9g6J52CSCO/7qwSJy6yqSzuSWrbZUa4FVTcKIwWJJPu\nJ2XzB4rWVG1wWjzMM6MIvFbO2HY9upzh651OdOwsYvk=","translations":{}},{"version":"0.6.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.2/nextant-0.6.2.tar.gz","created":"2016-11-01T11:24:58.054892Z","licenses":["agpl"],"lastModified":"2016-11-01T11:24:58.151609Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"h8KgwMh2RGGIp7q/II23VSfE5Ibkha7p/C1kvIfG6QIIc2Zu/Mm3Oekynnysh5ZJ\nZuMTaeWbejbBAmlnxW+AwBWa/s2PoMhv7foVvdtg76l9/qr+9jGvUM7D1LbbBvAy\n/XW6JSrhhBZHOohdU7kwV5Xnwsn/NC/zUe0G4eZ+9fc9uSntkob9wnWvUs2daAeD\nY6Mi7Xt/XAIX65OIVTKfC6ah1SlbXgtJ2i2j4G32I9jRhmbkpt/UJEangn90fHnY\nQXNJ85OyV0aNMafNHoMSL3uLscdvjp0Hy8w4iBeavsRlCs0GiUoG1+YdwTwmC9EM\n4CjbMfRJ0DYK7u697TOmS8MQzk8O7f5THtjeokZlrom2YnV9t6gLvjnxl/+gXPdJ\nmgLixnA8P6tPsff9pquHKQZsvxjv6vVa2DVJc8VpcqJRih7yj/3V7rxesEP7MUnP\nznIOcwzTsKXHuAnvujpCwyQj3QtpQK2XJPQ5WkKgwbTdvriVJfnzPironhcHo1vC\nbuUDOdhL59aySChw2cZGD9lCWaxYR7I1BDDzWKNl9Qg0AZ2auyGUGTv8P2vi5qUB\n0CmnkzkZurR5ju6Nb9/2lcZvda7QJdIdMtm2Wnn+Ak/Z3Y4IehB5PPDP5/MMAhQY\nXE8Jqe0mGtiU/O2346L5IThkS58JlRmep4kYv+II9zE=","translations":{}},{"version":"0.6.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.1/nextant-0.6.1.tar.gz","created":"2016-10-27T21:16:47.066097Z","licenses":["agpl"],"lastModified":"2016-10-27T21:16:47.125641Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"axSX4Kz2P4PbKU676DibjPZsxk8hCIG3lLOmeMXoiBhp3ka4wJ8u5tNwTzgY8/MV\n3mjXe5DNttD66SqmiRNSPKbotYHVFFW3wFK+Dgh/++n/KTomGYUeIwt88Z9ecbuG\nNT6U46jFrfZBYzRHWzbgiJ4c7MCoid9cfmoB7HDuQSyw+E0S2vbLL8+jzMcIzF+5\nTh/sJEterXCyrWSciw/9x98F+4svNbskdEIvrOox3+K6UIhpsojqJR2+bQhG3rsM\nPerOb6J+bzHdLV1ZL/4nWEz1F30T7B08QxY/4pHD68JFQcdtzmHMIhXfCoRvWhN2\nVRnizx3IXBALY4F49Ql6bjsnr6BCp+LroM5RSQ3eupDcqejDJLbjPz8xfOMOwlx7\nz84Xd0MUyqaEkxg1ihsWLbPlYACUZ2aoDkSQUIbfZTTiov7eqTM8UBc/UqVID/LU\nyEW4gjFZzQy6kX76XRAGq1vebKFjCU63asCnVyJhF/YQVTu1hPGbFslkRKnYuh8W\ne4MeaNfbdjcSEX+7oTcPJz6V09pOPvukXL0M1m7lS9PhTisI6oGj8c33GPYp/DSK\n6SGk+ukbt1mwFuFKdTvAMxo1lk96D+pKUv4MX/ralaaoIAmwPTGsSQ04RyL454ae\nU6q8PApwrVyPHYwMBPtXGoQMyb2ZV9rylazYbKCQ8I0=","translations":{}},{"version":"0.6.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.0/nextant-0.6.0.tar.gz","created":"2016-10-26T01:46:48.419025Z","licenses":["agpl"],"lastModified":"2016-10-26T01:46:48.521063Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"W2TmbX/NbbfPPjIJLalO0kCDhhQF1pEohH/CxO9bY+yR+a5NKiTbpAhG2McqpTSj\nmgC4J8/thmwGlWGC+VW+KlpXzzjc7wCgMGMKViOpGD3pIy8p8U5MXTqVgjjrEb9g\nKgr9uErXzxJ5oDfkx8Uh1bUeBJTsAAivGJqMlhBYFGxw8BSB09sfOZytNxo4wbwZ\nNAcYP1qvkUQ8CVR0nInSTRfLvAp5+e/8xxyYZwJIWrdNgpoP0CxiwzKP/VSjBk/U\nsPU4R72UQnVZB0InRCeh/KNTwu1YiPkUKm+mNmt2hCfN7Fm6bY2rUMH7oa8KTkqn\nh52FhbaYRSAR1OPdC5RnHiQWlPh71gq+4Xqgp19Eawnl/QiVteVifSjNQZ+Ban8M\nRyw/PxHnzIWg/OAjx81Jx9mXjUIHSeUxMTJTKTp+lEqIAzjku0iHeU5UPGCfE+VM\nwmopZfnlfk2nLkUwjQXLCIcnZD1ME1m0h/H4Ad0Q/qXpBScUp47npkxg2b8zPIhk\n3aXUmNPLgwyXPWvAuaBK/WwpNefUnqWFns8t2Alpzg/EpC2PrZqciCNDcRFEycoa\nX+JsFyD7eYA7Dc9iIf09gXZX+tZ+Jinb+iPDwYrl1u/7IIBoBlUGCgo+cF7/dL9S\nc3vYeWw6MCH8Sv+ckgS2g726BfdN5EjB/8cb071b4lE=","translations":{}},{"version":"0.5.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/daita/nextant/releases/download/0.5.1/nextant-0.5.1.tar.gz","created":"2016-10-17T15:23:04.515057Z","licenses":["agpl"],"lastModified":"2016-10-17T15:23:04.576640Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"Pp3rC/9RmAYURneGpGit4HZ2t1qH9A9nwsUnGDgRuJ0akIii7CtJC+n8l1b9k73/\nhxMYnp2JOBu2HWKgFp9a3yeo1xphI5hOUdVQ1UZAWxIQyDI1FZVYDr81l7GCdkqm\n2lMxgviFADSYURCgEnAsj9Nt0NZ6LDcJZiJg3iPAjkDI0U+KnEBjtx/XRFqGUnfp\nCUZ/XLHh/hvoEitSHepTBDCMKkTNjbDEwBYfA2rAoz4zbMR5zKLU+1r1DIUgWSRe\nbk2i8TaTDVL4cbb6MhkGKwkujb+Atikvkpi45o7+fyQMs84c6fjjh/TZJaC+dMyG\n1GCikMPwwtEPjXtnLzynERAxJOd5mP4Ee4sD8ZrnzNUehpyFR88pwWU6r+dmiebb\nnsYlGkhIu2aIO2O4HZ4sUTsO5sfjZ9me7jsafhgJl6iG4IBeHa/L1MsSbhsh6mvH\nYsz4Xsluwr0QcFLmSDDQQYynyogKfJZG2xQsadM0GETWgXE44dVeRvMUsILfB4uZ\nmfKgd23SgaOhYC8m4bg5Hxnkl+xHJnyGZ6jhqg7bhuKwsoLymc18Vmjmb7a45HGV\nXbL5CTmw9yaPOBS3v7v91TnlB+0lhlzbKzZ0xIhY55qsTC76uScbTLwndPqNGaF7\n2koxRbJ3jcmf/Z2MLymdRi2BTZbZkPkxgVrSf9plaR0=","translations":{}},{"version":"0.5.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/daita/nextant/releases/download/0.5.0/nextant-0.5.0.tar.gz","created":"2016-10-11T11:47:46.191539Z","licenses":["agpl"],"lastModified":"2016-10-11T11:55:40.393000Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"qzQJSLK8nkrQedwwxUdhxL8bq3aXyppAlWJo+n3GqSvqA8uNTzl3Wsci0LsnBV0E\nDvDNW8K0enhl563F/bywQrDhgKl8jTX/CA5KCxqO9P+tvE80zAfMqiRnQayVcWuY\nSWX6RqfI/kqiWyN1SsFp2EDlas6eb+xfIoiJamlfsN0qzHYOFt5W77wmw2Bn9dB5\n9nwHHyC0z60Pf2pPduc/KuZ/971WrDFaIapL7Gm+z9XoaKSwUT575VtS+RNJkOKy\niBrwnHdc8x/62HPFOXsUYjCt2aEmLzPCQN8Ke5pd3596hm5wbAVzTHuxf2H35tb3\nljfGqAZ5AJX2Xd13d4aHXFdSEILwv6IFq2fx0hO3vkvFEoKF5oQ2t3hi++Mw/h8R\n15OKZCOC1bFH3gTwdshmnHSTSr3LxDeTF60aH16wpXcehQuJHagpb/aG8mPD1w+v\n759/mekqa4LYlqT9TLWTqX3UPeQXYIwcPijG84IvW1BDK1M4Mj2Vqsld4jXwG6CP\nORIL8xoQbA52dQI1Y19JXcU9zxIb6GaHYgpV0wejatsZRfhPv2Yd0CBShF4HY7aw\nnfcm88pqzOKNvjnLZjTFQwuJ0AUUSOsWhgZzYt8tATJ2KDZ+lxz+WAMGXJAC/ciY\ntrrglY7YxwJNLbYp+arE0sowZx+IOVaSZBvmUGHiEBY=","translations":{}},{"version":"0.4.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/daita/nextant/releases/download/0.4.2/nextant-0.4.2.tar.gz","created":"2016-10-06T10:31:12.482416Z","licenses":["agpl"],"lastModified":"2016-10-06T10:31:12.551117Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"QHJhYcBMi5HyPofshZ7EdcXsOfRrl7o48Y3BBBq8CkmYtFDbekghdJqjFbwwZa5u\n8FtgMVwssql/RSDNP6M2Zc/MpQ3K9gDm+DyxE5KRmtMEpzHB+oD+1DxP7kAoyW8/\nnBr5iiQSdLCelddMcTwbdxskLFUXIs3cFuLGhMvr8pdQOAgfxte5lolrj4/8EsJ0\n0yUImgIYG4NlgmvCygGApdpVaOcK7XVtv4oH+x43JmX9YZ3Ce0DQPYPUbFTCf4ZS\nS075j1vcnPx2cRFGxc+YpKzYVVYoy7ZdB75Hq+kaei/atxrTyV5+gcCrVPnH1RkX\n6G8rgu5l8FoGJYopi8/9dd8LsGLFx53CHMdEVob3tFR0WeK4TJAGJa403zE6S3hM\nxr86WCedmjuti0uOhSQr5AEVAoXZ/JUWQMMsPAUMuKEYVjKfmve6TlcNMC2oM5XT\nXcOf4OP3pcQq4ViN53o4Pj6NGSci6IzD6xLeAxKZUoTX37ArVKH6RHS5Najc193H\nRhYRnfE7D5YOr1u10HaZCFCVJif2MgMP0/uH2759NoRjXFowrh7Z6dW7JQG5lbHN\ne0jjJH1Y8m8H1peGGcmM0YxFiOVZ0ER7P+AxT4Cbau/cVhaS8vnPF2a2a6YFRiFS\nVH4aqazvvXrtifDr3lfvlyPCrP/570nwvOJgZGk+K/Y=","translations":{}},{"version":"0.10.0-alpha","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/0.10.0/nextant-master-0.10.0.tar.gz","created":"2016-11-22T16:02:57.740378Z","licenses":["agpl"],"lastModified":"2016-11-22T16:02:57.900805Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"kDO3xbPpoUdl2qo362tXfJIqKeiKE12M8FkMXbdKiRNzuQyvDOehQq3dErALZDOr\nLG47Tpez/Kn9Fsx1y4dQDx0w9SD3pyoqvjj1O6KkTYN6srpitQcj9EzEItCY+MZd\ngRSc7Px9MzxpFpgwtuThGVlSt5kLMd0vjWFLVcv7k07rZfWEsTwXd24INIDtlr1A\nC7hyLB777nEOGa7oAzx8nr+FJcIbmu9opVZk8AL40FOFDNBgfAy2AS9hGZreUmRV\ndV9Zh7UAR+RsEeO51xcU/CKqC8Jb0jL1gkYyUaQy16oe1HF9bRs1PWuNL5mYwsmy\nZNn0ay/a7mb7hxJbza1F3lbgBtodvbgUm7+So/QvaR29CSAqqoUXeQy6FfSBVWhZ\nYlTxdQfKcBcUPFO14BBk/O5p5iQaG8JCLJ/EZGDPDIVDMn7crGQ4oLZJv80eqTeB\n7ueDmWaD3gQ9j2XKsMk1uLSyY4unt9AaTofBylsKD1SjLhyxofGZym4jc2+M1GnQ\nyLcoEMSexnKuextu4nzrA0y5k3z9tvO07R29lwT1GFp6oGAakMLob/6XrGsm3YQY\nRQXgfXKFw8XmXBumqG8ayEIyvQ/O8nO6r4R1H8a7ooj6oWa3PhPsen+gLE0SpJPZ\nz3e2TLliwC4VtZp69H7u3px5Qn1Fc6RMDTh571edCr8=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/displayResult.jpg"},{"url":"https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/admin.jpg"}],"translations":{"en":{"name":"Nextant","summary":"Navigate through your cloud using Solr","description":"\n\t     Navigate through your cloud using Solr\n\n\n**Nextant** performs fast and concise _Full-Text Search_ within:\n\n- your own files,\n- shared files,\n- external storage,\n- bookmarks\n\n\n### Recognized file format:\n- plain text,\n- rtf,\n- pdf,\n- html,\n- openoffice,\n- microsoft office,\n- image JPEG and TIFF (will requiert Tesseract installed)\n- pdf with no text layer (will also requiert Tesseract) _[work in progress]_\n\n\n\n## Installation\n\n- [You first need to install a Solr servlet](https://github.com/nextcloud/nextant/wiki)\n- Download the .zip from the appstore, unzip and place this app in **nextcloud/apps/** (or clone the github and build the app yourself)\n- Enable the app in the app list,\n- Edit the settings in the administration page.\n- Extract the current files from your cloud using the **./occ nextant:index** commands\n- Have a look to this [explanation on how Nextant works](https://github.com/nextcloud/nextant/wiki/Extracting,-Live-Update)\n- _(Optional)_ [Installing Tesseract](https://github.com/tesseract-ocr/tesseract/wiki) ([Optical Character Recognition](https://en.wikipedia.org/wiki/Optical_character_recognition) (OCR) Engine) will allow Nextant to extract text from images and pdfs without text layer.\n\n\n\t"}},"isFeatured":false,"authors":[{"name":"Maxence Lange","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEAjCCAuoCAhAFMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYwOTE0MTI1NDQwWhcNMjYxMjIxMTI1NDQwWjASMRAwDgYD\nVQQDDAduZXh0YW50MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsbnQ\n+9acjKHfcrUj4yqBpD++GmQ5z2Sp8C8uOz4ZbLyM9bUXEYHo4a4u3CdC49kGUkb3\np5MkEAEzslTWDi1eh5MZgPWpbPgItsDsXY1o55O3jtxNkzSG5/yYcPQcuKtIOm9S\n7DY0K+UQt3nK+RrXEZfARMNrzFbEzpE3b7w901Yl5n+m/B8rhW4pqg8uSfx3u04J\nwduV1fHwoHUB0Ox5HyWib4Pq1XppNh7xdc2Fg93JxshwuCPJyOOzrFTnxC7s1yzQ\nUvaqkjPW5QeQRunQjZ2XtpYH8f8v01W18bNEiHwqtFwuDEyCVx1rvEMgUDVXdPkP\ngZrlB5TzGmz0U3HzYvf6205WuzfHxz7kPj502wP51PoZBKpniggKzmuXkx6BpsZC\nZX45VpDHdiATLwRj1t2bMs3C01nzpIWO5ZwFtkepH3Y+mvwX5lDh/XDsqJC2Yo8o\nWMmniWNW7dspufYOsBUqqYGP7rkailgVT4oYk6D1j6oFZ5SSpfPF5lsyYedDSM6y\nbIGVkSF+sjLK6R9BenBijKceAKsS//WwRYCBPC+JHlsYpXKW12bL+C47Kj2/N6d4\nrYryzV6ofVSF6pwIq0oEjoyfBfNpYavf3xrRkSSmIIlPSnMY7DT1xkGD5retxSm6\n+WIfkWKRZpv2S6PhMHGLspYc4H5Dj8c48rG5Co8CAwEAATANBgkqhkiG9w0BAQsF\nAAOCAQEAOZUwyPaUi+1BOUgQJMWqYRoTVZUyBshTXSC7jSwa97b7qADV9ooA6TYF\nzgsPcE41k7jRkUbnjcY45RGtL3vqsgZbx5TjPa5fGMxlqJ6eYBOY61Q6VIHEVm3u\nxnPEO9dsMoDBijvo5D7KtE+Ccs907Rq70kCsbrdgPHkyb5tDSnCKogN1LiQrg1EP\nmy7Z1C7jG9/h57vx0+QBMDCYnTmqLsvMKqo27uHskzAiB7VXLEdSZ2FtMGHkLUQO\n0bfhnvTZ2VhMmK83t7ovo71An4ycmsolGD/MA0vNI78VrVISrdI8rRh2WntUnCBU\nEJL3BaQAQaASSsvFrcozYxrQG4VzEg==\n-----END CERTIFICATE-----"}]
 EOD;
-       static $expectedResponse = array (
+       static $expectedResponse =  [
                'data' =>
-                       array (
+                        [
                                0 =>
-                                       array (
+                                        [
                                                'id' => 'direct_menu',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'customization',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -75,28 +75,28 @@ EOD;
                                                'created' => '2016-10-01T09:16:06.030994Z',
                                                'lastModified' => '2016-10-06T14:01:05.584192Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.9.2',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/juliushaertl/direct_menu/releases/download/v0.9.2/direct_menu.tar.gz',
                                                                                'created' => '2016-10-06T14:01:05.578297Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-10-06T14:01:05.643813Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -113,36 +113,36 @@ bkR1DTBCyDjdpNBidpa3/26675dz5IT5Zedp4BBBREQzX08cIhJx5mgqDdX3CU09
 uWtzoaLi71/1BWTFAN+Y9VyfZ8/Z3Pg3vKedRJ565mztIj0geL3riEsC5YnPS0+C
 +a3B9sDiiOa101EORzX3lrPqL7reEPdCxrIwN+hKFBQ=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://bitgrid.net/~jus/direct_menu_nc.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Direct Menu',
                                                                                'summary' => 'Provide easy access to all apps in the header.',
                                                                                'description' => 'Provide easy access to all apps in the header.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Julius Härtl',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -171,14 +171,14 @@ e/zxnB1EmeI2X5D2xceJDLB7Fy5W0EGrLixRIdFaSUommWFUm9E2hSIaNlziSBdc
 G2dF9Gtu4GiQ5fuaJknaxlgXHovfqeZwZJX9o4M+Ug81AqiY7XjdiaCPdh0Tthcx
 2OmWZo7UBREWenjKyFZZ/iKoqH5sdenBtpo=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                1 =>
-                                       array (
+                                        [
                                                'id' => 'apporder',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'customization',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -187,49 +187,49 @@ G2dF9Gtu4GiQ5fuaJknaxlgXHovfqeZwZJX9o4M+Ug81AqiY7XjdiaCPdh0Tthcx
                                                'created' => '2016-10-01T09:16:47.111889Z',
                                                'lastModified' => '2016-10-12T19:50:16.038821Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.3.3',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/juliushaertl/apporder/releases/download/0.3.3/apporder.tar.gz',
                                                                                'created' => '2016-10-12T19:14:10.802359Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-10-12T19:50:16.104357Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
                                                                                'rawPlatformVersionSpec' => '>=9 <=11',
                                                                                'signature' => 'nhlT9lhrmBxIsqh/e3RLm2NDw/U8ZvvoMyYQTLMM3H19DQmVcPYPYC9QWVTsowUzXblVaOXVGylbpKma9yOlOAqJtF3qyXecLl4+tA/Awb6BBhKPgHFdcLDAL5yy1K7/uei3SgEojMlJoI9vEK5I1C5YTh43yNH+//Im6MAuNYFUTlMXK426zdOe6ogpCI5GlYdXopqYANxcpT+WXWET6DDSM5Ev+MYwMcSAY4r8+tvARRU4ZAenRgjkBT6R5z6cD76emRax14tbV6vkjjwRcO+dQtM0tFPbd+5fsNInbauv50VzIMgjA6RnKTOI17gRsSdGlsV4vZn2aIxEPWauu6T/UohMvAE9HMn13vtbpPBSFwJAktj6yHASYGzupNQLprA0+OdyALoLZPpQAKNEXA42a4EVISBKu0EmduHJlUPeqhnIGkkGgVNWS8AWqzP2nFoPdXBgUWateiMcBTHxgEKDac5YmNc9lsXpzf1OxBaXHBhGYKuXPwIfyH3jTWb1OdwixJEuRe9dl63T9qOTRre8QWns/bMqKLibGfMtFhVB21ARJayBuX70eVvabG/2N7Y5t1zUlFygIKu51tvo3AVCRDdRrFWDvkAjxzIz5FIdALVZ+DReFYu/r4WF/w3V9rInFuEDSwb/OH4r8sQycs07tSlMyA74Y3FpjKTBxso=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://bitgrid.net/~jus/apporder-nc.gif',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'AppOrder',
                                                                                'summary' => 'Sort apps in the menu with drag and drop',
                                                                                'description' => '
@@ -252,18 +252,18 @@ personal order by changing the following parameter in your config/config.php:
 Users will now get redirected to the first app of the default order or to the
 first app of the user order.
     ',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Julius Härtl',
                                                                                'mail' => 'jus@bitgrid.net',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -292,14 +292,14 @@ CSKtBro2jcnxzI3BvHdQcx4RAGo8sUzaqKBmsy+JmAqpCSk8f1zHR94x4Akp7n44
 Tu+WGOL2Ee5U4k4XFdzeSLODWby08iU+Gx3bXTR6WIvXCYeIVsCPKK/luvfGkiSR
 CpW1GUIA1cyulT4uyHf9g6BMdYVOsFQ=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                2 =>
-                                       array (
+                                        [
                                                'id' => 'twofactor_totp',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -308,28 +308,28 @@ CpW1GUIA1cyulT4uyHf9g6BMdYVOsFQ=
                                                'created' => '2016-10-08T14:13:54.356716Z',
                                                'lastModified' => '2016-10-12T14:38:56.186269Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.4.1',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '>=5.4.0 <7.1.0',
                                                                                'platformVersionSpec' => '>=10.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/ChristophWurst/twofactor_totp/releases/download/0.4.1/twofactor_totp.tar.gz',
                                                                                'created' => '2016-10-12T14:38:56.174612Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-10-12T14:38:56.248223Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '>=5.4 <=7.0',
@@ -346,32 +346,32 @@ h7ro5ls+d3OQ8i3i4vdZm821Ytxdu/DQBHiVoOBarvFWwWAv2zd2VAvpTmk6J5yv
 Ml2RKcPeutMHHSLiGIN/h7fM5aSs49wGgGZmfz28fHVd7/U0HFSMYmkT/GMq5tMP
 Iyc+QZAN4qbX8G0k/QSTkK/L4lOT2hQiQqiSqmWItMk=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
-                                                       ),
+                                                        [
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Two Factor TOTP Provider',
                                                                                'summary' => 'A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)',
                                                                                'description' => 'A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => true,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Christoph Wurst',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -400,16 +400,16 @@ dIu2MkhxAZk9FZfnFkjTaAXcBHafJce7H/IEjHDEoIkFp5KnAQLHsJb4n8JeXmi9
 VMgQ6yUWNuzOQMZpMIV7RMOUZHvxiX/ZWUFzXNYX0GYub6p4O2uh3LJE+xXyDf77
 RBO7PLY3m4TXCeKesxZlkoGke+lnq7B8tkADdPI=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                3 =>
-                                       array (
+                                        [
                                                'id' => 'contacts',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'office',
                                                                1 => 'organization',
                                                                2 => 'social',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://docs.nextcloud.com/server/11/user_manual/pim/contacts.html',
                                                'adminDocs' => 'https://docs.nextcloud.com/server/11/admin_manual/configuration_server/occ_command.html?highlight=occ%20commands#dav-label',
                                                'developerDocs' => 'https://github.com/nextcloud/contacts#building-the-app',
@@ -418,28 +418,28 @@ RBO7PLY3m4TXCeKesxZlkoGke+lnq7B8tkADdPI=
                                                'created' => '2016-10-30T14:00:58.922766Z',
                                                'lastModified' => '2016-11-22T22:08:01.904319Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '1.5.0',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/nextcloud/contacts/releases/download/v1.5.0/contacts.tar.gz',
                                                                                'created' => '2016-11-22T22:08:01.861942Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-22T22:08:02.306939Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -456,48 +456,48 @@ H3aH8GljatAFjrwItw1JzR0THt0ukkOK+bw/pfCslk10sjHMitmz/GXa4qMS91DZ
 BKLUd0dSfQUQzkfwcojImbzJRvca4/DYe3mfG7+RCH0tDL6t72dKL9joB++u5R1u
 VZPgkToexlXcKWpiDB8H2/SEShKr4udAOjR5de9CYWM=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Contacts/contacts.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Contacts',
                                                                                'summary' => 'The new and improved app for your Contacts.',
                                                                                'description' => 'The new and improved app for your Contacts.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => true,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Alexander Weidinger',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Jan-Christoph Borchardt',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Hendrik Leppelsack',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -526,14 +526,14 @@ iuPit2pjkw3nWz0JRHneRXz/BNoAWBnJiV7JMF2xwBAHN4ghTM8NSJzrGTurmpMI
 Gld7yCP47xNPaAZEC66odcClvNtJ2Clgp8739jD6uJJCqcKDejeef0VU1PG7AXId
 52bVrGMxJwOuL1393vKxGH0PHDzcB1M=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                4 =>
-                                       array (
+                                        [
                                                'id' => 'mail',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => 'https://github.com/nextcloud/mail#readme',
                                                'developerDocs' => '',
@@ -542,28 +542,28 @@ Gld7yCP47xNPaAZEC66odcClvNtJ2Clgp8739jD6uJJCqcKDejeef0VU1PG7AXId
                                                'created' => '2016-10-19T19:41:41.710285Z',
                                                'lastModified' => '2016-10-19T19:57:33.689238Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.6.0',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '>=5.4.0 <7.1.0',
                                                                                'platformVersionSpec' => '>=10.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/nextcloud/mail/releases/download/v0.6.0/mail.tar.gz',
                                                                                'created' => '2016-10-19T19:57:33.676730Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-10-19T19:57:33.834580Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '>=5.4 <=7.0',
@@ -580,9 +580,9 @@ D4c6b+qYn68kx3CLaPPiz+tFAZQZQdj7+Kx/lohso8yTnVSiGYrMj4IvvCbpsQjg
 WF3WSqF/K/tTnPYTWb9NUPSihTbVNv6AXOfTsPEp/ba2YSS5DjvjVjkr5vhR9eg1
 ikQ3Cw6lW3vaA4LVCC+hFkMRnI4N0bo5qQavP3PnZPc=',
                                                                                'translations' =>
-                                                                                       array (
+                                                                                        [
                                                                                                'en' =>
-                                                                                                       array (
+                                                                                                        [
                                                                                                                'changelog' => '### Added
 - Alias support
   [#1523](https://github.com/owncloud/mail/pull/1523) @tahaalibra
@@ -616,32 +616,32 @@ ikQ3Cw6lW3vaA4LVCC+hFkMRnI4N0bo5qQavP3PnZPc=',
   [#1603](https://github.com/owncloud/mail/pull/1603) @ChristophWurst
 - Update folder counters when reading/deleting messages
   [#1585](https://github.com/owncloud/mail/pull/1585)',
-                                                                                                       ),
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                                       ],
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
-                                                       ),
+                                                        [
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Mail',
                                                                                'summary' => 'Easy to use email client which connects to your mail server via IMAP and SMTP.',
                                                                                'description' => 'Easy to use email client which connects to your mail server via IMAP and SMTP.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Christoph Wurst, Thomas Müller, Jan-Christoph Borchardt, Steffen Lindner & many more …',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -670,14 +670,14 @@ ZETmzhx0BXDt5enJYs8R2KMYJNIme1easQRYmWKliXogNY09W7ifT9FHtVW1HX+K
 xRS4JXbapjolkxyGSpP+iYSgItVnYzl6o9KZResR4yDsBv7G/8fpV4GQU9IS3zLD
 PiZOosVHWJdpUKCw9V4P1prGTQ==
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                5 =>
-                                       array (
+                                        [
                                                'id' => 'audioplayer',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'multimedia',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://github.com/rello/audioplayer/wiki#user-documentation',
                                                'adminDocs' => 'https://github.com/rello/audioplayer/wiki#admin-documentation',
                                                'developerDocs' => '',
@@ -686,78 +686,78 @@ PiZOosVHWJdpUKCw9V4P1prGTQ==
                                                'created' => '2016-09-16T05:44:24.857567Z',
                                                'lastModified' => '2016-11-17T22:34:34.637028Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '1.3.1',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '>=5.4.0',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/Rello/audioplayer/releases/download/1.3.1/audioplayer-1.3.1.tar.gz',
                                                                                'created' => '2016-11-17T22:34:34.215350Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-17T22:34:34.867778Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '>=5.4',
                                                                                'rawPlatformVersionSpec' => '>=9 <=11',
                                                                                'signature' => 'p6Zz0IEFrxvw6y/3jHgGWWCxR6qpMzvU2HKfxcIVsK6sJnoRUhWLeAXwZ432fH2a S2llj+IGS9OvW+5VQElrXgPtEjDK1BT00DRJnp5RFCRlUv0LNoedJMzx6B6AHqPP JBufk3cG1O/CO0M0L1ITGSmSOzfKvWTRo3lxVGF792NyBaP/SyZCkH1N1TzBQzUi Ywl3+HiglPcXbHjtJm/arnKorbJWVKoaN93xFuaBapd2ozQSpi0fE0uGRsici+U7 HNa1M5WFE1rzUJoufE0E9246At07rFY1e+TdNEq8IlLgCXg5vGCKkEyuWpWno6aX LfRaIiT9x39UTAwNvuDKS0c+n4uWDYPsGfKhDx9N7CXpUrthfXVEWRzZEXG7as10 6ANvrRPJemSZH8FUSrdJhD7k12qa9R825y7mIG68Li8P71V92EOxFfo9tNXqXwBt VuDGxBqByFVPqSCj5I8hrzJzQl2Xt40g8+8ZcSF96RMg/pM+bwRMTv+mz0V+vQQ4 DWjqnWVPalaJ1PPD5/QFFErtXuNRbyxKZ6BMWxfJlLM9Kz66P75K+8fYaSwz+2KG NxY7I3svzS2K9LGH3fBLUy1t3Hl+c3zGFq/ll1MJrf9NswV4yxt2WmISfM/KDww8 yELkGs2cRzbw2tCvnmYlJJhIqRLkyFAbDzWRH/XdVx4=',
                                                                                'translations' =>
-                                                                                       array (
+                                                                                        [
                                                                                                'en' =>
-                                                                                                       array (
+                                                                                                        [
                                                                                                                'changelog' => '2016-11-17
 - fix: one-click-play for wav not working
 - fix: wrong sql statement for PostgreSQL [#90](https://github.com/rello/audioplayer/issues/90)',
-                                                                                                       ),
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                                       ],
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://github.com/rello/screenshots/raw/master/audioplayer_main.png',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://github.com/rello/screenshots/raw/master/audioplayer_lists.png',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://github.com/rello/screenshots/raw/master/audioplayer_share.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Audio Player',
                                                                                'summary' => 'Audio Player for ownCloud and Nextcloud',
                                                                                'description' => 'Audio Player for MP3, MP4, Ogg, and Wave with a lot of flexibility for all your needs.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Marcel Scherello',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -786,14 +786,14 @@ zi7mQDFxmAE6FWSMBgKKUb4tqLc5oBap8e12tPEZl/UR6d9iUB2ltvrm3T3vrjjl
 FNvGFVBn4r5qCiChEoq+rCXHRjPi/eCfbW21XeLFDiLxapcZyc85JIcA7znUYoFe
 P7Y/ekMscwWhLbF91OaQlcWpRtEMyde/DaI=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                6 =>
-                                       array (
+                                        [
                                                'id' => 'calendar',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'organization',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://docs.nextcloud.com/server/10/user_manual/pim/calendar.html',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -802,28 +802,28 @@ P7Y/ekMscwWhLbF91OaQlcWpRtEMyde/DaI=
                                                'created' => '2016-10-01T12:40:39.060903Z',
                                                'lastModified' => '2016-11-22T20:31:13.029921Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '1.4.1',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/nextcloud/calendar/releases/download/v1.4.1/calendar.tar.gz',
                                                                                'created' => '2016-11-22T20:31:13.020268Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-22T20:31:13.087340Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -840,62 +840,62 @@ eFLKrUg3EvnTjvknbBxMB55h9jNJr0SAlkrmyEVm6+CE3BwRWpKB+cJMBuGiwPwv
 r/ASRiJrkDThbNWAUtX70rUmCqDV6/MujLXViqOc/Q2OHvcXd1oGDccJSQT92/1z
 7nonnedyYQIDqUt7u68WL8JRxp7pFsEqKLVuWSgxW3c=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/1.png',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/2.png',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/3.png',
-                                                                       ),
+                                                                       ],
                                                                3 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/4.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Calendar',
                                                                                'summary' => 'Calendar GUI for Nextcloud\'s CalDAV server',
                                                                                'description' => 'The Nextcloud calendar app is a user interface for Nextcloud\'s CalDAV server.
 
 It integrates with other apps, allows you to manage calendars and events, display external calendars and invite attendees to your events',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => true,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Georg Ehrke',
                                                                                'mail' => '',
                                                                                'homepage' => 'https://georg.coffee',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Raghu Nayyar',
                                                                                'mail' => '',
                                                                                'homepage' => 'http://raghunayyar.com',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Thomas Citharel',
                                                                                'mail' => '',
                                                                                'homepage' => 'https://tcit.fr',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.94444444444444398,
                                                'ratingOverall' => 0.94444444444444398,
                                                'ratingNumRecent' => 9,
@@ -924,14 +924,14 @@ D3xxtc17ll3B5IqrMnMHRqmOQ39Sbe56Y7T4agaIz/sUWpseo85D5kt7UAIOR+Mr
 Q0Bl/QinETk72afGR46Qvc7tC1t9JjQQD3AUbEGuJdGvXjJJ9GREYu01XoODmPdT
 jXXOI8XIOK6kxXhPHUc3iWu9b4KqGm0=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                8 =>
-                                       array (
+                                        [
                                                'id' => 'ownpad',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://github.com/otetard/ownpad/blob/master/README.md#mimetype-detection',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -940,28 +940,28 @@ jXXOI8XIOK6kxXhPHUc3iWu9b4KqGm0=
                                                'created' => '2016-09-29T15:58:52.814912Z',
                                                'lastModified' => '2016-11-19T17:37:52.278497Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.5.6',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/otetard/ownpad/releases/download/v0.5.6/ownpad.tar.gz',
                                                                                'created' => '2016-11-19T17:37:52.234684Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-19T17:37:52.423930Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -978,17 +978,17 @@ o3n0+gw3QYIhLEe75sUhxG6ynVUdW25AKKju1kVj3KJnZTBH1R8t8/zy4DnJG8d4
 uRGqyU4BXpZjEC3nVlsC7vCncWWhxl0WZQ/MWKqsfjVAU4I88E518D6NioqMnPEJ
 iCZ2x+69UCDEQyfCSKajgAYT17r3OhZei8F9KSCH8Vw=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
-                                                       ),
+                                                        [
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Ownpad',
                                                                                'summary' => '
     Create and open Etherpad and Ethercalc documents.
@@ -1000,18 +1000,18 @@ iCZ2x+69UCDEQyfCSKajgAYT17r3OhZei8F9KSCH8Vw=',
     This application requires to have access to an instance of
     Etherpad and/or Ethercalc to work properly.
   ',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Olivier Tétard',
                                                                                'mail' => 'olivier.tetard@miskin.fr',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -1040,14 +1040,14 @@ ifneTw/Ba1d0AXBOq0c0HFyGxMPIlWe4qn5LtxH5t0wyVGeSj4jyv4nvd3ZGuAgY
 EUa2uYht/z475k4+vf0YhV98iQH07GnmlfD2TDZgmOCQGKlNfJh1v88OZyLLa3dz
 gRHzGwKbAiJ8T8bbpZ3e2ozXxADr
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                9 =>
-                                       array (
+                                        [
                                                'id' => 'announcementcenter',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'organization',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -1056,28 +1056,28 @@ gRHzGwKbAiJ8T8bbpZ3e2ozXxADr
                                                'created' => '2016-09-14T10:38:53.939634Z',
                                                'lastModified' => '2016-11-24T11:21:50.324839Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '2.0.0',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=10.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/nextcloud/announcementcenter/releases/download/v2.0.0/announcementcenter-2.0.0.tar.gz',
                                                                                'created' => '2016-10-06T12:41:56.195206Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-10-06T12:41:56.263124Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -1089,36 +1089,36 @@ iWUb/Uv/ODj74wVDWqWxAFKaAG/FestCB3InOOZQqQZLzlAV0U9ziYDGNzBjFqof
 OfQFKEjtsx+bNLa6CkAaocHGHJXAofX3GQZ9cjBsjZqiTfbXfcVk0kRfz7pwL92L
 I1McfJYvgMxDQG5bjRpNJw==',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://github.com/nextcloud/announcementcenter/raw/stable10/docs/AnnouncementCenterFrontpage.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Announcement Center',
                                                                                'summary' => 'An announcement center for Nextcloud',
                                                                                'description' => 'An announcement center for Nextcloud',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => true,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Joas Schilling',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.75,
                                                'ratingOverall' => 0.75,
                                                'ratingNumRecent' => 0,
@@ -1142,15 +1142,15 @@ sli/yAYQRTVDsXD8A3ACYT7BG31jGxyXtIHzqCci0MhZFdKKayMYkwfjZchIUtGN
 JJoU8LQoHwGRtp3wutk0GlFzpEQEvSsn/Lsvvot5IfIe46tnzA6MVj5s64s5G8+Q
 phhXFlzXqO/VxquPdbfYjvU=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                11 =>
-                                       array (
+                                        [
                                                'id' => 'rainloop',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'social',
                                                                1 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => '',
                                                'developerDocs' => '',
@@ -1159,28 +1159,28 @@ phhXFlzXqO/VxquPdbfYjvU=
                                                'created' => '2016-10-20T04:17:37.217555Z',
                                                'lastModified' => '2016-11-18T11:36:04.309739Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '4.26.0',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '>=5.4.0',
                                                                                'platformVersionSpec' => '>=10.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/pierre-alain-b/rainloop-nextcloud/releases/download/v4.26.0/rainloop-4.26.0.tar.gz',
                                                                                'created' => '2016-10-20T04:28:21.491747Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-18T11:36:04.619927Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '>=5.4',
@@ -1197,36 +1197,36 @@ LhIczc32ECi3ZVVgyF8zyT4Y/3MRS05oX3FHvHyt88mjni6bVaO78F7ZRSha8gHh
 NOAkku7AMXPvUCHaZP2iVCCoAViEso8GeR3O8xh2G42Ai61RLYwx8LB1+23EoJTr
 mfFuRYNSg+qAKCokXNnh+lDlwu4AkaQo3vtKGPXvU7A=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/pierre-alain-b/rainloop-nextcloud/master/screenshots/2016.10.20-screenshot.jpg',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'RainLoop',
                                                                                'summary' => 'RainLoop Webmail',
                                                                                'description' => 'Simple, modern and fast web-based email client.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'RainLoop Team',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -1255,15 +1255,15 @@ pzAeVGiABI/e5URpxzz2UayRX7EE+vtpe3B84hzkLqsq0N39ZN6KLfaTyEBGLzqE
 iLYeXQTV0XSRs8xVt+iyGlj7nPkv2DR0oCqRpWUFWeSBI//niDG5WxS3qg8kacSW
 fDSYhSN+IjrnIkwNtc8V9t7/GeQB5FE=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                12 =>
-                                       array (
+                                        [
                                                'id' => 'richdocuments',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'integration',
                                                                1 => 'office',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://nextcloud.com/collaboraonline/',
                                                'adminDocs' => 'https://nextcloud.com/collaboraonline/',
                                                'developerDocs' => '',
@@ -1272,28 +1272,28 @@ fDSYhSN+IjrnIkwNtc8V9t7/GeQB5FE=
                                                'created' => '2016-10-31T08:55:45.631429Z',
                                                'lastModified' => '2016-11-24T12:13:53.905352Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '1.1.14',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/owncloud/richdocuments/releases/download/1.1.14/richdocuments.tar.gz',
                                                                                'created' => '2016-11-24T12:10:13.337165Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-24T12:13:53.963638Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -1305,48 +1305,48 @@ E1aaRnQfTx488YB8Ubul06LIY0PNCHgGCWPgy817tOVT7JA+V0P0FFonl/PXE0dr
 WgtxRJmvGaNiFzYq+kQmdKMfayZTm3kdVgP0W52t5wp878K0i4s2KPg5lANvjTz7
 DCT+VV2IGIE52o4RpMUGyQ==',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-document.png',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-app.png',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-presentation.png',
-                                                                       ),
+                                                                       ],
                                                                3 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-spreadsheet.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Collabora Online',
                                                                                'summary' => 'Edit office documents directly in your browser.',
                                                                                'description' => 'Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -1370,15 +1370,15 @@ Ru1DXn+LW7TJ4NZ8VtLWvmW/6Kfmi7dQ1V++Kmn0lO5ntRt5altePbStCHC8bhGp
 myBOrjhrJgLIwvgH26MYZhdiSkFzoE38nMPZdrUmUDxcPCwucWJqgzDPudguFthj
 WCVZ3TTG/2z3+tWM
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                13 =>
-                                       array (
+                                        [
                                                'id' => 'ocr',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'files',
                                                                1 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://janis91.github.io/ocr/',
                                                'adminDocs' => 'https://github.com/janis91/ocr/wiki',
                                                'developerDocs' => 'https://github.com/janis91/ocr/wiki',
@@ -1387,48 +1387,48 @@ WCVZ3TTG/2z3+tWM
                                                'created' => '2016-09-19T12:07:49.220376Z',
                                                'lastModified' => '2016-11-21T11:22:21.024501Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '1.0.0',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 =>
-                                                                                                       array (
+                                                                                                        [
                                                                                                                'id' => 'pgsql',
                                                                                                                'versionSpec' => '*',
                                                                                                                'rawVersionSpec' => '*',
-                                                                                                       ),
+                                                                                                       ],
                                                                                                1 =>
-                                                                                                       array (
+                                                                                                        [
                                                                                                                'id' => 'mysql',
                                                                                                                'versionSpec' => '*',
                                                                                                                'rawVersionSpec' => '*',
-                                                                                                       ),
+                                                                                                       ],
                                                                                                2 =>
-                                                                                                       array (
+                                                                                                        [
                                                                                                                'id' => 'sqlite',
                                                                                                                'versionSpec' => '*',
                                                                                                                'rawVersionSpec' => '*',
-                                                                                                       ),
-                                                                                       ),
+                                                                                                       ],
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'ocrmypdf',
                                                                                                1 => 'tesseract',
-                                                                                       ),
+                                                                                       ],
                                                                                'phpVersionSpec' => '>=5.6.0 <8.0.0',
                                                                                'platformVersionSpec' => '>=10.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/janis91/ocr/releases/download/v1.0.0/ocr.tar.gz',
                                                                                'created' => '2016-10-24T06:50:43.283900Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-21T11:22:21.269108Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '>=5.6 <=7',
@@ -1445,29 +1445,29 @@ D3tJOF7spnK6I3BhVLviou/zs30AIRVBDTU0Orzx78cbInwy6/vyJib2a1olAaHz
 v05SzlQRnBWM4jYBe0mA/2ds9AO6VrXGrT/iLlHemj6JYoGBM185TGewA7OJyX3a
 HSlSDqaremmi+aS3onx3AKhXykDxTRkMVarePwTzzFs=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc1.png',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc2.png',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc3.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'OCR',
                                                                                'summary' => 'Character recoginition for your images and pdf files.',
                                                                                'description' => '# Description
@@ -1488,9 +1488,9 @@ The OCR app has some prerequisites:
  - **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** &gt;v3.02.02 with corresponding language files (e.g. tesseract-ocr-eng)
 
 For further information see the homepage or the appropriate documentation.',
-                                                                       ),
+                                                                       ],
                                                                'de' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'OCR',
                                                                                'summary' => 'Schrifterkennung für Bilder (mit Text) und PDF Dateien.',
                                                                                'description' => '# Beschreibung
@@ -1511,18 +1511,18 @@ Für die OCR App müssen folgende Anforderungen erfüllt sein:
  - **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** &gt;v3.02.02 mit den dazugehörigen Übersetzungs- und Sprachdateien (z. B. tesseract-ocr-deu)
 
 Für weiter Informationen besuchen Sie die Homepage oder lesen Sie die zutreffende Dokumentation.',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Janis Koehr',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -1551,14 +1551,14 @@ HR7qPCNz4uG2Va7mlUHE3UYUYnlv8JFOV3YdbVL0nxhWwIdzSri5sxFIhdlabpzY
 yA1z/MCBEyTRo80jxFmL+MpwbsdbUJi7Qxlnd56zb6HHDGrLHXZTh9LXgyVbnhWL
 kxomWjIXQh4aMHQL4QF7U4EK
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                14 =>
-                                       array (
+                                        [
                                                'id' => 'spreedme',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => 'https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md',
                                                'adminDocs' => 'https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md',
                                                'developerDocs' => '',
@@ -1567,28 +1567,28 @@ kxomWjIXQh4aMHQL4QF7U4EK
                                                'created' => '2016-09-27T08:43:07.835196Z',
                                                'lastModified' => '2016-11-21T16:51:23.703819Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.3.4',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz',
                                                                                'created' => '2016-11-21T16:51:23.689599Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-21T16:51:23.826509Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -1605,48 +1605,48 @@ bOks45K5gE1da4QpkYOUQa3GVMNPqPiT3CqjmJ8tjxq7bGpb6v+YoCLACjjPpPZL
 8uNawnFwWkicBEYkN/WtBTouWzehOPn38tHXov6SyEyD6lkuxUBZrsGQ2ru+t33U
 k0kKCbV0GFw43I+3Ji5DiB4TUVNZYVoPG1B7Qve+UfA=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/conference.gif',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/presentation.png',
-                                                                       ),
+                                                                       ],
                                                                2 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/import.png',
-                                                                       ),
+                                                                       ],
                                                                3 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/users.png',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Spreed.ME',
                                                                                'summary' => 'Audio-, video- and text chat for your Nextcloud',
                                                                                'description' => 'Securely communicate with your friends and family using rich audio-, video- and text chat, and much more right from your Nextcloud – in your browser',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'struktur AG',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -1675,15 +1675,15 @@ axCNzc7veb2M98hS73w5ZE6vO+C/wz0GTsxuK0AoLitApT5naQnjvxSvSsjFPEGD
 sUNUEU2Decyp0jxLVnrrpz6Y5UupfBR0V8yAv1t5Od/mCKLc5DxHsDWiKOpsob9U
 JN+bdzJil2NNftihD4Dm7Ha7OS3O8W0=
 -----END CERTIFICATE-----',
-                                       ),
+                                       ],
                                15 =>
-                                       array (
+                                        [
                                                'id' => 'nextant',
                                                'categories' =>
-                                                       array (
+                                                        [
                                                                0 => 'files',
                                                                1 => 'tools',
-                                                       ),
+                                                       ],
                                                'userDocs' => '',
                                                'adminDocs' => 'https://github.com/nextcloud/nextant/wiki',
                                                'developerDocs' => '',
@@ -1692,28 +1692,28 @@ JN+bdzJil2NNftihD4Dm7Ha7OS3O8W0=
                                                'created' => '2016-09-14T14:34:35.977699Z',
                                                'lastModified' => '2016-11-22T16:02:57.758477Z',
                                                'releases' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'version' => '0.6.6',
                                                                                'phpExtensions' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'databases' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'shellCommands' =>
-                                                                                       array (
-                                                                                       ),
+                                                                                        [
+                                                                                       ],
                                                                                'phpVersionSpec' => '*',
                                                                                'platformVersionSpec' => '>=9.0.0 <12.0.0',
                                                                                'minIntSize' => 32,
                                                                                'download' => 'https://github.com/nextcloud/nextant/releases/download/v0.6.6/nextant-0.6.6.tar.gz',
                                                                                'created' => '2016-11-16T15:11:14.344704Z',
                                                                                'licenses' =>
-                                                                                       array (
+                                                                                        [
                                                                                                0 => 'agpl',
-                                                                                       ),
+                                                                                       ],
                                                                                'lastModified' => '2016-11-16T20:39:59.030384Z',
                                                                                'isNightly' => false,
                                                                                'rawPhpVersionSpec' => '*',
@@ -1730,25 +1730,25 @@ oAKv2GkvWPQ0aiiBtA1i4oXuzvHW/M2wOrK7v7DCpNfILrD/sjxpljxcX082nRCd
 se+kc/a4iB3BoCNX3E942pBBzew4ya8LkCXdCHUUsuelDf1va1ikTh/G7D84ll9/
 2avNqQnUh3hgOnxFCLI/5VrbqxfSTVdO6O/LTuAmwgw=',
                                                                                'translations' =>
-                                                                                       array (
-                                                                                       ),
-                                                                       ),
-                                                       ),
+                                                                                        [
+                                                                                       ],
+                                                                       ],
+                                                       ],
                                                'screenshots' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/displayResult.jpg',
-                                                                       ),
+                                                                       ],
                                                                1 =>
-                                                                       array (
+                                                                        [
                                                                                'url' => 'https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/admin.jpg',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'translations' =>
-                                                       array (
+                                                        [
                                                                'en' =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Nextant',
                                                                                'summary' => 'Navigate through your cloud using Solr',
                                                                                'description' => '
@@ -1787,18 +1787,18 @@ se+kc/a4iB3BoCNX3E942pBBzew4ya8LkCXdCHUUsuelDf1va1ikTh/G7D84ll9/
 
 
        ',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'isFeatured' => false,
                                                'authors' =>
-                                                       array (
+                                                        [
                                                                0 =>
-                                                                       array (
+                                                                        [
                                                                                'name' => 'Maxence Lange',
                                                                                'mail' => '',
                                                                                'homepage' => '',
-                                                                       ),
-                                                       ),
+                                                                       ],
+                                                       ],
                                                'ratingRecent' => 0.5,
                                                'ratingOverall' => 0.5,
                                                'ratingNumRecent' => 0,
@@ -1827,12 +1827,12 @@ my7Z1C7jG9/h57vx0+QBMDCYnTmqLsvMKqo27uHskzAiB7VXLEdSZ2FtMGHkLUQO
 0bfhnvTZ2VhMmK83t7ovo71An4ycmsolGD/MA0vNI78VrVISrdI8rRh2WntUnCBU
 EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
 -----END CERTIFICATE-----',
-                                       ),
-                       ),
+                                       ],
+                       ],
                'timestamp' => 1234,
                'ncversion' => '11.0.0.2',
                'ETag' => '"myETag"',
-       );
+       ];
 
 
        protected function setUp(): void {
index 8312bef5b9842825ffb241d9951ff8419afe52ce..52965d4a72d12924fd3a5cd7dc1473f45508765d 100644 (file)
@@ -64,7 +64,7 @@ class DependencyAnalyzerTest extends TestCase {
                        ->getMock();
                $this->l10nMock->expects($this->any())
                        ->method('t')
-                       ->willReturnCallback(function($text, $parameters = array()) {
+                       ->willReturnCallback(function($text, $parameters = []) {
                                return vsprintf($text, $parameters);
                        });
 
@@ -80,11 +80,11 @@ class DependencyAnalyzerTest extends TestCase {
         * @param string $intSize
         */
        public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize) {
-               $app = array(
-                       'dependencies' => array(
-                               'php' => array()
-                       )
-               );
+               $app = [
+                       'dependencies' => [
+                               'php' => []
+                       ]
+               ];
                if (!is_null($minVersion)) {
                        $app['dependencies']['php']['@attributes']['min-version'] = $minVersion;
                }
@@ -126,10 +126,10 @@ class DependencyAnalyzerTest extends TestCase {
         * @param string|null $commands
         */
        public function testCommand($expectedMissing, $commands) {
-               $app = array(
-                       'dependencies' => array(
-                       )
-               );
+               $app = [
+                       'dependencies' => [
+                       ]
+               ];
                if (!is_null($commands)) {
                        $app['dependencies']['command'] = $commands;
                }
@@ -145,10 +145,10 @@ class DependencyAnalyzerTest extends TestCase {
         * @param $libs
         */
        function testLibs($expectedMissing, $libs) {
-               $app = array(
-                       'dependencies' => array(
-                       )
-               );
+               $app = [
+                       'dependencies' => [
+                       ]
+               ];
                if (!is_null($libs)) {
                        $app['dependencies']['lib'] = $libs;
                }
@@ -165,9 +165,9 @@ class DependencyAnalyzerTest extends TestCase {
         * @param $oss
         */
        function testOS($expectedMissing, $oss) {
-               $app = array(
-                       'dependencies' => array()
-               );
+               $app = [
+                       'dependencies' => []
+               ];
                if (!is_null($oss)) {
                        $app['dependencies']['os'] = $oss;
                }
@@ -184,9 +184,9 @@ class DependencyAnalyzerTest extends TestCase {
         * @param $oc
         */
        function testOC($expectedMissing, $oc) {
-               $app = array(
-                       'dependencies' => array()
-               );
+               $app = [
+                       'dependencies' => []
+               ];
                if (!is_null($oc)) {
                        $app['dependencies'] = $oc;
                }
@@ -429,12 +429,12 @@ class DependencyAnalyzerTest extends TestCase {
         * @return array
         */
        function providesOS() {
-               return array(
-                       array(array(), null),
-                       array(array(), array()),
-                       array(array('Following platforms are supported: ANDROID'), 'ANDROID'),
-                       array(array('Following platforms are supported: WINNT'), array('WINNT'))
-               );
+               return [
+                       [[], null],
+                       [[], []],
+                       [['Following platforms are supported: ANDROID'], 'ANDROID'],
+                       [['Following platforms are supported: WINNT'], ['WINNT']]
+               ];
        }
 
        /**
@@ -489,28 +489,28 @@ class DependencyAnalyzerTest extends TestCase {
         * @return array
         */
        function providesDatabases() {
-               return array(
+               return [
                        // non BC - in case on databases are defined -> all are supported
-                       array(array(), null),
-                       array(array(), array()),
-                       array(array('Following databases are supported: mongodb'), 'mongodb'),
-                       array(array('Following databases are supported: sqlite, postgres'), array('sqlite', array('@value' => 'postgres'))),
-               );
+                       [[], null],
+                       [[], []],
+                       [['Following databases are supported: mongodb'], 'mongodb'],
+                       [['Following databases are supported: sqlite, postgres'], ['sqlite', ['@value' => 'postgres']]],
+               ];
        }
 
        /**
         * @return array
         */
        function providesPhpVersion() {
-               return array(
-                       array(array(), null, null, null),
-                       array(array(), '5.4', null, null),
-                       array(array(), null, '5.5', null),
-                       array(array(), '5.4', '5.5', null),
-                       array(array('PHP 5.4.4 or higher is required.'), '5.4.4', null, null),
-                       array(array('PHP with a version lower than 5.4.2 is required.'), null, '5.4.2', null),
-                       array(array('64bit or higher PHP required.'), null, null, 64),
-                       array(array(), '5.4', '5.4', null),
-               );
+               return [
+                       [[], null, null, null],
+                       [[], '5.4', null, null],
+                       [[], null, '5.5', null],
+                       [[], '5.4', '5.5', null],
+                       [['PHP 5.4.4 or higher is required.'], '5.4.4', null, null],
+                       [['PHP with a version lower than 5.4.2 is required.'], null, '5.4.2', null],
+                       [['64bit or higher PHP required.'], null, null, 64],
+                       [[], '5.4', '5.4', null],
+               ];
        }
 }
index 783f8f473ffbeb0bd6b5561b33db44c338ac71ec..555247f7ddaa1a0ae8aabe57cccf1bbe0e18956f 100644 (file)
@@ -25,41 +25,41 @@ class PlatformRepositoryTest extends \Test\TestCase {
        }
 
        public function providesVersions() {
-               return array(
-                       'none' => array('1.0.0', '1.0.0.0'),
-                       'none/2' => array('1.2.3.4', '1.2.3.4'),
-                       'parses state' => array('1.0.0RC1dev', '1.0.0.0-RC1-dev'),
-                       'CI parsing' => array('1.0.0-rC15-dev', '1.0.0.0-RC15-dev'),
-                       'delimiters' => array('1.0.0.RC.15-dev', '1.0.0.0-RC15-dev'),
-                       'RC uppercase' => array('1.0.0-rc1', '1.0.0.0-RC1'),
-                       'patch replace' => array('1.0.0.pl3-dev', '1.0.0.0-patch3-dev'),
-                       'forces w.x.y.z' => array('1.0-dev', '1.0.0.0-dev'),
-                       'forces w.x.y.z/2' => array('0', '0.0.0.0'),
-                       'parses long' => array('10.4.13-beta', '10.4.13.0-beta'),
-                       'parses long/2' => array('10.4.13beta2', '10.4.13.0-beta2'),
-                       'parses long/semver' => array('10.4.13beta.2', '10.4.13.0-beta2'),
-                       'expand shorthand' => array('10.4.13-b', '10.4.13.0-beta'),
-                       'expand shorthand2' => array('10.4.13-b5', '10.4.13.0-beta5'),
-                       'strips leading v' => array('v1.0.0', '1.0.0.0'),
-                       'strips v/datetime' => array('v20100102', '20100102'),
-                       'parses dates y-m' => array('2010.01', '2010-01'),
-                       'parses dates w/ .' => array('2010.01.02', '2010-01-02'),
-                       'parses dates w/ -' => array('2010-01-02', '2010-01-02'),
-                       'parses numbers' => array('2010-01-02.5', '2010-01-02-5'),
-                       'parses dates y.m.Y' => array('2010.1.555', '2010.1.555.0'),
-                       'parses datetime' => array('20100102-203040', '20100102-203040'),
-                       'parses dt+number' => array('20100102203040-10', '20100102203040-10'),
-                       'parses dt+patch' => array('20100102-203040-p1', '20100102-203040-patch1'),
-                       'parses master' => array('dev-master', '9999999-dev'),
-                       'parses trunk' => array('dev-trunk', '9999999-dev'),
+               return [
+                       'none' => ['1.0.0', '1.0.0.0'],
+                       'none/2' => ['1.2.3.4', '1.2.3.4'],
+                       'parses state' => ['1.0.0RC1dev', '1.0.0.0-RC1-dev'],
+                       'CI parsing' => ['1.0.0-rC15-dev', '1.0.0.0-RC15-dev'],
+                       'delimiters' => ['1.0.0.RC.15-dev', '1.0.0.0-RC15-dev'],
+                       'RC uppercase' => ['1.0.0-rc1', '1.0.0.0-RC1'],
+                       'patch replace' => ['1.0.0.pl3-dev', '1.0.0.0-patch3-dev'],
+                       'forces w.x.y.z' => ['1.0-dev', '1.0.0.0-dev'],
+                       'forces w.x.y.z/2' => ['0', '0.0.0.0'],
+                       'parses long' => ['10.4.13-beta', '10.4.13.0-beta'],
+                       'parses long/2' => ['10.4.13beta2', '10.4.13.0-beta2'],
+                       'parses long/semver' => ['10.4.13beta.2', '10.4.13.0-beta2'],
+                       'expand shorthand' => ['10.4.13-b', '10.4.13.0-beta'],
+                       'expand shorthand2' => ['10.4.13-b5', '10.4.13.0-beta5'],
+                       'strips leading v' => ['v1.0.0', '1.0.0.0'],
+                       'strips v/datetime' => ['v20100102', '20100102'],
+                       'parses dates y-m' => ['2010.01', '2010-01'],
+                       'parses dates w/ .' => ['2010.01.02', '2010-01-02'],
+                       'parses dates w/ -' => ['2010-01-02', '2010-01-02'],
+                       'parses numbers' => ['2010-01-02.5', '2010-01-02-5'],
+                       'parses dates y.m.Y' => ['2010.1.555', '2010.1.555.0'],
+                       'parses datetime' => ['20100102-203040', '20100102-203040'],
+                       'parses dt+number' => ['20100102203040-10', '20100102203040-10'],
+                       'parses dt+patch' => ['20100102-203040-p1', '20100102-203040-patch1'],
+                       'parses master' => ['dev-master', '9999999-dev'],
+                       'parses trunk' => ['dev-trunk', '9999999-dev'],
 //                     'parses branches' => array('1.x-dev', '1.9999999.9999999.9999999-dev'),
-                       'parses arbitrary' => array('dev-feature-foo', 'dev-feature-foo'),
-                       'parses arbitrary2' => array('DEV-FOOBAR', 'dev-FOOBAR'),
-                       'parses arbitrary3' => array('dev-feature/foo', 'dev-feature/foo'),
-                       'ignores aliases' => array('dev-master as 1.0.0', '9999999-dev'),
+                       'parses arbitrary' => ['dev-feature-foo', 'dev-feature-foo'],
+                       'parses arbitrary2' => ['DEV-FOOBAR', 'dev-FOOBAR'],
+                       'parses arbitrary3' => ['dev-feature/foo', 'dev-feature/foo'],
+                       'ignores aliases' => ['dev-master as 1.0.0', '9999999-dev'],
 //                     'semver metadata' => array('dev-master+foo.bar', '9999999-dev'),
 //                     'semver metadata/2' => array('1.0.0-beta.5+foo', '1.0.0.0-beta5'),
 //                     'semver metadata/3' => array('1.0.0+foo', '1.0.0.0'),
 //                     'metadata w/ alias' => array('1.0.0+foo as 2.0', '1.0.0.0'),
-               );
+               ];
        }}
index 3fb18979b8a84a3a7c9febb1fc52217e091833c1..fd83b6feae5c26546081d0802c46b751ef9465f3 100644 (file)
@@ -30,7 +30,7 @@ use OCP\AppFramework\Http;
 use OCP\AppFramework\Http\Response;
 
 function rrmdir($directory) {
-       $files = array_diff(scandir($directory), array('.','..'));
+       $files = array_diff(scandir($directory), ['.','..']);
        foreach ($files as $file) {
                if (is_dir($directory . '/' . $file)) {
                        rrmdir($directory . '/' . $file);
@@ -59,12 +59,12 @@ class AppTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array());
+               $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', []);
                $this->controller = $this->createMock(Controller::class);
                $this->dispatcher = $this->createMock(Dispatcher::class);
                $this->io = $this->createMock(Http\IOutput::class);
 
-               $this->headers = array('key' => 'value');
+               $this->headers = ['key' => 'value'];
                $this->output = 'hi';
                $this->controllerName = 'Controller';
                $this->controllerMethod = 'method';
@@ -72,7 +72,7 @@ class AppTest extends \Test\TestCase {
                $this->container[$this->controllerName] = $this->controller;
                $this->container['Dispatcher'] = $this->dispatcher;
                $this->container['OCP\\AppFramework\\Http\\IOutput'] = $this->io;
-               $this->container['urlParams'] = array();
+               $this->container['urlParams'] = [];
 
                $this->appPath = __DIR__ . '/../../../apps/namespacetestapp';
                $infoXmlPath = $this->appPath . '/appinfo/info.xml';
index 23ebe6ec984728d35e039f9ca61ad4b082433a08..675d4b7ccec293eb4ccef62ac6cf8a7f132441fd 100644 (file)
@@ -41,7 +41,7 @@ class ChildController extends Controller {
 
        public function custom($in) {
                $this->registerResponder('json', function ($response) {
-                       return new JSONResponse(array(strlen($response)));
+                       return new JSONResponse([strlen($response)]);
                });
 
                return $in;
@@ -103,9 +103,9 @@ class ControllerTest extends \Test\TestCase {
 
 
        public function testFormat() {
-               $response = $this->controller->buildResponse(array('hi'), 'json');
+               $response = $this->controller->buildResponse(['hi'], 'json');
 
-               $this->assertEquals(array('hi'), $response->getData());
+               $this->assertEquals(['hi'], $response->getData());
        }
 
 
@@ -118,10 +118,10 @@ class ControllerTest extends \Test\TestCase {
                        'Feature-Policy' => "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'",
                ];
 
-               $response = $this->controller->customDataResponse(array('hi'));
+               $response = $this->controller->customDataResponse(['hi']);
                $response = $this->controller->buildResponse($response, 'json');
 
-               $this->assertEquals(array('hi'), $response->getData());
+               $this->assertEquals(['hi'], $response->getData());
                $this->assertEquals(300, $response->getStatus());
                $this->assertEquals($expectedHeaders, $response->getHeaders());
        }
@@ -131,7 +131,7 @@ class ControllerTest extends \Test\TestCase {
                $response = $this->controller->custom('hi');
                $response = $this->controller->buildResponse($response, 'json');
 
-               $this->assertEquals(array(2), $response->getData());
+               $this->assertEquals([2], $response->getData());
        }
 
 
index c8ebda55a8683456f87326cc5d7360f9627705dc..43770eba17a5ac7aa22595ab55ff5f45817e1714 100644 (file)
@@ -77,15 +77,15 @@ class EntityTest extends \Test\TestCase {
                $entity->setId(3);
                $entity->resetUpdatedFields();
 
-               $this->assertEquals(array(), $entity->getUpdatedFields());
+               $this->assertEquals([], $entity->getUpdatedFields());
        }
 
 
        public function testFromRow(){
-               $row = array(
+               $row = [
                        'pre_name' => 'john',
                        'email' => 'john@something.com'
-               );
+               ];
                $this->entity = TestEntity::fromRow($row);
 
                $this->assertEquals($row['pre_name'], $this->entity->getPreName());
@@ -153,7 +153,7 @@ class EntityTest extends \Test\TestCase {
 
 
        public function testFromRowShouldNotAssignEmptyArray(){
-               $row = array();
+               $row = [];
                $entity2 = new TestEntity();
 
                $this->entity = TestEntity::fromRow($row);
@@ -162,7 +162,7 @@ class EntityTest extends \Test\TestCase {
 
 
        public function testIdGetsConvertedToInt(){
-               $row = array('id' => '4');
+               $row = ['id' => '4'];
 
                $this->entity = TestEntity::fromRow($row);
                $this->assertSame(4, $this->entity->getId());
@@ -170,7 +170,7 @@ class EntityTest extends \Test\TestCase {
 
 
        public function testSetType(){
-               $row = array('testId' => '4');
+               $row = ['testId' => '4'];
 
                $this->entity = TestEntity::fromRow($row);
                $this->assertSame(4, $this->entity->getTestId());
@@ -178,10 +178,10 @@ class EntityTest extends \Test\TestCase {
 
 
        public function testFromParams(){
-               $params = array(
+               $params = [
                        'testId' => 4,
                        'email' => 'john@doe'
-               );
+               ];
 
                $entity = TestEntity::fromParams($params);
 
@@ -215,12 +215,12 @@ class EntityTest extends \Test\TestCase {
 
        public function testGetFieldTypes() {
                $entity = new TestEntity();
-               $this->assertEquals(array(
+               $this->assertEquals([
                        'id' => 'integer',
                        'testId' => 'integer',
                        'trueOrFalse' => 'bool',
                        'anotherBool' => 'boolean',
-               ), $entity->getFieldTypes());
+               ], $entity->getFieldTypes());
        }
 
 
index 67d88c879a3b8937bb1cb54ff5828ececb8dc7f5..79a9a1884e0b558d3bce3e1aa0bd4e9b5e8edd06 100644 (file)
@@ -73,28 +73,28 @@ class MapperTest extends MapperTestUtility {
 
        public function testFindQuery(){
                $sql = 'hi';
-               $params = array('jo');
-               $rows = array(
-                       array('hi')
-               );
+               $params = ['jo'];
+               $rows = [
+                       ['hi']
+               ];
                $this->setMapperResult($sql, $params, $rows);
                $this->mapper->find($sql, $params);
        }
 
        public function testFindEntity(){
                $sql = 'hi';
-               $params = array('jo');
-               $rows = array(
-                       array('pre_name' => 'hi')
-               );
+               $params = ['jo'];
+               $rows = [
+                       ['pre_name' => 'hi']
+               ];
                $this->setMapperResult($sql, $params, $rows, null, null, true);
                $this->mapper->findOneEntity($sql, $params);
        }
 
        public function testFindNotFound(){
                $sql = 'hi';
-               $params = array('jo');
-               $rows = array();
+               $params = ['jo'];
+               $rows = [];
                $this->setMapperResult($sql, $params, $rows);
                $this->expectException(DoesNotExistException::class);
                $this->mapper->find($sql, $params);
@@ -102,8 +102,8 @@ class MapperTest extends MapperTestUtility {
 
        public function testFindEntityNotFound(){
                $sql = 'hi';
-               $params = array('jo');
-               $rows = array();
+               $params = ['jo'];
+               $rows = [];
                $this->setMapperResult($sql, $params, $rows, null, null, true);
                $this->expectException(DoesNotExistException::class);
                $this->mapper->findOneEntity($sql, $params);
@@ -111,10 +111,10 @@ class MapperTest extends MapperTestUtility {
 
        public function testFindMultiple(){
                $sql = 'hi';
-               $params = array('jo');
-               $rows = array(
-                       array('jo'), array('ho')
-               );
+               $params = ['jo'];
+               $rows = [
+                       ['jo'], ['ho']
+               ];
                $this->setMapperResult($sql, $params, $rows, null, null, true);
                $this->expectException(MultipleObjectsReturnedException::class);
                $this->mapper->find($sql, $params);
@@ -122,10 +122,10 @@ class MapperTest extends MapperTestUtility {
 
        public function testFindEntityMultiple(){
                $sql = 'hi';
-               $params = array('jo');
-               $rows = array(
-                       array('jo'), array('ho')
-               );
+               $params = ['jo'];
+               $rows = [
+                       ['jo'], ['ho']
+               ];
                $this->setMapperResult($sql, $params, $rows, null, null, true);
                $this->expectException(MultipleObjectsReturnedException::class);
                $this->mapper->findOneEntity($sql, $params);
@@ -134,7 +134,7 @@ class MapperTest extends MapperTestUtility {
 
        public function testDelete(){
                $sql = 'DELETE FROM `*PREFIX*table` WHERE `id` = ?';
-               $params = array(2);
+               $params = [2];
 
                $this->setMapperResult($sql, $params, [], null, null, true);
                $entity = new Example();
@@ -153,7 +153,7 @@ class MapperTest extends MapperTestUtility {
 
                $sql = 'INSERT INTO `*PREFIX*table`(`pre_name`,`email`) ' .
                                'VALUES(?,?)';
-               $params = array('john', 'my@email');
+               $params = ['john', 'my@email'];
                $entity = new Example();
                $entity->setPreName($params[0]);
                $entity->setEmail($params[1]);
@@ -173,7 +173,7 @@ class MapperTest extends MapperTestUtility {
 
                $sql = 'INSERT INTO `*PREFIX*table`(`pre_name`,`email`) ' .
                                'VALUES(?,?)';
-               $params = array('john', 'my@email');
+               $params = ['john', 'my@email'];
                $entity = new Example();
                $entity->setPreName($params[0]);
                $entity->setEmail($params[1]);
@@ -202,7 +202,7 @@ class MapperTest extends MapperTestUtility {
                                '`email` = ? ' .
                                'WHERE `id` = ?';
 
-               $params = array('john', 'my@email', 1);
+               $params = ['john', 'my@email', 1];
                $entity = new Example();
                $entity->setPreName($params[0]);
                $entity->setEmail($params[1]);
@@ -215,7 +215,7 @@ class MapperTest extends MapperTestUtility {
 
 
        public function testUpdateNoId(){
-               $params = array('john', 'my@email');
+               $params = ['john', 'my@email'];
                $entity = new Example();
                $entity->setPreName($params[0]);
                $entity->setEmail($params[1]);
@@ -227,7 +227,7 @@ class MapperTest extends MapperTestUtility {
 
 
        public function testUpdateNothingChangedNoQuery(){
-               $params = array('john', 'my@email');
+               $params = ['john', 'my@email'];
                $entity = new Example();
                $entity->setId(3);
                $entity->setEmail($params[1]);
@@ -241,7 +241,7 @@ class MapperTest extends MapperTestUtility {
 
 
        public function testMapRowToEntity(){
-               $entity1 = $this->mapper->mapRow(array('pre_name' => 'test1', 'email' => 'test2'));
+               $entity1 = $this->mapper->mapRow(['pre_name' => 'test1', 'email' => 'test2']);
                $entity2 = new Example();
                $entity2->setPreName('test1');
                $entity2->setEmail('test2');
@@ -251,38 +251,38 @@ class MapperTest extends MapperTestUtility {
 
        public function testFindEntities(){
                $sql = 'hi';
-               $rows = array(
-                       array('pre_name' => 'hi')
-               );
+               $rows = [
+                       ['pre_name' => 'hi']
+               ];
                $entity = new Example();
                $entity->setPreName('hi');
                $entity->resetUpdatedFields();
-               $this->setMapperResult($sql, array(), $rows, null, null, true);
+               $this->setMapperResult($sql, [], $rows, null, null, true);
                $result = $this->mapper->findAllEntities($sql);
-               $this->assertEquals(array($entity), $result);
+               $this->assertEquals([$entity], $result);
        }
 
        public function testFindEntitiesNotFound(){
                $sql = 'hi';
-               $rows = array();
-               $this->setMapperResult($sql, array(), $rows);
+               $rows = [];
+               $this->setMapperResult($sql, [], $rows);
                $result = $this->mapper->findAllEntities($sql);
-               $this->assertEquals(array(), $result);
+               $this->assertEquals([], $result);
        }
 
        public function testFindEntitiesMultiple(){
                $sql = 'hi';
-               $rows = array(
-                       array('pre_name' => 'jo'), array('email' => 'ho')
-               );
+               $rows = [
+                       ['pre_name' => 'jo'], ['email' => 'ho']
+               ];
                $entity1 = new Example();
                $entity1->setPreName('jo');
                $entity1->resetUpdatedFields();
                $entity2 = new Example();
                $entity2->setEmail('ho');
                $entity2->resetUpdatedFields();
-               $this->setMapperResult($sql, array(), $rows);
+               $this->setMapperResult($sql, [], $rows);
                $result = $this->mapper->findAllEntities($sql);
-               $this->assertEquals(array($entity1, $entity2), $result);
+               $this->assertEquals([$entity1, $entity2], $result);
        }
 }
index cddf015cbea9078836e4fbaf0a1a6cfa9879f0ed..11905a9bbbb2e603011f745afbed119552046770 100644 (file)
@@ -89,7 +89,7 @@ abstract class MapperTestUtility extends \Test\TestCase {
         * of the database query. If not provided, it wont be assumed that fetch
         * will be called on the result
         */
-       protected function setMapperResult($sql, $arguments=array(), $returnRows=array(),
+       protected function setMapperResult($sql, $arguments=[], $returnRows=[],
                $limit=null, $offset=null, $expectClose=false){
                if($limit === null && $offset === null) {
                        $this->db->expects($this->at($this->prepareAt))
index b629c6d385ea98ab97647cd1b2b6186b93e6dfaf..7af11807d87a49f773c9d890da6d1c2d607ebb67 100644 (file)
@@ -41,15 +41,15 @@ class DataResponseTest extends \Test\TestCase {
 
 
        public function testSetData() {
-               $params = array('hi', 'yo');
+               $params = ['hi', 'yo'];
                $this->response->setData($params);
 
-               $this->assertEquals(array('hi', 'yo'), $this->response->getData());
+               $this->assertEquals(['hi', 'yo'], $this->response->getData());
        }
 
 
        public function testConstructorAllowsToSetData() {
-               $data = array('hi');
+               $data = ['hi'];
                $code = 300;
                $response = new DataResponse($data, $code);
 
@@ -59,9 +59,9 @@ class DataResponseTest extends \Test\TestCase {
 
 
        public function testConstructorAllowsToSetHeaders() {
-               $data = array('hi');
+               $data = ['hi'];
                $code = 300;
-               $headers = array('test' => 'something');
+               $headers = ['test' => 'something'];
                $response = new DataResponse($data, $code, $headers);
 
                $expectedHeaders = [
@@ -78,12 +78,12 @@ class DataResponseTest extends \Test\TestCase {
 
 
        public function testChainability() {
-               $params = array('hi', 'yo');
+               $params = ['hi', 'yo'];
                $this->response->setData($params)
                        ->setStatus(Http::STATUS_NOT_FOUND);
 
                $this->assertEquals(Http::STATUS_NOT_FOUND, $this->response->getStatus());
-               $this->assertEquals(array('hi', 'yo'), $this->response->getData());
+               $this->assertEquals(['hi', 'yo'], $this->response->getData());
        }
 
 
index 494f19a6d24ab548829ea304cc8d5bb5fd5bdf31..b6b43d4a5d38c156c02684f79d6862a33bf13c70 100644 (file)
@@ -52,9 +52,9 @@ class TestController extends Controller {
         */
        public function exec($int, $bool, $test=4, $test2=1) {
                $this->registerResponder('text', function($in) {
-                       return new JSONResponse(array('text' => $in));
+                       return new JSONResponse(['text' => $in]);
                });
-               return array($int, $bool, $test, $test2);
+               return [$int, $bool, $test, $test2];
        }
 
 
@@ -66,9 +66,9 @@ class TestController extends Controller {
         * @return DataResponse
         */
        public function execDataResponse($int, $bool, $test=4, $test2=1) {
-               return new DataResponse(array(
-                       'text' => array($int, $bool, $test, $test2)
-               ));
+               return new DataResponse([
+                       'text' => [$int, $bool, $test, $test2]
+               ]);
        }
 
 }
@@ -140,7 +140,7 @@ class DispatcherTest extends \Test\TestCase {
         * @param string $httpHeaders
         */
        private function setMiddlewareExpectations($out=null,
-               $httpHeaders=null, $responseHeaders=array(),
+               $httpHeaders=null, $responseHeaders=[],
                $ex=false, $catchEx=true) {
 
                if($ex) {
@@ -226,7 +226,7 @@ class DispatcherTest extends \Test\TestCase {
 
                $response = $this->dispatcher->dispatch($this->controller, $this->controllerMethod);
                $this->assertNull($response[0]);
-               $this->assertEquals(array(), $response[1]);
+               $this->assertEquals([], $response[1]);
                $this->assertNull($response[2]);
        }
 
@@ -234,7 +234,7 @@ class DispatcherTest extends \Test\TestCase {
        public function testHeadersAndOutputAreReturned(){
                $out = 'yo';
                $httpHeaders = 'Http';
-               $responseHeaders = array('hell' => 'yeah');
+               $responseHeaders = ['hell' => 'yeah'];
                $this->setMiddlewareExpectations($out, $httpHeaders, $responseHeaders);
 
                $response = $this->dispatcher->dispatch($this->controller,
@@ -249,7 +249,7 @@ class DispatcherTest extends \Test\TestCase {
        public function testExceptionCallsAfterException() {
                $out = 'yo';
                $httpHeaders = 'Http';
-               $responseHeaders = array('hell' => 'yeah');
+               $responseHeaders = ['hell' => 'yeah'];
                $this->setMiddlewareExpectations($out, $httpHeaders, $responseHeaders, true);
 
                $response = $this->dispatcher->dispatch($this->controller,
index 79c03ce1ab0637087a8f10e551a0ad9edebe5df4..14097a2a581502f25c8d1a054f5e98ca141cef1f 100644 (file)
@@ -37,7 +37,7 @@ class HttpTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->server = array();
+               $this->server = [];
                $this->http = new Http($this->server);
        }
 
@@ -56,7 +56,7 @@ class HttpTest extends \Test\TestCase {
 
 
        public function testEtagMatchReturnsNotModified() {
-               $http = new Http(array('HTTP_IF_NONE_MATCH' => 'hi'));
+               $http = new Http(['HTTP_IF_NONE_MATCH' => 'hi']);
 
                $header = $http->getStatusHeader(Http::STATUS_OK, null, 'hi');
                $this->assertEquals('HTTP/1.1 304 Not Modified', $header);
@@ -64,7 +64,7 @@ class HttpTest extends \Test\TestCase {
 
 
        public function testQuotedEtagMatchReturnsNotModified() {
-               $http = new Http(array('HTTP_IF_NONE_MATCH' => '"hi"'));
+               $http = new Http(['HTTP_IF_NONE_MATCH' => '"hi"']);
 
                $header = $http->getStatusHeader(Http::STATUS_OK, null, 'hi');
                $this->assertEquals('HTTP/1.1 304 Not Modified', $header);
@@ -76,8 +76,8 @@ class HttpTest extends \Test\TestCase {
                $dateTime->setTimestamp('12');
 
                $http = new Http(
-                       array(
-                               'HTTP_IF_MODIFIED_SINCE' => 'Thu, 01 Jan 1970 00:00:12 +0000')
+                       [
+                               'HTTP_IF_MODIFIED_SINCE' => 'Thu, 01 Jan 1970 00:00:12 +0000']
                        );
 
                $header = $http->getStatusHeader(Http::STATUS_OK, $dateTime);
@@ -87,7 +87,7 @@ class HttpTest extends \Test\TestCase {
 
 
        public function testTempRedirectBecomesFoundInHttp10() {
-               $http = new Http(array(), 'HTTP/1.0');
+               $http = new Http([], 'HTTP/1.0');
 
                $header = $http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT);
                $this->assertEquals('HTTP/1.0 302 Found', $header);
index 95d2e2a0a4c42def8ea2a933dc0afee6b26e251c..2a0978db62a8510e80a12f6d1792fec8b6332ee0 100644 (file)
@@ -49,15 +49,15 @@ class JSONResponseTest extends \Test\TestCase {
 
 
        public function testSetData() {
-               $params = array('hi', 'yo');
+               $params = ['hi', 'yo'];
                $this->json->setData($params);
 
-               $this->assertEquals(array('hi', 'yo'), $this->json->getData());
+               $this->assertEquals(['hi', 'yo'], $this->json->getData());
        }
 
 
        public function testSetRender() {
-               $params = array('test' => 'hi');
+               $params = ['test' => 'hi'];
                $this->json->setData($params);
 
                $expected = '{"test":"hi"}';
@@ -100,7 +100,7 @@ class JSONResponseTest extends \Test\TestCase {
        }
 
        public function testConstructorAllowsToSetData() {
-               $data = array('hi');
+               $data = ['hi'];
                $code = 300;
                $response = new JSONResponse($data, $code);
 
@@ -110,12 +110,12 @@ class JSONResponseTest extends \Test\TestCase {
        }
 
        public function testChainability() {
-               $params = array('hi', 'yo');
+               $params = ['hi', 'yo'];
                $this->json->setData($params)
                        ->setStatus(Http::STATUS_NOT_FOUND);
 
                $this->assertEquals(Http::STATUS_NOT_FOUND, $this->json->getStatus());
-               $this->assertEquals(array('hi', 'yo'), $this->json->getData());
+               $this->assertEquals(['hi', 'yo'], $this->json->getData());
        }
 
 }
index 8f6dffd4e91882bc3292a2a7478f2d638aa39071..97951ea4b9f95b80465f2f41df4b1bc41e01635e 100644 (file)
@@ -77,7 +77,7 @@ class RequestStream {
        public function stream_stat() {
                $size = strlen($GLOBALS[$this->varname]);
                $time = time();
-               $data = array(
+               $data = [
                        'dev' => 0,
                        'ino' => 0,
                        'mode' => 0777,
@@ -91,7 +91,7 @@ class RequestStream {
                        'ctime' => $time,
                        'blksize' => -1,
                        'blocks' => -1,
-               );
+               ];
                return array_values($data) + $data;
                //return false;
        }
index 67fef79dcff4e747470b348b204dd175b05aff61..8f7c26cc9529f0b143b57a324b3f9d6e85048719 100644 (file)
@@ -51,10 +51,10 @@ class RequestTest extends \Test\TestCase {
        }
 
        public function testRequestAccessors() {
-               $vars = array(
-                       'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+               $vars = [
+                       'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
                        'method' => 'GET',
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -82,12 +82,12 @@ class RequestTest extends \Test\TestCase {
 
        // urlParams has precedence over POST which has precedence over GET
        public function testPrecedence() {
-               $vars = array(
-                       'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
-                       'post' => array('name' => 'Jane Doe', 'nickname' => 'Janey'),
-                       'urlParams' => array('user' => 'jw', 'name' => 'Johnny Weissmüller'),
+               $vars = [
+                       'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
+                       'post' => ['name' => 'Jane Doe', 'nickname' => 'Janey'],
+                       'urlParams' => ['user' => 'jw', 'name' => 'Johnny Weissmüller'],
                        'method' => 'GET'
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -107,10 +107,10 @@ class RequestTest extends \Test\TestCase {
        public function testImmutableArrayAccess() {
                $this->expectException(\RuntimeException::class);
 
-               $vars = array(
-                       'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+               $vars = [
+                       'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
                        'method' => 'GET'
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -127,10 +127,10 @@ class RequestTest extends \Test\TestCase {
        public function testImmutableMagicAccess() {
                $this->expectException(\RuntimeException::class);
 
-               $vars = array(
-                       'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+               $vars = [
+                       'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
                        'method' => 'GET'
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -147,10 +147,10 @@ class RequestTest extends \Test\TestCase {
        public function testGetTheMethodRight() {
                $this->expectException(\LogicException::class);
 
-               $vars = array(
-                       'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+               $vars = [
+                       'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
                        'method' => 'GET',
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -164,10 +164,10 @@ class RequestTest extends \Test\TestCase {
        }
 
        public function testTheMethodIsRight() {
-               $vars = array(
-                       'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+               $vars = [
+                       'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
                        'method' => 'GET',
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -186,10 +186,10 @@ class RequestTest extends \Test\TestCase {
        public function testJsonPost() {
                global $data;
                $data = '{"name": "John Q. Public", "nickname": "Joey"}';
-               $vars = array(
+               $vars = [
                        'method' => 'POST',
-                       'server' => array('CONTENT_TYPE' => 'application/json; utf-8')
-               );
+                       'server' => ['CONTENT_TYPE' => 'application/json; utf-8']
+               ];
 
                $request = new Request(
                        $vars,
@@ -210,10 +210,10 @@ class RequestTest extends \Test\TestCase {
        public function testNotJsonPost() {
                global $data;
                $data = 'this is not valid json';
-               $vars = array(
+               $vars = [
                        'method' => 'POST',
-                       'server' => array('CONTENT_TYPE' => 'application/json; utf-8')
-               );
+                       'server' => ['CONTENT_TYPE' => 'application/json; utf-8']
+               ];
 
                $request = new Request(
                        $vars,
@@ -230,12 +230,12 @@ class RequestTest extends \Test\TestCase {
 
        public function testPatch() {
                global $data;
-               $data = http_build_query(array('name' => 'John Q. Public', 'nickname' => 'Joey'), '', '&');
+               $data = http_build_query(['name' => 'John Q. Public', 'nickname' => 'Joey'], '', '&');
 
-               $vars = array(
+               $vars = [
                        'method' => 'PATCH',
-                       'server' => array('CONTENT_TYPE' => 'application/x-www-form-urlencoded'),
-               );
+                       'server' => ['CONTENT_TYPE' => 'application/x-www-form-urlencoded'],
+               ];
 
                $request = new Request(
                        $vars,
@@ -257,10 +257,10 @@ class RequestTest extends \Test\TestCase {
 
                // PUT content
                $data = '{"name": "John Q. Public", "nickname": "Joey"}';
-               $vars = array(
+               $vars = [
                        'method' => 'PUT',
-                       'server' => array('CONTENT_TYPE' => 'application/json; utf-8'),
-               );
+                       'server' => ['CONTENT_TYPE' => 'application/json; utf-8'],
+               ];
 
                $request = new Request(
                        $vars,
@@ -278,10 +278,10 @@ class RequestTest extends \Test\TestCase {
 
                // PATCH content
                $data = '{"name": "John Q. Public", "nickname": null}';
-               $vars = array(
+               $vars = [
                        'method' => 'PATCH',
-                       'server' => array('CONTENT_TYPE' => 'application/json; utf-8'),
-               );
+                       'server' => ['CONTENT_TYPE' => 'application/json; utf-8'],
+               ];
 
                $request = new Request(
                        $vars,
@@ -302,14 +302,14 @@ class RequestTest extends \Test\TestCase {
                global $data;
                $data = file_get_contents(__DIR__ . '/../../../data/testimage.png');
 
-               $vars = array(
+               $vars = [
                        'put' => $data,
                        'method' => 'PUT',
                        'server' => [
                                'CONTENT_TYPE' => 'image/png',
                                'CONTENT_LENGTH' => (string)strlen($data)
                        ],
-               );
+               ];
 
                $request = new Request(
                        $vars,
@@ -335,11 +335,11 @@ class RequestTest extends \Test\TestCase {
 
 
        public function testSetUrlParameters() {
-               $vars = array(
-                       'post' => array(),
+               $vars = [
+                       'post' => [],
                        'method' => 'POST',
-                       'urlParams' => array('id' => '2'),
-               );
+                       'urlParams' => ['id' => '2'],
+               ];
 
                $request = new Request(
                        $vars,
@@ -349,7 +349,7 @@ class RequestTest extends \Test\TestCase {
                        $this->stream
                );
 
-               $newParams = array('id' => '3', 'test' => 'test2');
+               $newParams = ['id' => '3', 'test' => 'test2'];
                $request->setUrlParameters($newParams);
                $this->assertSame('test2', $request->getParam('test'));
                $this->assertEquals('3', $request->getParam('id'));
index 3d76d24496dab0ec93f313341a38aefe5de7b93a..86a909b7688aaedd9157b1c0eff96d70f950589b 100644 (file)
@@ -49,11 +49,11 @@ class ResponseTest extends \Test\TestCase {
 
 
        public function testSetHeaders() {
-               $expected = array(
+               $expected = [
                        'Last-Modified' => 1,
                        'ETag' => 3,
                        'Something-Else' => 'hi'
-               );
+               ];
 
                $this->childResponse->setHeaders($expected);
                $headers = $this->childResponse->getHeaders();
@@ -105,31 +105,31 @@ class ResponseTest extends \Test\TestCase {
                $this->childResponse->addCookie('foo', 'bar');
                $this->childResponse->addCookie('bar', 'foo', new \DateTime('1970-01-01'));
 
-               $expectedResponse = array(
-                       'foo' => array(
+               $expectedResponse = [
+                       'foo' => [
                                'value' => 'bar',
                                'expireDate' => null,
-                       ),
-                       'bar' => array(
+                       ],
+                       'bar' => [
                                'value' => 'foo',
                                'expireDate' => new \DateTime('1970-01-01')
-                       )
-               );
+                       ]
+               ];
                $this->assertEquals($expectedResponse, $this->childResponse->getCookies());
        }
 
 
        function testSetCookies() {
-               $expected = array(
-                       'foo' => array(
+               $expected = [
+                       'foo' => [
                                'value' => 'bar',
                                'expireDate' => null,
-                       ),
-                       'bar' => array(
+                       ],
+                       'bar' => [
                                'value' => 'foo',
                                'expireDate' => new \DateTime('1970-01-01')
-                       )
-               );
+                       ]
+               ];
 
                $this->childResponse->setCookies($expected);
                $cookies = $this->childResponse->getCookies();
@@ -141,12 +141,12 @@ class ResponseTest extends \Test\TestCase {
        function testInvalidateCookie() {
                $this->childResponse->addCookie('foo', 'bar');
                $this->childResponse->invalidateCookie('foo');
-               $expected = array(
-                       'foo' => array(
+               $expected = [
+                       'foo' => [
                                'value' => 'expired',
                                'expireDate' => new \DateTime('1971-01-01')
-                       )
-               );
+                       ]
+               ];
 
                $cookies = $this->childResponse->getCookies();
 
@@ -157,30 +157,30 @@ class ResponseTest extends \Test\TestCase {
        function testInvalidateCookies() {
                $this->childResponse->addCookie('foo', 'bar');
                $this->childResponse->addCookie('bar', 'foo');
-               $expected = array(
-                       'foo' => array(
+               $expected = [
+                       'foo' => [
                                'value' => 'bar',
                                'expireDate' => null
-                       ),
-                       'bar' => array(
+                       ],
+                       'bar' => [
                                'value' => 'foo',
                                'expireDate' => null
-                       )
-               );
+                       ]
+               ];
                $cookies = $this->childResponse->getCookies();
                $this->assertEquals($expected, $cookies);
 
-               $this->childResponse->invalidateCookies(array('foo', 'bar'));
-               $expected = array(
-                       'foo' => array(
+               $this->childResponse->invalidateCookies(['foo', 'bar']);
+               $expected = [
+                       'foo' => [
                                'value' => 'expired',
                                'expireDate' => new \DateTime('1971-01-01')
-                       ),
-                       'bar' => array(
+                       ],
+                       'bar' => [
                                'value' => 'expired',
                                'expireDate' => new \DateTime('1971-01-01')
-                       )
-               );
+                       ]
+               ];
 
                $cookies = $this->childResponse->getCookies();
                $this->assertEquals($expected, $cookies);
index 6672b4d0c1ec3809ed459f2fa14185973ba02b79..af5b428cf869b2a8b44b5462ea54747bdcb74c74 100644 (file)
@@ -41,26 +41,26 @@ class TemplateResponseTest extends \Test\TestCase {
 
 
        public function testSetParamsConstructor(){
-               $params = array('hi' => 'yo');
+               $params = ['hi' => 'yo'];
                $this->tpl = new TemplateResponse('app', 'home', $params);
 
-               $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams());
+               $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams());
        }
 
 
        public function testSetRenderAsConstructor(){
                $renderAs = 'myrender';
-               $this->tpl = new TemplateResponse('app', 'home', array(), $renderAs);
+               $this->tpl = new TemplateResponse('app', 'home', [], $renderAs);
 
                $this->assertEquals($renderAs, $this->tpl->getRenderAs());
        }
 
 
        public function testSetParams(){
-               $params = array('hi' => 'yo');
+               $params = ['hi' => 'yo'];
                $this->tpl->setParams($params);
 
-               $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams());
+               $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams());
        }
 
 
@@ -75,12 +75,12 @@ class TemplateResponseTest extends \Test\TestCase {
        }
 
        public function testChainability() {
-               $params = array('hi' => 'yo');
+               $params = ['hi' => 'yo'];
                $this->tpl->setParams($params)
                        ->setStatus(Http::STATUS_NOT_FOUND);
 
                $this->assertEquals(Http::STATUS_NOT_FOUND, $this->tpl->getStatus());
-               $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams());
+               $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams());
        }
 
 }
index 4d184adcdb1e4c54793ccdb6728cb0f70d2ae8e0..95f8996dbdb8e1cf75a2ce715b97478ea23ee3b5 100644 (file)
@@ -15,9 +15,9 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRoute()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET')
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET']
+               ]];
 
                $this->assertSimpleRoute($routes, 'folders.open', 'GET', '/folders/{folderId}/open', 'FoldersController', 'open');
        }
@@ -33,9 +33,9 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRouteWithMissingVerb()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'folders#open', 'url' => '/folders/{folderId}/open')
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders#open', 'url' => '/folders/{folderId}/open']
+               ]];
 
                $this->assertSimpleRoute($routes, 'folders.open', 'GET', '/folders/{folderId}/open', 'FoldersController', 'open');
        }
@@ -51,9 +51,9 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRouteWithLowercaseVerb()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete')
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
+               ]];
 
                $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open');
        }
@@ -69,11 +69,11 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRouteWithRequirements()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'requirements' => array('something'))
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'requirements' => ['something']]
+               ]];
 
-               $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array('something'));
+               $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', ['something']);
        }
 
        public function testSimpleOCSRouteWithRequirements() {
@@ -87,11 +87,11 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRouteWithDefaults()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', array(), 'defaults' => array('param' => 'foobar'))
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', [], 'defaults' => ['param' => 'foobar']]
+               ]];
 
-               $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array('param' => 'foobar'));
+               $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', [], ['param' => 'foobar']);
        }
 
 
@@ -106,11 +106,11 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRouteWithPostfix()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something')
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something']
+               ]];
 
-               $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array(), '_something');
+               $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', [], [], '_something');
        }
 
        public function testSimpleOCSRouteWithPostfix() {
@@ -127,9 +127,9 @@ class RoutingTest extends \Test\TestCase
        {
                $this->expectException(\UnexpectedValueException::class);
 
-               $routes = array('routes' => array(
-                       array('name' => 'folders_open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete')
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'folders_open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
+               ]];
 
                // router mock
                $router = $this->getMockBuilder('\OC\Route\Router')
@@ -167,9 +167,9 @@ class RoutingTest extends \Test\TestCase
 
        public function testSimpleRouteWithUnderScoreNames()
        {
-               $routes = array('routes' => array(
-                       array('name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete')
-               ));
+               $routes = ['routes' => [
+                       ['name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
+               ]];
 
                $this->assertSimpleRoute($routes, 'admin_folders.open_current', 'DELETE', '/folders/{folderId}/open', 'AdminFoldersController', 'openCurrent');
        }
@@ -205,14 +205,14 @@ class RoutingTest extends \Test\TestCase
 
        public function testResource()
        {
-               $routes = array('resources' => array('account' => array('url' => '/accounts')));
+               $routes = ['resources' => ['account' => ['url' => '/accounts']]];
 
                $this->assertResource($routes, 'account', '/accounts', 'AccountController', 'id');
        }
 
        public function testResourceWithUnderScoreName()
        {
-               $routes = array('resources' => array('admin_accounts' => array('url' => '/admin/accounts')));
+               $routes = ['resources' => ['admin_accounts' => ['url' => '/admin/accounts']]];
 
                $this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'id');
        }
@@ -224,7 +224,7 @@ class RoutingTest extends \Test\TestCase
         * @param string $controllerName
         * @param string $actionName
         */
-       private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=array(), array $defaults=array(), $postfix='')
+       private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=[], array $defaults=[], $postfix='')
        {
                if ($postfix) {
                        $name .= $postfix;
@@ -270,8 +270,8 @@ class RoutingTest extends \Test\TestCase
                                                                                  $url,
                                                                                  $controllerName,
                                                                                  $actionName,
-                                                                                 array $requirements=array(),
-                                                                                 array $defaults=array(),
+                                                                                 array $requirements=[],
+                                                                                 array $defaults=[],
                                                                                  $postfix='')
        {
                if ($postfix) {
@@ -437,8 +437,8 @@ class RoutingTest extends \Test\TestCase
                $verb,
                $controllerName,
                $actionName,
-               array $requirements=array(),
-               array $defaults=array()
+               array $requirements=[],
+               array $defaults=[]
        ) {
                $route = $this->getMockBuilder('\OC\Route\Route')
                        ->setMethods(['method', 'action', 'requirements', 'defaults'])
index fe1fc5bfa1a58899c78c618504cabd43111aefc2..5a3c3f2a007255e56f5e728eed32686f67b4160c 100644 (file)
@@ -193,7 +193,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
                        'arguments'
                );
 
-               $this->assertEquals(array('arg' => null, 'arg2' => 'hi'), $reader->getParameters());
+               $this->assertEquals(['arg' => null, 'arg2' => 'hi'], $reader->getParameters());
        }
 
 
@@ -205,7 +205,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
                        'arguments2'
                );
 
-               $this->assertEquals(array('arg' => null), $reader->getParameters());
+               $this->assertEquals(['arg' => null], $reader->getParameters());
        }
 
 
index 3ec70d7142afd8a465009c2c9d07a7f10878db82..75084e7f0f368867f0e11ce2ec782d5f030bf9b0 100644 (file)
@@ -28,245 +28,245 @@ class AppTest extends \Test\TestCase {
        const TEST_GROUP2 = 'group2';
 
        public function appVersionsProvider() {
-               return array(
+               return [
                        // exact match
-                       array(
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '6.0',
                                        'requiremax' => '6.0',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // in-between match
-                       array(
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '5.0',
                                        'requiremax' => '7.0',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // app too old
-                       array(
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '5.0',
                                        'requiremax' => '5.0',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // app too new
-                       array(
+                       [
                                '5.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '6.0',
                                        'requiremax' => '6.0',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // only min specified
-                       array(
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '6.0',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // only min specified fail
-                       array(
+                       [
                                '5.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '6.0',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // only min specified legacy
-                       array(
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'require' => '6.0',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // only min specified legacy fail
-                       array(
+                       [
                                '4.0.0.0',
-                               array(
+                               [
                                        'require' => '6.0',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // only max specified
-                       array(
+                       [
                                '5.0.0.0',
-                               array(
+                               [
                                        'requiremax' => '6.0',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // only max specified fail
-                       array(
+                       [
                                '7.0.0.0',
-                               array(
+                               [
                                        'requiremax' => '6.0',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // variations of versions
                        // single OC number
-                       array(
+                       [
                                '4',
-                               array(
+                               [
                                        'require' => '4.0',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // multiple OC number
-                       array(
+                       [
                                '4.3.1',
-                               array(
+                               [
                                        'require' => '4.3',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // single app number
-                       array(
+                       [
                                '4',
-                               array(
+                               [
                                        'require' => '4',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // single app number fail
-                       array(
+                       [
                                '4.3',
-                               array(
+                               [
                                        'require' => '5',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // complex
-                       array(
+                       [
                                '5.0.0',
-                               array(
+                               [
                                        'require' => '4.5.1',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // complex fail
-                       array(
+                       [
                                '4.3.1',
-                               array(
+                               [
                                        'require' => '4.3.2',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // two numbers
-                       array(
+                       [
                                '4.3.1',
-                               array(
+                               [
                                        'require' => '4.4',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // one number fail
-                       array(
+                       [
                                '4.3.1',
-                               array(
+                               [
                                        'require' => '5',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // pre-alpha app
-                       array(
+                       [
                                '5.0.3',
-                               array(
+                               [
                                        'require' => '4.93',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // pre-alpha OC
-                       array(
+                       [
                                '6.90.0.2',
-                               array(
+                               [
                                        'require' => '6.90',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // pre-alpha OC max
-                       array(
+                       [
                                '6.90.0.2',
-                               array(
+                               [
                                        'requiremax' => '7',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // expect same major number match
-                       array(
+                       [
                                '5.0.3',
-                               array(
+                               [
                                        'require' => '5',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // expect same major number match
-                       array(
+                       [
                                '5.0.3',
-                               array(
+                               [
                                        'requiremax' => '5',
-                               ),
+                               ],
                                true
-                       ),
+                       ],
                        // dependencies versions before require*
-                       array(
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '5.0',
                                        'requiremax' => '7.0',
-                                       'dependencies' => array(
-                                               'owncloud' => array(
-                                                       '@attributes' => array(
+                                       'dependencies' => [
+                                               'owncloud' => [
+                                                       '@attributes' => [
                                                                'min-version' => '7.0',
                                                                'max-version' => '7.0',
-                                                       ),
-                                               ),
-                                       ),
-                               ),
+                                                       ],
+                                               ],
+                                       ],
+                               ],
                                false
-                       ),
-                       array(
+                       ],
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '5.0',
                                        'requiremax' => '7.0',
-                                       'dependencies' => array(
-                                               'owncloud' => array(
-                                                       '@attributes' => array(
+                                       'dependencies' => [
+                                               'owncloud' => [
+                                                       '@attributes' => [
                                                                'min-version' => '5.0',
                                                                'max-version' => '5.0',
-                                                       ),
-                                               ),
-                                       ),
-                               ),
+                                                       ],
+                                               ],
+                                       ],
+                               ],
                                false
-                       ),
-                       array(
+                       ],
+                       [
                                '6.0.0.0',
-                               array(
+                               [
                                        'requiremin' => '5.0',
                                        'requiremax' => '5.0',
-                                       'dependencies' => array(
-                                               'owncloud' => array(
-                                                       '@attributes' => array(
+                                       'dependencies' => [
+                                               'owncloud' => [
+                                                       '@attributes' => [
                                                                'min-version' => '5.0',
                                                                'max-version' => '7.0',
-                                                       ),
-                                               ),
-                                       ),
-                               ),
+                                                       ],
+                                               ],
+                                       ],
+                               ],
                                true
-                       ),
+                       ],
                        [
                                '9.2.0.0',
                                [
@@ -301,7 +301,7 @@ class AppTest extends \Test\TestCase {
                                ],
                                true
                        ],
-               );
+               ];
        }
 
        /**
@@ -329,11 +329,11 @@ class AppTest extends \Test\TestCase {
         * Providers for the app config values
         */
        public function appConfigValuesProvider() {
-               return array(
+               return [
                        // logged in user1
-                       array(
+                       [
                                self::TEST_USER1,
-                               array(
+                               [
                                        'files',
                                        'app1',
                                        'app3',
@@ -349,13 +349,13 @@ class AppTest extends \Test\TestCase {
                                        'twofactor_backupcodes',
                                        'viewer',
                                        'workflowengine',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // logged in user2
-                       array(
+                       [
                                self::TEST_USER2,
-                               array(
+                               [
                                        'files',
                                        'app1',
                                        'app3',
@@ -371,13 +371,13 @@ class AppTest extends \Test\TestCase {
                                        'twofactor_backupcodes',
                                        'viewer',
                                        'workflowengine',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        // logged in user3
-                       array(
+                       [
                                self::TEST_USER3,
-                               array(
+                               [
                                        'files',
                                        'app1',
                                        'app3',
@@ -394,13 +394,13 @@ class AppTest extends \Test\TestCase {
                                        'twofactor_backupcodes',
                                        'viewer',
                                        'workflowengine',
-                               ),
+                               ],
                                false
-                       ),
+                       ],
                        //  no user, returns all apps
-                       array(
+                       [
                                null,
-                               array(
+                               [
                                        'files',
                                        'app1',
                                        'app3',
@@ -417,13 +417,13 @@ class AppTest extends \Test\TestCase {
                                        'twofactor_backupcodes',
                                        'viewer',
                                        'workflowengine',
-                               ),
+                               ],
                                false,
-                       ),
+                       ],
                        //  user given, but ask for all
-                       array(
+                       [
                                self::TEST_USER1,
-                               array(
+                               [
                                        'files',
                                        'app1',
                                        'app3',
@@ -440,10 +440,10 @@ class AppTest extends \Test\TestCase {
                                        'twofactor_backupcodes',
                                        'viewer',
                                        'workflowengine',
-                               ),
+                               ],
                                true,
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
@@ -470,14 +470,14 @@ class AppTest extends \Test\TestCase {
                $this->setupAppConfigMock()->expects($this->once())
                        ->method('getValues')
                        ->willReturn(
-                               array(
+                               [
                                        'app3' => 'yes',
                                        'app2' => 'no',
                                        'app1' => 'yes',
                                        'appforgroup1' => '["group1"]',
                                        'appforgroup2' => '["group2"]',
                                        'appforgroup12' => '["group2","group1"]',
-                               )
+                               ]
                        
                        );
 
@@ -509,19 +509,19 @@ class AppTest extends \Test\TestCase {
                $this->setupAppConfigMock()->expects($this->once())
                        ->method('getValues')
                        ->willReturn(
-                               array(
+                               [
                                        'app3' => 'yes',
                                        'app2' => 'no',
-                               )
+                               ]
                        
                        );
 
                $apps = \OC_App::getEnabledApps();
-               $this->assertEquals(array('files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'), $apps);
+               $this->assertEquals(['files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'], $apps);
 
                // mock should not be called again here
                $apps = \OC_App::getEnabledApps();
-               $this->assertEquals(array('files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'), $apps);
+               $this->assertEquals(['files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'], $apps);
 
                $this->restoreAppConfig();
                \OC_User::setUserId(null);
index bdfe65d4304b84c45efb5201cfd014bad8b9c47b..8ecedb189ce1bd7ff5f82796649c99ced0cad643 100644 (file)
@@ -29,7 +29,7 @@ abstract class TestBase extends \Test\TestCase {
        public function testGetFiles() {
                $this->instance=$this->getExisting();
                $allFiles=$this->instance->getFiles();
-               $expected=array('lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt');
+               $expected=['lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt'];
                $this->assertEquals(4, count($allFiles), 'only found '.count($allFiles).' out of 4 expected files');
                foreach($expected as $file) {
                        $this->assertContains($file, $allFiles, 'cant find '.  $file . ' in archive');
@@ -38,14 +38,14 @@ abstract class TestBase extends \Test\TestCase {
                $this->assertFalse($this->instance->fileExists('non/existing/file'));
 
                $rootContent=$this->instance->getFolder('');
-               $expected=array('lorem.txt','logo-wide.png', 'dir/');
+               $expected=['lorem.txt','logo-wide.png', 'dir/'];
                $this->assertEquals(3, count($rootContent));
                foreach($expected as $file) {
                        $this->assertContains($file, $rootContent, 'cant find '.  $file . ' in archive');
                }
 
                $dirContent=$this->instance->getFolder('dir/');
-               $expected=array('lorem.txt');
+               $expected=['lorem.txt'];
                $this->assertEquals(1, count($dirContent));
                foreach($expected as $file) {
                        $this->assertContains($file, $dirContent, 'cant find '.  $file . ' in archive');
index fe8ca5aefe25f2e889297f0f625a9db222d0b798..4b8de82b36835358011ea761a37f88d608d73d25 100644 (file)
@@ -18,7 +18,7 @@ class DummyJobList extends \OC\BackgroundJob\JobList {
        /**
         * @var IJob[]
         */
-       private $jobs = array();
+       private $jobs = [];
 
        private $last = 0;
 
index 6e99a71d1e3372fe72a8d82a17a242eef194b952..3013afdfa1d999cfcded1a362f55ac325e0afd8c 100644 (file)
@@ -64,16 +64,16 @@ class JobListTest extends TestCase {
        }
 
        public function argumentProvider() {
-               return array(
-                       array(null),
-                       array(false),
-                       array('foobar'),
-                       array(12),
-                       array(array(
+               return [
+                       [null],
+                       [false],
+                       ['foobar'],
+                       [12],
+                       [[
                                'asd' => 5,
                                'foo' => 'bar'
-                       ))
-               );
+                       ]]
+               ];
        }
 
        /**
index cadeb502b4fb965d70003a9c8db178bea9b95983..df7a72a74916c96d24e5868a4566e395b027f932 100644 (file)
@@ -61,8 +61,8 @@ class FileCacheTest extends TestCache {
                //set up temporary storage
                $this->storage = \OC\Files\Filesystem::getStorage('/');
                \OC\Files\Filesystem::clearMounts();
-               $storage = new \OC\Files\Storage\Temporary(array());
-               \OC\Files\Filesystem::mount($storage,array(),'/');
+               $storage = new \OC\Files\Storage\Temporary([]);
+               \OC\Files\Filesystem::mount($storage,[],'/');
                $datadir = str_replace('local::', '', $storage->getId());
                $config = \OC::$server->getConfig();
                $this->datadir = $config->getSystemValue('cachedirectory', \OC::$SERVERROOT.'/data/cache');
@@ -106,7 +106,7 @@ class FileCacheTest extends TestCache {
 
                // Restore the original mount point
                \OC\Files\Filesystem::clearMounts();
-               \OC\Files\Filesystem::mount($this->storage, array(), '/');
+               \OC\Files\Filesystem::mount($this->storage, [], '/');
 
                parent::tearDown();
        }
@@ -117,7 +117,7 @@ class FileCacheTest extends TestCache {
                        ->setConstructorArgs([['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]])
                        ->getMock();
 
-               \OC\Files\Filesystem::mount($mockStorage, array(), '/test/cache');
+               \OC\Files\Filesystem::mount($mockStorage, [], '/test/cache');
 
                return $mockStorage;
        }
index 4ac2cc124ee87dc8c53451737e124ccbf58f6ce7..59338b74de9af67aa911cac74c705e63b8f9706d 100644 (file)
@@ -410,20 +410,20 @@ class RemotePluginTest extends TestCase {
        }
 
        public function dataTestSplitUserRemoteError() {
-               return array(
+               return [
                        // Invalid path
-                       array('user@'),
+                       ['user@'],
 
                        // Invalid user
-                       array('@server'),
-                       array('us/er@server'),
-                       array('us:er@server'),
+                       ['@server'],
+                       ['us/er@server'],
+                       ['us:er@server'],
 
                        // Invalid splitting
-                       array('user'),
-                       array(''),
-                       array('us/erserver'),
-                       array('us:erserver'),
-               );
+                       ['user'],
+                       [''],
+                       ['us/erserver'],
+                       ['us:erserver'],
+               ];
        }
 }
index 109f7471e9611c36b73bf2b93248b9dcfc69c1c4..58144b2c26a1b95adf0e3640607a178a4104df34 100644 (file)
@@ -12,7 +12,7 @@ class ConfigTest extends TestCase {
        const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar", "beers" => array("Appenzeller", "Guinness", "Kölsch"), "alcohol_free" => false);';
 
        /** @var array */
-       private $initialConfig = array('foo' => 'bar', 'beers' => array('Appenzeller', 'Guinness', 'Kölsch'), 'alcohol_free' => false);
+       private $initialConfig = ['foo' => 'bar', 'beers' => ['Appenzeller', 'Guinness', 'Kölsch'], 'alcohol_free' => false];
        /** @var string */
        private $configFile;
        /** @var \OC\Config */
@@ -35,7 +35,7 @@ class ConfigTest extends TestCase {
        }
 
        public function testGetKeys() {
-               $expectedConfig = array('foo', 'beers', 'alcohol_free');
+               $expectedConfig = ['foo', 'beers', 'alcohol_free'];
                $this->assertSame($expectedConfig, $this->config->getKeys());
        }
 
@@ -44,8 +44,8 @@ class ConfigTest extends TestCase {
                $this->assertSame(null, $this->config->getValue('bar'));
                $this->assertSame('moo', $this->config->getValue('bar', 'moo'));
                $this->assertSame(false, $this->config->getValue('alcohol_free', 'someBogusValue'));
-               $this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers', 'someBogusValue'));
-               $this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers'));
+               $this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $this->config->getValue('beers', 'someBogusValue'));
+               $this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $this->config->getValue('beers'));
        }
 
        public function testGetValueReturnsEnvironmentValueIfSet() {
@@ -81,9 +81,9 @@ class ConfigTest extends TestCase {
                $this->assertEquals($expected, $content);
 
                $this->config->setValue('bar', 'red');
-               $this->config->setValue('apps', array('files', 'gallery'));
+               $this->config->setValue('apps', ['files', 'gallery']);
                $expectedConfig['bar'] = 'red';
-               $expectedConfig['apps'] = array('files', 'gallery');
+               $expectedConfig['apps'] = ['files', 'gallery'];
                $this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
 
                $content = file_get_contents($this->configFile);
@@ -150,7 +150,7 @@ class ConfigTest extends TestCase {
                $this->assertEquals(self::TESTCONTENT, file_get_contents($this->configFile));
 
                // Write a new value to the config
-               $this->config->setValue('CoolWebsites', array('demo.owncloud.org', 'owncloud.org', 'owncloud.com'));
+               $this->config->setValue('CoolWebsites', ['demo.owncloud.org', 'owncloud.org', 'owncloud.com']);
                $expected = "<?php\n\$CONFIG = array (\n  'foo' => 'bar',\n  'beers' => \n  array (\n    0 => 'Appenzeller',\n  " .
                        "  1 => 'Guinness',\n    2 => 'Kölsch',\n  ),\n  'alcohol_free' => false,\n  'php53' => 'totallyOutdated',\n  'CoolWebsites' => \n  array (\n  " .
                        "  0 => 'demo.owncloud.org',\n    1 => 'owncloud.org',\n    2 => 'owncloud.com',\n  ),\n);\n";
index f39d849bb95518bf39501f6876663778cc8b0f0d..5437ca3fbaf9891aa41b568426e33467452b0dfd 100644 (file)
@@ -15,48 +15,48 @@ class ContactsManagerTest extends \Test\TestCase {
        }
 
        public function searchProvider(){
-               $search1 = array(
-                       0 => array(
-                               'N' => array(0 => '', 1 => 'Jan', 2 => 'Jansen', 3 => '', 4 => '',),
+               $search1 = [
+                       0 => [
+                               'N' => [0 => '', 1 => 'Jan', 2 => 'Jansen', 3 => '', 4 => '',],
                                'UID' => '04ada7f5-01f9-4309-9c82-6b555b2170ed',
                                'FN' => 'Jan Jansen',
                                'id' => '1',
                                'addressbook-key' => 'simple:1',
-                       ),
-                       0 => array(
-                               'N' => array(0 => '', 1 => 'Tom', 2 => 'Peeters', 3 => '', 4 => '',),
+                       ],
+                       0 => [
+                               'N' => [0 => '', 1 => 'Tom', 2 => 'Peeters', 3 => '', 4 => '',],
                                'UID' => '04ada7f5-01f9-4309-9c82-2345-2345--6b555b2170ed',
                                'FN' => 'Tom Peeters',
                                'id' => '2',
                                'addressbook-key' => 'simple:1',
-                       ),
-               );
+                       ],
+               ];
 
-               $search2 = array(
-                       0 => array(
-                               'N' => array(0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',),
+               $search2 = [
+                       0 => [
+                               'N' => [0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',],
                                'UID' => '04ada234h5jh357f5-01f9-4309-9c82-6b555b2170ed',
                                'FN' => 'Jan Rompuy',
                                'id' => '1',
                                'addressbook-key' => 'simple:2',
-                       ),
-                       0 => array(
-                               'N' => array(0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',),
+                       ],
+                       0 => [
+                               'N' => [0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',],
                                'UID' => '04ada7f5-01f9-4309-345kj345j9c82-2345-2345--6b555b2170ed',
                                'FN' => 'Tim Peeters',
                                'id' => '2',
                                'addressbook-key' => 'simple:2',
-                       ),
-               );
+                       ],
+               ];
 
                $expectedResult =  array_merge($search1, $search2);
-               return array(
-                       array(
+               return [
+                       [
                                $search1,
                                $search2,
                                $expectedResult
-                       )
-               );
+                       ]
+               ];
        }
 
        /**
@@ -164,7 +164,7 @@ class ContactsManagerTest extends \Test\TestCase {
                        ->willReturn('returnMe');
 
                $this->cm->registerAddressBook($addressbook);
-               $result = $this->cm->createOrUpdate(array(), $addressbook->getKey());
+               $result = $this->cm->createOrUpdate([], $addressbook->getKey());
                $this->assertEquals($result, 'returnMe');
        }
 
@@ -182,7 +182,7 @@ class ContactsManagerTest extends \Test\TestCase {
                        ->method('createOrUpdate');
 
                $this->cm->registerAddressBook($addressbook);
-               $result = $this->cm->createOrUpdate(array(), $addressbook->getKey());
+               $result = $this->cm->createOrUpdate([], $addressbook->getKey());
                $this->assertEquals($result, null);
 
        }
@@ -197,7 +197,7 @@ class ContactsManagerTest extends \Test\TestCase {
                        ->method('createOrUpdate');
 
                $this->cm->registerAddressBook($addressbook);
-               $result = $this->cm->createOrUpdate(array(), 'noaddressbook');
+               $result = $this->cm->createOrUpdate([], 'noaddressbook');
                $this->assertEquals($result, null);
        }
 
index ce7ef0a3a6303070aa992e9c04fe3a68918bb392..cd4befdbe52c1f0e6d3a872f630dd3193f955b79 100644 (file)
@@ -85,15 +85,15 @@ class LegacyDBTest extends \Test\TestCase {
 
        public function testQuotes() {
                $query = OC_DB::prepare('SELECT `fullname` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
-               $result = $query->execute(array('uri_1'));
+               $result = $query->execute(['uri_1']);
                $this->assertTrue((bool)$result);
                $row = $result->fetchRow();
                $this->assertFalse($row);
                $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
-               $result = $query->execute(array('fullname test', 'uri_1'));
+               $result = $query->execute(['fullname test', 'uri_1']);
                $this->assertEquals(1, $result);
                $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
-               $result = $query->execute(array('uri_1'));
+               $result = $query->execute(['uri_1']);
                $this->assertTrue((bool)$result);
                $row = $result->fetchRow();
                $this->assertArrayHasKey('fullname', $row);
@@ -107,29 +107,29 @@ class LegacyDBTest extends \Test\TestCase {
         */
        public function testNOW() {
                $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (NOW(),?)');
-               $result = $query->execute(array('uri_2'));
+               $result = $query->execute(['uri_2']);
                $this->assertEquals(1, $result);
                $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
-               $result = $query->execute(array('uri_2'));
+               $result = $query->execute(['uri_2']);
                $this->assertTrue((bool)$result);
        }
 
        public function testUNIX_TIMESTAMP() {
                $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (UNIX_TIMESTAMP(),?)');
-               $result = $query->execute(array('uri_3'));
+               $result = $query->execute(['uri_3']);
                $this->assertEquals(1, $result);
                $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
-               $result = $query->execute(array('uri_3'));
+               $result = $query->execute(['uri_3']);
                $this->assertTrue((bool)$result);
        }
 
        public function testLastInsertId() {
                $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
-               $result1 = OC_DB::executeAudited($query, array('insertid 1','uri_1'));
+               $result1 = OC_DB::executeAudited($query, ['insertid 1','uri_1']);
                $id1 = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*'.$this->table2);
 
                // we don't know the id we should expect, so insert another row
-               $result2 = OC_DB::executeAudited($query, array('insertid 2','uri_2'));
+               $result2 = OC_DB::executeAudited($query, ['insertid 2','uri_2']);
                $id2 = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*'.$this->table2);
                // now we can check if the two ids are in correct order
                $this->assertGreaterThan($id1, $id2);
@@ -140,7 +140,7 @@ class LegacyDBTest extends \Test\TestCase {
                $expected = "Ћö雙喜\xE2\x80\xA2";
 
                $query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
-               $result = $query->execute(array($expected, 'uri_1', 'This is a vCard'));
+               $result = $query->execute([$expected, 'uri_1', 'This is a vCard']);
                $this->assertEquals(1, $result);
 
                $actual = OC_DB::prepare("SELECT `fullname` FROM `$table`")->execute()->fetchOne();
@@ -156,7 +156,7 @@ class LegacyDBTest extends \Test\TestCase {
                $rowname = 'decimaltest';
 
                $query = OC_DB::prepare('INSERT INTO `' . $table . '` (`' . $rowname . '`) VALUES (?)');
-               $result = $query->execute(array($insert));
+               $result = $query->execute([$insert]);
                $this->assertEquals(1, $result);
                $query = OC_DB::prepare('SELECT `' . $rowname . '` FROM `' . $table . '`');
                $result = $query->execute();
@@ -205,35 +205,35 @@ class LegacyDBTest extends \Test\TestCase {
                // updating to. MySQL reports 1 here when the PDO::MYSQL_ATTR_FOUND_ROWS
                // flag is not specified.
                $query = OC_DB::prepare("UPDATE `*PREFIX*{$this->table2}` SET `uri` = ?");
-               $this->assertSame(2, $query->execute(array('uri1')));
+               $this->assertSame(2, $query->execute(['uri1']));
        }
 
        protected function insertCardData($fullname, $uri) {
                $query = OC_DB::prepare("INSERT INTO `*PREFIX*{$this->table2}` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
-               $this->assertSame(1, $query->execute(array($fullname, $uri, $this->getUniqueID())));
+               $this->assertSame(1, $query->execute([$fullname, $uri, $this->getUniqueID()]));
        }
 
        protected function updateCardData($fullname, $uri) {
                $query = OC_DB::prepare("UPDATE `*PREFIX*{$this->table2}` SET `uri` = ? WHERE `fullname` = ?");
-               return $query->execute(array($uri, $fullname));
+               return $query->execute([$uri, $fullname]);
        }
 
        public function testILIKE() {
                $table = "*PREFIX*{$this->table2}";
 
                $query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
-               $query->execute(array('fooBAR', 'foo', 'bar'));
+               $query->execute(['fooBAR', 'foo', 'bar']);
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
-               $result = $query->execute(array('foobar'));
+               $result = $query->execute(['foobar']);
                $this->assertCount(0, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
-               $result = $query->execute(array('foobar'));
+               $result = $query->execute(['foobar']);
                $this->assertCount(1, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
-               $result = $query->execute(array('foo'));
+               $result = $query->execute(['foo']);
                $this->assertCount(0, $result->fetchAll());
        }
 
@@ -241,30 +241,30 @@ class LegacyDBTest extends \Test\TestCase {
                $table = "*PREFIX*{$this->table2}";
 
                $query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
-               $query->execute(array('FooBAR', 'foo', 'bar'));
+               $query->execute(['FooBAR', 'foo', 'bar']);
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
-               $result = $query->execute(array('%bar'));
+               $result = $query->execute(['%bar']);
                $this->assertCount(0, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
-               $result = $query->execute(array('foo%'));
+               $result = $query->execute(['foo%']);
                $this->assertCount(0, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
-               $result = $query->execute(array('%ba%'));
+               $result = $query->execute(['%ba%']);
                $this->assertCount(0, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
-               $result = $query->execute(array('%bar'));
+               $result = $query->execute(['%bar']);
                $this->assertCount(1, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
-               $result = $query->execute(array('foo%'));
+               $result = $query->execute(['foo%']);
                $this->assertCount(1, $result->fetchAll());
 
                $query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
-               $result = $query->execute(array('%ba%'));
+               $result = $query->execute(['%ba%']);
                $this->assertCount(1, $result->fetchAll());
        }
 
@@ -279,7 +279,7 @@ class LegacyDBTest extends \Test\TestCase {
                if ($throwsOnMysqlWithoutUTF8MB4 && $config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false) === false) {
                        $this->markTestSkipped('MySQL requires UTF8mb4 to store value: ' . $expected);
                }
-               $result = $query->execute(array($expected));
+               $result = $query->execute([$expected]);
                $this->assertEquals(1, $result);
 
                $actual = OC_DB::prepare("SELECT `textfield` FROM `$table`")->execute()->fetchOne();
index 8c9290c56b451bd45b35e2e5577a00ebe6f8c40d..d83131a685f8dfad1ff1e9f4b36ca0c92e792130 100644 (file)
@@ -40,10 +40,10 @@ class MDB2SchemaManagerTest extends \Test\TestCase {
                $manager = new \OC\DB\MDB2SchemaManager($connection);
 
                $manager->createDbFromStructure(__DIR__ . '/ts-autoincrement-before.xml');
-               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('abc'));
-               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('abc'));
-               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('123'));
-               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('123'));
+               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['abc']);
+               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['abc']);
+               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['123']);
+               $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['123']);
                $manager->updateDbFromStructure(__DIR__ . '/ts-autoincrement-after.xml');
 
                $this->addToAssertionCount(1);
index 5698ad966f19533705e3ebfb16096c50acdb8b32..2f987adb290e5db936ce70003c5aeb81cb5f41c2 100644 (file)
@@ -38,10 +38,10 @@ class MDB2SchemaReaderTest extends TestCase {
                        ->getMock();
                $config->expects($this->any())
                        ->method('getSystemValue')
-                       ->willReturnMap(array(
-                               array('dbname', 'owncloud', 'testDB'),
-                               array('dbtableprefix', 'oc_', 'test_')
-                       ));
+                       ->willReturnMap([
+                               ['dbname', 'owncloud', 'testDB'],
+                               ['dbtableprefix', 'oc_', 'test_']
+                       ]);
                return $config;
        }
 
@@ -85,10 +85,10 @@ class MDB2SchemaReaderTest extends TestCase {
                $this->assertEquals(2, $table->getColumn('decimalfield_precision_scale')->getScale());
 
                $this->assertCount(2, $table->getIndexes());
-               $this->assertEquals(array('integerfield'), $table->getIndex('primary')->getUnquotedColumns());
+               $this->assertEquals(['integerfield'], $table->getIndex('primary')->getUnquotedColumns());
                $this->assertTrue($table->getIndex('primary')->isPrimary());
                $this->assertTrue($table->getIndex('primary')->isUnique());
-               $this->assertEquals(array('booleanfield'), $table->getIndex('index_boolean')->getUnquotedColumns());
+               $this->assertEquals(['booleanfield'], $table->getIndex('index_boolean')->getUnquotedColumns());
                $this->assertFalse($table->getIndex('index_boolean')->isPrimary());
                $this->assertFalse($table->getIndex('index_boolean')->isUnique());
        }
index e5cc28654e4441ddf79a246b1c82c81fa53695e3..a438d0189dfc10b4e65f5f5e73420a0351b94841 100644 (file)
@@ -77,19 +77,19 @@ class MigratorTest extends \Test\TestCase {
         * @return \Doctrine\DBAL\Schema\Schema[]
         */
        private function getDuplicateKeySchemas() {
-               $startSchema = new Schema(array(), array(), $this->getSchemaConfig());
+               $startSchema = new Schema([], [], $this->getSchemaConfig());
                $table = $startSchema->createTable($this->tableName);
                $table->addColumn('id', 'integer');
                $table->addColumn('name', 'string');
-               $table->addIndex(array('id'), $this->tableName . '_id');
+               $table->addIndex(['id'], $this->tableName . '_id');
 
-               $endSchema = new Schema(array(), array(), $this->getSchemaConfig());
+               $endSchema = new Schema([], [], $this->getSchemaConfig());
                $table = $endSchema->createTable($this->tableName);
                $table->addColumn('id', 'integer');
                $table->addColumn('name', 'string');
-               $table->addUniqueIndex(array('id'), $this->tableName . '_id');
+               $table->addUniqueIndex(['id'], $this->tableName . '_id');
 
-               return array($startSchema, $endSchema);
+               return [$startSchema, $endSchema];
        }
 
        private function getSchemaConfig() {
@@ -113,9 +113,9 @@ class MigratorTest extends \Test\TestCase {
                $migrator = $this->manager->getMigrator();
                $migrator->migrate($startSchema);
 
-               $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
-               $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
-               $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'qwerty'));
+               $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+               $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
+               $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'qwerty']);
 
                $migrator->checkMigrate($endSchema);
                $this->fail('checkMigrate should have failed');
@@ -126,9 +126,9 @@ class MigratorTest extends \Test\TestCase {
                $migrator = $this->manager->getMigrator();
                $migrator->migrate($startSchema);
 
-               $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
-               $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
-               $this->connection->insert($this->tableName, array('id' => 3, 'name' => 'qwerty'));
+               $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+               $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
+               $this->connection->insert($this->tableName, ['id' => 3, 'name' => 'qwerty']);
 
                $migrator->checkMigrate($endSchema);
                $migrator->migrate($endSchema);
@@ -145,9 +145,9 @@ class MigratorTest extends \Test\TestCase {
                $migrator = $this->manager->getMigrator();
                $migrator->migrate($startSchema);
 
-               $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
-               $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
-               $this->connection->insert($this->tableName, array('id' => 3, 'name' => 'qwerty'));
+               $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+               $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
+               $this->connection->insert($this->tableName, ['id' => 3, 'name' => 'qwerty']);
 
                $migrator->checkMigrate($endSchema);
                $migrator->migrate($endSchema);
@@ -163,10 +163,10 @@ class MigratorTest extends \Test\TestCase {
 
                $migrator->migrate($endSchema);
 
-               $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
-               $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
+               $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+               $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
                try {
-                       $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'qwerty'));
+                       $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'qwerty']);
                        $this->fail('Expected duplicate key insert to fail');
                } catch (DBALException $e) {
                        $this->addToAssertionCount(1);
@@ -174,16 +174,16 @@ class MigratorTest extends \Test\TestCase {
        }
 
        public function testAddingPrimaryKeyWithAutoIncrement() {
-               $startSchema = new Schema(array(), array(), $this->getSchemaConfig());
+               $startSchema = new Schema([], [], $this->getSchemaConfig());
                $table = $startSchema->createTable($this->tableName);
                $table->addColumn('id', 'integer');
                $table->addColumn('name', 'string');
 
-               $endSchema = new Schema(array(), array(), $this->getSchemaConfig());
+               $endSchema = new Schema([], [], $this->getSchemaConfig());
                $table = $endSchema->createTable($this->tableName);
-               $table->addColumn('id', 'integer', array('autoincrement' => true));
+               $table->addColumn('id', 'integer', ['autoincrement' => true]);
                $table->addColumn('name', 'string');
-               $table->setPrimaryKey(array('id'));
+               $table->setPrimaryKey(['id']);
 
                $migrator = $this->manager->getMigrator();
                $migrator->migrate($startSchema);
@@ -195,17 +195,17 @@ class MigratorTest extends \Test\TestCase {
        }
 
        public function testReservedKeywords() {
-               $startSchema = new Schema(array(), array(), $this->getSchemaConfig());
+               $startSchema = new Schema([], [], $this->getSchemaConfig());
                $table = $startSchema->createTable($this->tableName);
-               $table->addColumn('id', 'integer', array('autoincrement' => true));
-               $table->addColumn('user', 'string', array('length' => 255));
-               $table->setPrimaryKey(array('id'));
+               $table->addColumn('id', 'integer', ['autoincrement' => true]);
+               $table->addColumn('user', 'string', ['length' => 255]);
+               $table->setPrimaryKey(['id']);
 
-               $endSchema = new Schema(array(), array(), $this->getSchemaConfig());
+               $endSchema = new Schema([], [], $this->getSchemaConfig());
                $table = $endSchema->createTable($this->tableName);
-               $table->addColumn('id', 'integer', array('autoincrement' => true));
-               $table->addColumn('user', 'string', array('length' => 64));
-               $table->setPrimaryKey(array('id'));
+               $table->addColumn('id', 'integer', ['autoincrement' => true]);
+               $table->addColumn('user', 'string', ['length' => 64]);
+               $table->setPrimaryKey(['id']);
 
                $migrator = $this->manager->getMigrator();
                $migrator->migrate($startSchema);
@@ -227,7 +227,7 @@ class MigratorTest extends \Test\TestCase {
                $tableFk = $startSchema->createTable($this->tableNameTmp);
                $tableFk->addColumn('fk_id', 'integer');
                $tableFk->addColumn('name', 'string');
-               $tableFk->addForeignKeyConstraint($this->tableName, array('fk_id'), array('id'), array(), $fkName);
+               $tableFk->addForeignKeyConstraint($this->tableName, ['fk_id'], ['id'], [], $fkName);
 
                $migrator = $this->manager->getMigrator();
                $migrator->migrate($startSchema);
index 6cd8b572fcdbe3857c8377002f488c39a2748ae7..1470f3b6bf4cf5c5d7a7390464db96d6c7a28b5e 100644 (file)
@@ -44,35 +44,35 @@ class DateTimeFormatterTest extends TestCase {
        public function formatTimeSpanData() {
                $time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo
                $deL10N = \OC::$server->getL10N('lib', 'de');
-               return array(
-                       array('seconds ago',    $time, $time),
-                       array('in a few seconds', $time + 5 , $time),
-                       array('1 minute ago',   $this->getTimestampAgo($time, 30, 1), $time),
-                       array('15 minutes ago', $this->getTimestampAgo($time, 30, 15), $time),
-                       array('in 15 minutes',  $time, $this->getTimestampAgo($time, 30, 15)),
-                       array('1 hour ago',             $this->getTimestampAgo($time, 30, 15, 1), $time),
-                       array('3 hours ago',    $this->getTimestampAgo($time, 30, 15, 3), $time),
-                       array('in 3 hours',             $time, $this->getTimestampAgo($time, 30, 15, 3)),
-                       array('4 days ago',             $this->getTimestampAgo($time, 30, 15, 3, 4), $time),
-
-                       array('seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('1 minute ago', new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('3 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('59 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('1 hour ago', new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('3 hours ago', new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('yesterday', new \DateTime('Tue, 01 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('2 days ago', new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-
-                       array($deL10N->t('seconds ago'), new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-                       array($deL10N->n('%n minute ago', '%n minutes ago', 1), new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-                       array($deL10N->n('%n minute ago', '%n minutes ago', 3), new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-                       array($deL10N->n('%n hour ago', '%n hours ago', 1), new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-                       array($deL10N->n('%n hour ago', '%n hours ago', 3), new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-                       array($deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-
-               );
+               return [
+                       ['seconds ago', $time, $time],
+                       ['in a few seconds', $time + 5 , $time],
+                       ['1 minute ago',        $this->getTimestampAgo($time, 30, 1), $time],
+                       ['15 minutes ago',      $this->getTimestampAgo($time, 30, 15), $time],
+                       ['in 15 minutes',       $time, $this->getTimestampAgo($time, 30, 15)],
+                       ['1 hour ago',          $this->getTimestampAgo($time, 30, 15, 1), $time],
+                       ['3 hours ago', $this->getTimestampAgo($time, 30, 15, 3), $time],
+                       ['in 3 hours',          $time, $this->getTimestampAgo($time, 30, 15, 3)],
+                       ['4 days ago',          $this->getTimestampAgo($time, 30, 15, 3, 4), $time],
+
+                       ['seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['1 minute ago', new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['3 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['59 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['1 hour ago', new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['3 hours ago', new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['yesterday', new \DateTime('Tue, 01 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['2 days ago', new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+
+                       [$deL10N->t('seconds ago'), new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+                       [$deL10N->n('%n minute ago', '%n minutes ago', 1), new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+                       [$deL10N->n('%n minute ago', '%n minutes ago', 3), new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+                       [$deL10N->n('%n hour ago', '%n hours ago', 1), new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+                       [$deL10N->n('%n hour ago', '%n hours ago', 3), new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+                       [$deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+
+               ];
        }
 
        /**
@@ -85,60 +85,60 @@ class DateTimeFormatterTest extends TestCase {
        public function formatDateSpanData() {
                $time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo
                $deL10N = \OC::$server->getL10N('lib', 'de');
-               return array(
+               return [
                        // Normal testing
-                       array('today',                  $this->getTimestampAgo($time, 30, 15), $time),
-                       array('yesterday',              $this->getTimestampAgo($time, 0, 0, 0, 1), $time),
-                       array('tomorrow',               $time, $this->getTimestampAgo($time, 0, 0, 0, 1)),
-                       array('4 days ago',             $this->getTimestampAgo($time, 0, 0, 0, 4), $time),
-                       array('in 4 days',              $time, $this->getTimestampAgo($time, 0, 0, 0, 4)),
-                       array('5 months ago',   $this->getTimestampAgo($time, 0, 0, 0, 155), $time),
-                       array('next month',             $time, $this->getTimestampAgo($time, 0, 0, 0, 32)),
-                       array('in 5 months',    $time, $this->getTimestampAgo($time, 0, 0, 0, 155)),
-                       array('2 years ago',    $this->getTimestampAgo($time, 0, 0, 0, 0, 2), $time),
-                       array('next year',              $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
-                       array('in 2 years',             $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 2)),
+                       ['today',                       $this->getTimestampAgo($time, 30, 15), $time],
+                       ['yesterday',           $this->getTimestampAgo($time, 0, 0, 0, 1), $time],
+                       ['tomorrow',            $time, $this->getTimestampAgo($time, 0, 0, 0, 1)],
+                       ['4 days ago',          $this->getTimestampAgo($time, 0, 0, 0, 4), $time],
+                       ['in 4 days',           $time, $this->getTimestampAgo($time, 0, 0, 0, 4)],
+                       ['5 months ago',        $this->getTimestampAgo($time, 0, 0, 0, 155), $time],
+                       ['next month',          $time, $this->getTimestampAgo($time, 0, 0, 0, 32)],
+                       ['in 5 months', $time, $this->getTimestampAgo($time, 0, 0, 0, 155)],
+                       ['2 years ago', $this->getTimestampAgo($time, 0, 0, 0, 0, 2), $time],
+                       ['next year',           $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+                       ['in 2 years',          $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 2)],
 
                        // Test with compare timestamp
-                       array('today',                  $this->getTimestampAgo($time,  0,  0, 0, 0, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
-                       array('yesterday',              $this->getTimestampAgo($time, 30, 15, 3, 1, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
-                       array('4 days ago',             $this->getTimestampAgo($time, 30, 15, 3, 4, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
-                       array('5 months ago',   $this->getTimestampAgo($time, 30, 15, 3, 155, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
-                       array('2 years ago',    $this->getTimestampAgo($time, 30, 15, 3, 35, 3), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
+                       ['today',                       $this->getTimestampAgo($time,  0,  0, 0, 0, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+                       ['yesterday',           $this->getTimestampAgo($time, 30, 15, 3, 1, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+                       ['4 days ago',          $this->getTimestampAgo($time, 30, 15, 3, 4, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+                       ['5 months ago',        $this->getTimestampAgo($time, 30, 15, 3, 155, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+                       ['2 years ago', $this->getTimestampAgo($time, 30, 15, 3, 35, 3), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
 
                        // Test translations
-                       array($deL10N->t('today'),                      new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-                       array($deL10N->t('yesterday'),          new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N),
-                       array($deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N),
-                       array($deL10N->n('%n month ago', '%n months ago', 9), new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N),
-                       array($deL10N->n('%n year ago', '%n years ago', 2), new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N),
+                       [$deL10N->t('today'),                   new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+                       [$deL10N->t('yesterday'),               new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N],
+                       [$deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N],
+                       [$deL10N->n('%n month ago', '%n months ago', 9), new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N],
+                       [$deL10N->n('%n year ago', '%n years ago', 2), new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N],
 
                        // Test time
-                       array('today', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('today', new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('today', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
+                       ['today', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['today', new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['today', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
 
                        // Test some special yesterdays
-                       array('yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')),
-                       array('yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')),
-                       array('yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-                       array('yesterday', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')),
-                       array('yesterday', new \DateTime('Mon, 31 Dec 2012 00:00:00 +0000'), new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000')),
+                       ['yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')],
+                       ['yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')],
+                       ['yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+                       ['yesterday', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')],
+                       ['yesterday', new \DateTime('Mon, 31 Dec 2012 00:00:00 +0000'), new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000')],
 
                        // Test last month
-                       array('2 days ago', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')),
-                       array('last month', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 31 Oct 2013 00:00:00 +0000')),
-                       array('last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')),
-                       array('last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Thu, 31 Oct 2013 00:00:00 +0000')),
+                       ['2 days ago', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')],
+                       ['last month', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 31 Oct 2013 00:00:00 +0000')],
+                       ['last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')],
+                       ['last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Thu, 31 Oct 2013 00:00:00 +0000')],
 
                        // Test last year
-                       array('9 months ago', new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
-                       array('11 months ago', new \DateTime('Thu, 03 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
-                       array('last year', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
-                       array('last year', new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
-                       array('2 years ago', new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
-               );
+                       ['9 months ago', new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+                       ['11 months ago', new \DateTime('Thu, 03 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+                       ['last year', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+                       ['last year', new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+                       ['2 years ago', new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+               ];
        }
 
        /**
@@ -149,9 +149,9 @@ class DateTimeFormatterTest extends TestCase {
        }
 
        public function formatDateData() {
-               return array(
-                       array(1102831200, 'December 12, 2004'),
-               );
+               return [
+                       [1102831200, 'December 12, 2004'],
+               ];
        }
 
        /**
@@ -162,10 +162,10 @@ class DateTimeFormatterTest extends TestCase {
        }
 
        public function formatDateTimeData() {
-               return array(
-                       array(1350129205, null, 'October 13, 2012 at 11:53:25 AM GMT+0'),
-                       array(1350129205, new \DateTimeZone('Europe/Berlin'), 'October 13, 2012 at 1:53:25 PM GMT+2'),
-               );
+               return [
+                       [1350129205, null, 'October 13, 2012 at 11:53:25 AM GMT+0'],
+                       [1350129205, new \DateTimeZone('Europe/Berlin'), 'October 13, 2012 at 1:53:25 PM GMT+2'],
+               ];
        }
 
        /**
index b333729ef87a332524c7f9b571ae34d40bf52c83..7e21fe881fcf9da84f411a96cb28bdf8c53de5e4 100644 (file)
@@ -63,7 +63,7 @@ class StorageTest extends TestCase {
        public function testSetFileKey() {
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturn(array('user1', '/files/foo.txt'));
+                       ->willReturn(['user1', '/files/foo.txt']);
                $this->util->expects($this->any())
                        ->method('stripPartialFileExtension')
                        ->willReturnArgument(0);
@@ -143,7 +143,7 @@ class StorageTest extends TestCase {
        public function testSetFileKeySystemWide() {
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturn(array('user1', '/files/foo.txt'));
+                       ->willReturn(['user1', '/files/foo.txt']);
                $this->util->expects($this->any())
                        ->method('isSystemWideMountPoint')
                        ->willReturn(true);
@@ -164,7 +164,7 @@ class StorageTest extends TestCase {
        public function testGetFileKeySystemWide() {
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturn(array('user1', '/files/foo.txt'));
+                       ->willReturn(['user1', '/files/foo.txt']);
                $this->util->expects($this->any())
                        ->method('stripPartialFileExtension')
                        ->willReturnArgument(0);
@@ -272,7 +272,7 @@ class StorageTest extends TestCase {
        public function testDeleteFileKeySystemWide() {
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturn(array('user1', '/files/foo.txt'));
+                       ->willReturn(['user1', '/files/foo.txt']);
                $this->util->expects($this->any())
                        ->method('stripPartialFileExtension')
                        ->willReturnArgument(0);
@@ -296,7 +296,7 @@ class StorageTest extends TestCase {
        public function testDeleteFileKey() {
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturn(array('user1', '/files/foo.txt'));
+                       ->willReturn(['user1', '/files/foo.txt']);
                $this->util->expects($this->any())
                        ->method('stripPartialFileExtension')
                        ->willReturnArgument(0);
@@ -335,7 +335,7 @@ class StorageTest extends TestCase {
                        ->willReturn(true);
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturnCallback(array($this, 'getUidAndFilenameCallback'));
+                       ->willReturnCallback([$this, 'getUidAndFilenameCallback']);
                $this->util->expects($this->any())
                        ->method('isSystemWideMountPoint')
                        ->willReturnCallback(function($path, $owner) use ($systemWideMountSource, $systemWideMountTarget) {
@@ -366,7 +366,7 @@ class StorageTest extends TestCase {
                        ->willReturn(true);
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturnCallback(array($this, 'getUidAndFilenameCallback'));
+                       ->willReturnCallback([$this, 'getUidAndFilenameCallback']);
                $this->util->expects($this->any())
                        ->method('isSystemWideMountPoint')
                        ->willReturnCallback(function($path, $owner) use ($systemWideMountSource, $systemWideMountTarget) {
@@ -385,37 +385,37 @@ class StorageTest extends TestCase {
                $path = $args[0];
                $parts = explode('/', $path);
 
-               return array($parts[1], '/' . implode('/', array_slice($parts, 2)));
+               return [$parts[1], '/' . implode('/', array_slice($parts, 2))];
        }
 
        public function dataProviderCopyRename() {
-               return array(
-                       array('/user1/files/source.txt', '/user1/files/target.txt', false, false,
-                               '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-                       array('/user1/files/foo/source.txt', '/user1/files/target.txt', false, false,
-                               '/user1/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-                       array('/user1/files/source.txt', '/user1/files/foo/target.txt', false, false,
-                               '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'),
-                       array('/user1/files/source.txt', '/user1/files/foo/target.txt', true, true,
-                               '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'),
-                       array('/user1/files/source.txt', '/user1/files/target.txt', false, true,
-                               '/user1/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'),
-                       array('/user1/files/source.txt', '/user1/files/target.txt', true, false,
-                               '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-
-                       array('/user2/files/source.txt', '/user1/files/target.txt', false, false,
-                               '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-                       array('/user2/files/foo/source.txt', '/user1/files/target.txt', false, false,
-                               '/user2/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-                       array('/user2/files/source.txt', '/user1/files/foo/target.txt', false, false,
-                               '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'),
-                       array('/user2/files/source.txt', '/user1/files/foo/target.txt', true, true,
-                               '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'),
-                       array('/user2/files/source.txt', '/user1/files/target.txt', false, true,
-                               '/user2/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'),
-                       array('/user2/files/source.txt', '/user1/files/target.txt', true, false,
-                               '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-               );
+               return [
+                       ['/user1/files/source.txt', '/user1/files/target.txt', false, false,
+                               '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+                       ['/user1/files/foo/source.txt', '/user1/files/target.txt', false, false,
+                               '/user1/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+                       ['/user1/files/source.txt', '/user1/files/foo/target.txt', false, false,
+                               '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'],
+                       ['/user1/files/source.txt', '/user1/files/foo/target.txt', true, true,
+                               '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'],
+                       ['/user1/files/source.txt', '/user1/files/target.txt', false, true,
+                               '/user1/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'],
+                       ['/user1/files/source.txt', '/user1/files/target.txt', true, false,
+                               '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+
+                       ['/user2/files/source.txt', '/user1/files/target.txt', false, false,
+                               '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+                       ['/user2/files/foo/source.txt', '/user1/files/target.txt', false, false,
+                               '/user2/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+                       ['/user2/files/source.txt', '/user1/files/foo/target.txt', false, false,
+                               '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'],
+                       ['/user2/files/source.txt', '/user1/files/foo/target.txt', true, true,
+                               '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'],
+                       ['/user2/files/source.txt', '/user1/files/target.txt', false, true,
+                               '/user2/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'],
+                       ['/user2/files/source.txt', '/user1/files/target.txt', true, false,
+                               '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+               ];
        }
 
        /**
@@ -432,7 +432,7 @@ class StorageTest extends TestCase {
 
                $this->util->expects($this->any())
                        ->method('getUidAndFilename')
-                       ->willReturnCallback(array($this, 'getUidAndFilenameCallback'));
+                       ->willReturnCallback([$this, 'getUidAndFilenameCallback']);
                $this->util->expects($this->any())
                        ->method('isSystemWideMountPoint')
                        ->willReturn($systemWideMountPoint);
@@ -460,15 +460,15 @@ class StorageTest extends TestCase {
                        ->willReturn(false);
                $this->view->expects($this->any())
                        ->method('mkdir')
-                       ->willReturnCallback(array($this, 'mkdirCallback'));
+                       ->willReturnCallback([$this, 'mkdirCallback']);
 
-               $this->mkdirStack = array(
+               $this->mkdirStack = [
                        '/user1/files_encryption/keys/foo',
                        '/user1/files_encryption/keys',
                        '/user1/files_encryption',
-                       '/user1');
+                       '/user1'];
 
-               self::invokePrivate($this->storage, 'keySetPreparation', array('/user1/files_encryption/keys/foo'));
+               self::invokePrivate($this->storage, 'keySetPreparation', ['/user1/files_encryption/keys/foo']);
        }
 
        public function mkdirCallback() {
index 28d7ca8116359a35494d3d1e5b2363889dd58164..6328df3dc30aade59d2012072a9d42c30cd1889b 100644 (file)
@@ -121,10 +121,10 @@ class UpdateTest extends TestCase {
         * @return array
         */
        public function dataTestUpdate() {
-               return array(
-                       array('/user/files/foo', true, ['/user/files/foo/file1.txt', '/user/files/foo/file1.txt'], 2),
-                       array('/user/files/test.txt', false, [], 1),
-               );
+               return [
+                       ['/user/files/foo', true, ['/user/files/foo/file1.txt', '/user/files/foo/file1.txt'], 2],
+                       ['/user/files/test.txt', false, [], 1],
+               ];
        }
 
        /**
@@ -168,14 +168,14 @@ class UpdateTest extends TestCase {
         * @return array
         */
        public function dataTestPostRename() {
-               return array(
-                       array('/test.txt', '/testNew.txt', true),
-                       array('/test.txt', '/testNew.txt', false),
-                       array('/folder/test.txt', '/testNew.txt', true),
-                       array('/folder/test.txt', '/testNew.txt', false),
-                       array('/folder/test.txt', '/testNew.txt', true),
-                       array('/test.txt', '/folder/testNew.txt', false),
-               );
+               return [
+                       ['/test.txt', '/testNew.txt', true],
+                       ['/test.txt', '/testNew.txt', false],
+                       ['/folder/test.txt', '/testNew.txt', true],
+                       ['/folder/test.txt', '/testNew.txt', false],
+                       ['/folder/test.txt', '/testNew.txt', true],
+                       ['/test.txt', '/folder/testNew.txt', false],
+               ];
        }
 
 
@@ -208,10 +208,10 @@ class UpdateTest extends TestCase {
         * @return array
         */
        public function dataTestPostRestore() {
-               return array(
-                       array(true),
-                       array(false),
-               );
+               return [
+                       [true],
+                       [false],
+               ];
        }
 
        /**
index 2c5bd1a80f35b70ed5327237af28b282b8693cf2..0ac474faa0f83a637b8b8d21b7480d0af1ef831d 100644 (file)
@@ -101,7 +101,7 @@ class UtilTest extends TestCase {
                $this->expectException(\OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException::class);
 
 
-               $header = array('header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo');
+               $header = ['header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo'];
 
                $em = $this->createMock(IEncryptionModule::class);
                $em->expects($this->any())->method('getId')->willReturn('moduleId');
@@ -120,7 +120,7 @@ class UtilTest extends TestCase {
                $this->userManager
                        ->expects($this->any())
                        ->method('userExists')
-                       ->willReturnCallback(array($this, 'isExcludedCallback'));
+                       ->willReturnCallback([$this, 'isExcludedCallback']);
 
                $this->assertSame($expected,
                        $this->util->isExcluded($path)
@@ -128,17 +128,17 @@ class UtilTest extends TestCase {
        }
 
        public function providePathsForTestIsExcluded() {
-               return array(
-                       array('/files_encryption', '', true),
-                       array('files_encryption/foo.txt', '', true),
-                       array('test/foo.txt', '', false),
-                       array('/user1/files_encryption/foo.txt', '', true),
-                       array('/user1/files/foo.txt', '', false),
-                       array('/keyStorage/user1/files/foo.txt', 'keyStorage', true),
-                       array('/keyStorage/files_encryption', '/keyStorage', true),
-                       array('keyStorage/user1/files_encryption', '/keyStorage/', true),
+               return [
+                       ['/files_encryption', '', true],
+                       ['files_encryption/foo.txt', '', true],
+                       ['test/foo.txt', '', false],
+                       ['/user1/files_encryption/foo.txt', '', true],
+                       ['/user1/files/foo.txt', '', false],
+                       ['/keyStorage/user1/files/foo.txt', 'keyStorage', true],
+                       ['/keyStorage/files_encryption', '/keyStorage', true],
+                       ['keyStorage/user1/files_encryption', '/keyStorage/', true],
 
-               );
+               ];
        }
 
        public function isExcludedCallback() {
@@ -160,15 +160,15 @@ class UtilTest extends TestCase {
        }
 
        public function dataTestIsFile() {
-               return array(
-                       array('/user/files/test.txt', true),
-                       array('/user/files', true),
-                       array('/user/files_versions/test.txt', false),
-                       array('/user/foo/files/test.txt', false),
-                       array('/files/foo/files/test.txt', false),
-                       array('/user', false),
-                       array('/user/test.txt', false),
-               );
+               return [
+                       ['/user/files/test.txt', true],
+                       ['/user/files', true],
+                       ['/user/files_versions/test.txt', false],
+                       ['/user/foo/files/test.txt', false],
+                       ['/files/foo/files/test.txt', false],
+                       ['/user', false],
+                       ['/user/test.txt', false],
+               ];
        }
 
        /**
@@ -183,12 +183,12 @@ class UtilTest extends TestCase {
        }
 
        public function dataTestStripPartialFileExtension() {
-               return array(
-                       array('/foo/test.txt', '/foo/test.txt'),
-                       array('/foo/test.txt.part', '/foo/test.txt'),
-                       array('/foo/test.txt.ocTransferId7567846853.part', '/foo/test.txt'),
-                       array('/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'),
-               );
+               return [
+                       ['/foo/test.txt', '/foo/test.txt'],
+                       ['/foo/test.txt.part', '/foo/test.txt'],
+                       ['/foo/test.txt.ocTransferId7567846853.part', '/foo/test.txt'],
+                       ['/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'],
+               ];
        }
 
 }
index aece7f146f600aab3a2d3a11ceb39166e22e27b1..179b5c12123583ef39747f15307f98041ef5452d 100644 (file)
@@ -29,13 +29,13 @@ class ErrorHandlerTest extends \Test\TestCase {
         * @return array
         */
        function passwordProvider() {
-               return array(
-                       array('user', 'password'),
-                       array('user@owncloud.org', 'password'),
-                       array('user', 'pass@word'),
-                       array('us:er', 'password'),
-                       array('user', 'pass:word'),
-                       );
+               return [
+                       ['user', 'password'],
+                       ['user@owncloud.org', 'password'],
+                       ['user', 'pass@word'],
+                       ['us:er', 'password'],
+                       ['user', 'pass:word'],
+                       ];
 
        }
 
index 247ed9ef9ec652df5adb43451e254aaef7074f60..40d87214aadaf257beefd79cbc0b4dfdb35d014f 100644 (file)
@@ -55,8 +55,8 @@ class CacheTest extends \Test\TestCase {
        public function testSimple() {
                $file1 = 'foo';
                $file2 = 'foo/bar';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
-               $data2 = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+               $data2 = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
 
                $this->assertFalse($this->cache->inCache($file1));
                $this->assertEquals($this->cache->get($file1), null);
@@ -84,7 +84,7 @@ class CacheTest extends \Test\TestCase {
                $this->assertEquals($id1, $this->cache->getParentId($file2));
 
                $newSize = 1050;
-               $newId2 = $this->cache->put($file2, array('size' => $newSize));
+               $newId2 = $this->cache->put($file2, ['size' => $newSize]);
                $cacheData2 = $this->cache->get($file2);
                $this->assertEquals($newId2, $id2);
                $this->assertEquals($cacheData2['size'], $newSize);
@@ -101,14 +101,14 @@ class CacheTest extends \Test\TestCase {
        public function testPartial() {
                $file1 = 'foo';
 
-               $this->cache->put($file1, array('size' => 10));
-               $this->assertEquals(array('size' => 10), $this->cache->get($file1));
+               $this->cache->put($file1, ['size' => 10]);
+               $this->assertEquals(['size' => 10], $this->cache->get($file1));
 
-               $this->cache->put($file1, array('mtime' => 15));
-               $this->assertEquals(array('size' => 10, 'mtime' => 15), $this->cache->get($file1));
+               $this->cache->put($file1, ['mtime' => 15]);
+               $this->assertEquals(['size' => 10, 'mtime' => 15], $this->cache->get($file1));
 
-               $this->cache->put($file1, array('size' => 12));
-               $this->assertEquals(array('size' => 12, 'mtime' => 15), $this->cache->get($file1));
+               $this->cache->put($file1, ['size' => 12]);
+               $this->assertEquals(['size' => 12, 'mtime' => 15], $this->cache->get($file1));
        }
 
        /**
@@ -124,10 +124,10 @@ class CacheTest extends \Test\TestCase {
                }
                $file2 = $folder . '/bar';
                $file3 = $folder . '/foo';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
-               $fileData = array();
-               $fileData['bar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
-               $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
+               $fileData = [];
+               $fileData['bar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+               $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
 
                $this->cache->put($folder, $data1);
                $this->cache->put($file2, $fileData['bar']);
@@ -143,12 +143,12 @@ class CacheTest extends \Test\TestCase {
                }
 
                $file4 = $folder . '/unkownSize';
-               $fileData['unkownSize'] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $fileData['unkownSize'] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file'];
                $this->cache->put($file4, $fileData['unkownSize']);
 
                $this->assertEquals(-1, $this->cache->calculateFolderSize($folder));
 
-               $fileData['unkownSize'] = array('size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $fileData['unkownSize'] = ['size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file'];
                $this->cache->put($file4, $fileData['unkownSize']);
 
                $this->assertEquals(1025, $this->cache->calculateFolderSize($folder));
@@ -164,8 +164,8 @@ class CacheTest extends \Test\TestCase {
        }
 
        public function testRemoveRecursive() {
-               $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
-               $fileData = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain');
+               $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
+               $fileData = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain'];
                $folders = ['folder', 'folder/subfolder', 'folder/sub2', 'folder/sub2/sub3'];
                $files = ['folder/foo.txt', 'folder/bar.txt', 'folder/subfolder/asd.txt', 'folder/sub2/qwerty.txt', 'folder/sub2/sub3/foo.txt'];
 
@@ -184,27 +184,27 @@ class CacheTest extends \Test\TestCase {
 
        public function folderDataProvider() {
 
-               return array(
-                       array('folder'),
+               return [
+                       ['folder'],
                        // that was too easy, try something harder
-                       array('☺, WHITE SMILING FACE, UTF-8 hex E298BA'),
+                       ['☺, WHITE SMILING FACE, UTF-8 hex E298BA'],
                        // what about 4 byte utf-8
-                       array('😐, NEUTRAL_FACE, UTF-8 hex F09F9890'),
+                       ['😐, NEUTRAL_FACE, UTF-8 hex F09F9890'],
                        // now the crazy stuff
-                       array(', UNASSIGNED PRIVATE USE, UTF-8 hex EF9890'),
+                       [', UNASSIGNED PRIVATE USE, UTF-8 hex EF9890'],
                        // and my favorite
-                       array('w͢͢͝h͡o͢͡ ̸͢k̵͟n̴͘ǫw̸̛s͘ ̀́w͘͢ḩ̵a҉̡͢t ̧̕h́o̵r͏̵rors̡ ̶͡͠lį̶e͟͟ ̶͝in͢ ͏t̕h̷̡͟e ͟͟d̛a͜r̕͡k̢̨ ͡h̴e͏a̷̢̡rt́͏ ̴̷͠ò̵̶f̸ u̧͘ní̛͜c͢͏o̷͏d̸͢e̡͝')
-               );
+                       ['w͢͢͝h͡o͢͡ ̸͢k̵͟n̴͘ǫw̸̛s͘ ̀́w͘͢ḩ̵a҉̡͢t ̧̕h́o̵r͏̵rors̡ ̶͡͠lį̶e͟͟ ̶͝in͢ ͏t̕h̷̡͟e ͟͟d̛a͜r̕͡k̢̨ ͡h̴e͏a̷̢̡rt́͏ ̴̷͠ò̵̶f̸ u̧͘ní̛͜c͢͏o̷͏d̸͢e̡͝']
+               ];
        }
 
        public function testEncryptedFolder() {
                $file1 = 'folder';
                $file2 = 'folder/bar';
                $file3 = 'folder/foo';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
-               $fileData = array();
-               $fileData['bar'] = array('size' => 1000, 'encrypted' => 1, 'mtime' => 20, 'mimetype' => 'foo/file');
-               $fileData['foo'] = array('size' => 20, 'encrypted' => 1, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
+               $fileData = [];
+               $fileData['bar'] = ['size' => 1000, 'encrypted' => 1, 'mtime' => 20, 'mimetype' => 'foo/file'];
+               $fileData['foo'] = ['size' => 20, 'encrypted' => 1, 'mtime' => 25, 'mimetype' => 'foo/file'];
 
                $this->cache->put($file1, $data1);
                $this->cache->put($file2, $fileData['bar']);
@@ -217,12 +217,12 @@ class CacheTest extends \Test\TestCase {
                }
 
                $file4 = 'folder/unkownSize';
-               $fileData['unkownSize'] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $fileData['unkownSize'] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file'];
                $this->cache->put($file4, $fileData['unkownSize']);
 
                $this->assertEquals(-1, $this->cache->calculateFolderSize($file1));
 
-               $fileData['unkownSize'] = array('size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $fileData['unkownSize'] = ['size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file'];
                $this->cache->put($file4, $fileData['unkownSize']);
 
                $this->assertEquals(1025, $this->cache->calculateFolderSize($file1));
@@ -243,10 +243,10 @@ class CacheTest extends \Test\TestCase {
        public function testRootFolderSizeForNonHomeStorage() {
                $dir1 = 'knownsize';
                $dir2 = 'unknownsize';
-               $fileData = array();
-               $fileData[''] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData[$dir2] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory');
+               $fileData = [];
+               $fileData[''] = ['size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData[$dir1] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData[$dir2] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory'];
 
                $this->cache->put('', $fileData['']);
                $this->cache->put($dir1, $fileData[$dir1]);
@@ -269,11 +269,11 @@ class CacheTest extends \Test\TestCase {
 
        function testStatus() {
                $this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->getStatus('foo'));
-               $this->cache->put('foo', array('size' => -1));
+               $this->cache->put('foo', ['size' => -1]);
                $this->assertEquals(\OC\Files\Cache\Cache::PARTIAL, $this->cache->getStatus('foo'));
-               $this->cache->put('foo', array('size' => -1, 'mtime' => 20, 'mimetype' => 'foo/file'));
+               $this->cache->put('foo', ['size' => -1, 'mtime' => 20, 'mimetype' => 'foo/file']);
                $this->assertEquals(\OC\Files\Cache\Cache::SHALLOW, $this->cache->getStatus('foo'));
-               $this->cache->put('foo', array('size' => 10));
+               $this->cache->put('foo', ['size' => 10]);
                $this->assertEquals(\OC\Files\Cache\Cache::COMPLETE, $this->cache->getStatus('foo'));
        }
 
@@ -292,7 +292,7 @@ class CacheTest extends \Test\TestCase {
        public function testPutWithAllKindOfQuotes($fileName) {
 
                $this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->get($fileName));
-               $this->cache->put($fileName, array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName));
+               $this->cache->put($fileName, ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName]);
 
                $cacheEntry = $this->cache->get($fileName);
                $this->assertEquals($fileName, $cacheEntry['etag']);
@@ -303,10 +303,10 @@ class CacheTest extends \Test\TestCase {
                $file1 = 'folder';
                $file2 = 'folder/foobar';
                $file3 = 'folder/foo';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
-               $fileData = array();
-               $fileData['foobar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
-               $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+               $fileData = [];
+               $fileData['foobar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+               $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
 
                $this->cache->put($file1, $data1);
                $this->cache->put($file2, $fileData['foobar']);
@@ -339,12 +339,12 @@ class CacheTest extends \Test\TestCase {
                $file3 = 'folder/foo';
                $file4 = 'folder/foo2';
                $file5 = 'folder/foo3';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
-               $fileData = array();
-               $fileData['foobar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
-               $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
-               $fileData['foo2'] = array('size' => 25, 'mtime' => 28, 'mimetype' => 'foo/file');
-               $fileData['foo3'] = array('size' => 88, 'mtime' => 34, 'mimetype' => 'foo/file');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+               $fileData = [];
+               $fileData['foobar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+               $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
+               $fileData['foo2'] = ['size' => 25, 'mtime' => 28, 'mimetype' => 'foo/file'];
+               $fileData['foo3'] = ['size' => 88, 'mtime' => 34, 'mimetype' => 'foo/file'];
 
                $id1 = $this->cache->put($file1, $data1);
                $id2 = $this->cache->put($file2, $fileData['foobar']);
@@ -387,10 +387,10 @@ class CacheTest extends \Test\TestCase {
                $file1 = 'folder';
                $file2 = 'folder/foobar';
                $file3 = 'folder/foo';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
-               $fileData = array();
-               $fileData['foobar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
-               $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+               $fileData = [];
+               $fileData['foobar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+               $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
 
                $this->cache->put($file1, $data1);
                $this->cache->put($file2, $fileData['foobar']);
@@ -430,8 +430,8 @@ class CacheTest extends \Test\TestCase {
         * @dataProvider movePathProvider
         */
        function testMove($sourceFolder, $targetFolder, $children) {
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar');
-               $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar'];
+               $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                // create folders
                foreach ([$sourceFolder, $targetFolder] as $current) {
@@ -469,7 +469,7 @@ class CacheTest extends \Test\TestCase {
                $file2 = 'folder2';
                $file3 = 'folder3';
                $file4 = 'folder4';
-               $data = array('size' => 10, 'mtime' => 50, 'mimetype' => 'foo/bar');
+               $data = ['size' => 10, 'mtime' => 50, 'mimetype' => 'foo/bar'];
 
                $this->cache->put($file1, $data);
                $data['size'] = -1;
@@ -484,44 +484,44 @@ class CacheTest extends \Test\TestCase {
        function testNonExisting() {
                $this->assertFalse($this->cache->get('foo.txt'));
                $this->assertFalse($this->cache->get(-1));
-               $this->assertEquals(array(), $this->cache->getFolderContents('foo'));
+               $this->assertEquals([], $this->cache->getFolderContents('foo'));
        }
 
        function testGetById() {
                $storageId = $this->storage->getId();
-               $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+               $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
                $id = $this->cache->put('foo', $data);
 
                if (strlen($storageId) > 64) {
                        $storageId = md5($storageId);
                }
-               $this->assertEquals(array($storageId, 'foo'), \OC\Files\Cache\Cache::getById($id));
+               $this->assertEquals([$storageId, 'foo'], \OC\Files\Cache\Cache::getById($id));
        }
 
        function testStorageMTime() {
-               $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+               $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
                $this->cache->put('foo', $data);
                $cachedData = $this->cache->get('foo');
                $this->assertEquals($data['mtime'], $cachedData['storage_mtime']); //if no storage_mtime is saved, mtime should be used
 
-               $this->cache->put('foo', array('storage_mtime' => 30)); //when setting storage_mtime, mtime is also set
+               $this->cache->put('foo', ['storage_mtime' => 30]); //when setting storage_mtime, mtime is also set
                $cachedData = $this->cache->get('foo');
                $this->assertEquals(30, $cachedData['storage_mtime']);
                $this->assertEquals(30, $cachedData['mtime']);
 
-               $this->cache->put('foo', array('mtime' => 25)); //setting mtime does not change storage_mtime
+               $this->cache->put('foo', ['mtime' => 25]); //setting mtime does not change storage_mtime
                $cachedData = $this->cache->get('foo');
                $this->assertEquals(30, $cachedData['storage_mtime']);
                $this->assertEquals(25, $cachedData['mtime']);
        }
 
        function testLongId() {
-               $storage = new LongId(array());
+               $storage = new LongId([]);
                $cache = $storage->getCache();
                $storageId = $storage->getId();
-               $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+               $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
                $id = $cache->put('foo', $data);
-               $this->assertEquals(array(md5($storageId), 'foo'), \OC\Files\Cache\Cache::getById($id));
+               $this->assertEquals([md5($storageId), 'foo'], \OC\Files\Cache\Cache::getById($id));
        }
 
        /**
@@ -546,7 +546,7 @@ class CacheTest extends \Test\TestCase {
                        ->method('normalize')
                        ->willReturnArgument(0);
 
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                // put root folder
                $this->assertFalse($cacheMock->get('folder'));
@@ -586,7 +586,7 @@ class CacheTest extends \Test\TestCase {
                // folder name "Schön" with U+0308 (un-normalized)
                $folderWith0308 = "\x53\x63\x68\x6f\xcc\x88\x6e";
 
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                // put root folder
                $this->assertFalse($this->cache->get('folder'));
@@ -611,12 +611,12 @@ class CacheTest extends \Test\TestCase {
        }
 
        function bogusPathNamesProvider() {
-               return array(
-                       array('/bogus.txt', 'bogus.txt'),
-                       array('//bogus.txt', 'bogus.txt'),
-                       array('bogus/', 'bogus'),
-                       array('bogus//', 'bogus'),
-               );
+               return [
+                       ['/bogus.txt', 'bogus.txt'],
+                       ['//bogus.txt', 'bogus.txt'],
+                       ['bogus/', 'bogus'],
+                       ['bogus//', 'bogus'],
+               ];
        }
 
        /**
@@ -625,7 +625,7 @@ class CacheTest extends \Test\TestCase {
         * @dataProvider bogusPathNamesProvider
         */
        public function testBogusPaths($bogusPath, $fixedBogusPath) {
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                // put root folder
                $this->assertFalse($this->cache->get(''));
@@ -647,12 +647,12 @@ class CacheTest extends \Test\TestCase {
        }
 
        public function testNoReuseOfFileId() {
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'];
                $this->cache->put('somefile.txt', $data1);
                $info = $this->cache->get('somefile.txt');
                $fileId = $info['fileid'];
                $this->cache->remove('somefile.txt');
-               $data2 = array('size' => 200, 'mtime' => 100, 'mimetype' => 'text/plain');
+               $data2 = ['size' => 200, 'mtime' => 100, 'mimetype' => 'text/plain'];
                $this->cache->put('anotherfile.txt', $data2);
                $info2 = $this->cache->get('anotherfile.txt');
                $fileId2 = $info2['fileid'];
@@ -672,7 +672,7 @@ class CacheTest extends \Test\TestCase {
         * @dataProvider escapingProvider
         */
        public function testEscaping($name) {
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain');
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'];
                $this->cache->put($name, $data);
                $this->assertTrue($this->cache->inCache($name));
                $retrievedData = $this->cache->get($name);
@@ -684,7 +684,7 @@ class CacheTest extends \Test\TestCase {
                $this->assertTrue($this->cache->inCache($name . 'asd'));
                $this->cache->remove($name . 'asd');
                $this->assertFalse($this->cache->inCache($name . 'asd'));
-               $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
                $this->cache->put($name, $folderData);
                $this->cache->put('other', $folderData);
                $childs = ['asd', 'bar', 'foo', 'sub/folder'];
@@ -788,8 +788,8 @@ class CacheTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->storage = new \OC\Files\Storage\Temporary(array());
-               $this->storage2 = new \OC\Files\Storage\Temporary(array());
+               $this->storage = new \OC\Files\Storage\Temporary([]);
+               $this->storage2 = new \OC\Files\Storage\Temporary([]);
                $this->cache = new \OC\Files\Cache\Cache($this->storage);
                $this->cache2 = new \OC\Files\Cache\Cache($this->storage2);
        }
index 51fc2e5bc9bc4217917371377b9c1a00fd790a74..aacb91c675e8888c5c4425e923fb5a2a89ae9633 100644 (file)
@@ -70,7 +70,7 @@ class HomeCacheTest extends \Test\TestCase {
                parent::setUp();
 
                $this->user = new DummyUser('foo', \OC::$server->getTempManager()->getTemporaryFolder());
-               $this->storage = new \OC\Files\Storage\Home(array('user' => $this->user));
+               $this->storage = new \OC\Files\Storage\Home(['user' => $this->user]);
                $this->cache = $this->storage->getCache();
        }
 
@@ -82,11 +82,11 @@ class HomeCacheTest extends \Test\TestCase {
        public function testRootFolderSizeIgnoresUnknownUpdate() {
                $dir1 = 'files/knownsize';
                $dir2 = 'files/unknownsize';
-               $fileData = array();
-               $fileData[''] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData['files'] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData[$dir2] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory');
+               $fileData = [];
+               $fileData[''] = ['size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData['files'] = ['size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData[$dir1] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData[$dir2] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory'];
 
                $this->cache->put('', $fileData['']);
                $this->cache->put('files', $fileData['files']);
@@ -114,10 +114,10 @@ class HomeCacheTest extends \Test\TestCase {
        public function testRootFolderSizeIsFilesSize() {
                $dir1 = 'files';
                $afile = 'test.txt';
-               $fileData = array();
-               $fileData[''] = array('size' => 1500, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
-               $fileData[$afile] = array('size' => 500, 'mtime' => 20);
+               $fileData = [];
+               $fileData[''] = ['size' => 1500, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData[$dir1] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+               $fileData[$afile] = ['size' => 500, 'mtime' => 20];
 
                $this->cache->put('', $fileData['']);
                $this->cache->put($dir1, $fileData[$dir1]);
index f93b95b5fe739a669abf23f163bbfa817822b035..6e1430d146bdc58bfe07955bba42e6994c6810ef 100644 (file)
@@ -23,8 +23,8 @@ class MoveFromCacheTraitTest extends CacheTest {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->storage = new \OC\Files\Storage\Temporary(array());
-               $this->storage2 = new \OC\Files\Storage\Temporary(array());
+               $this->storage = new \OC\Files\Storage\Temporary([]);
+               $this->storage2 = new \OC\Files\Storage\Temporary([]);
                $this->cache = new FallBackCrossCacheMoveCache($this->storage);
                $this->cache2 = new FallBackCrossCacheMoveCache($this->storage2);
        }
index 6a025410cc3f6f7df126af278a718b5ede7e8265..52f6697cc6df2d7938d0094440727eeaad7e2295 100644 (file)
@@ -36,7 +36,7 @@ class ScannerTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->storage = new \OC\Files\Storage\Temporary(array());
+               $this->storage = new \OC\Files\Storage\Temporary([]);
                $this->scanner = new \OC\Files\Cache\Scanner($this->storage);
                $this->cache = new \OC\Files\Cache\Cache($this->storage);
        }
@@ -247,7 +247,7 @@ class ScannerTest extends \Test\TestCase {
                $this->scanner->scan('');
                $oldData = $this->cache->get('');
                $this->storage->unlink('folder/bar.txt');
-               $this->cache->put('folder', array('mtime' => $this->storage->filemtime('folder'), 'storage_mtime' => $this->storage->filemtime('folder')));
+               $this->cache->put('folder', ['mtime' => $this->storage->filemtime('folder'), 'storage_mtime' => $this->storage->filemtime('folder')]);
                $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_SIZE);
                $newData = $this->cache->get('');
                $this->assertIsString($oldData['etag']);
@@ -345,7 +345,7 @@ class ScannerTest extends \Test\TestCase {
 
                // delete the folder without removing the childs
                $sql = 'DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ?';
-               \OC_DB::executeAudited($sql, array($oldFolderId));
+               \OC_DB::executeAudited($sql, [$oldFolderId]);
 
                $cachedData = $this->cache->get('folder/bar.txt');
                $this->assertEquals($oldFolderId, $cachedData['parent']);
@@ -369,7 +369,7 @@ class ScannerTest extends \Test\TestCase {
 
                // delete the folder without removing the childs
                $sql = 'DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ?';
-               \OC_DB::executeAudited($sql, array($oldFolderId));
+               \OC_DB::executeAudited($sql, [$oldFolderId]);
 
                $cachedData = $this->cache->get('folder/bar.txt');
                $this->assertEquals($oldFolderId, $cachedData['parent']);
index a3b1a428c28f9a97112168b4162cc33c6891c90e..6366a8eb7eb6aad7f8e23d8b3231eb7ebe69e0a9 100644 (file)
@@ -40,7 +40,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->storage = new \OC\Files\Storage\Temporary(array());
+               $this->storage = new \OC\Files\Storage\Temporary([]);
                $textData = "dummy file data\n";
                $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
                $this->storage->mkdir('folder');
@@ -63,7 +63,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
                Filesystem::init(self::$user, '/' . self::$user . '/files');
 
                Filesystem::clearMounts();
-               Filesystem::mount($this->storage, array(), '/' . self::$user . '/files');
+               Filesystem::mount($this->storage, [], '/' . self::$user . '/files');
 
                \OC_Hook::clear('OC_Filesystem');
        }
@@ -85,7 +85,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
        public function testWrite() {
                $textSize = strlen("dummy file data\n");
                $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
-               $this->cache->put('foo.txt', array('mtime' => 100, 'storage_mtime' => 150));
+               $this->cache->put('foo.txt', ['mtime' => 100, 'storage_mtime' => 150]);
                $rootCachedData = $this->cache->get('');
                $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
 
@@ -118,10 +118,10 @@ class UpdaterLegacyTest extends \Test\TestCase {
        }
 
        public function testWriteWithMountPoints() {
-               $storage2 = new \OC\Files\Storage\Temporary(array());
+               $storage2 = new \OC\Files\Storage\Temporary([]);
                $storage2->getScanner()->scan(''); //initialize etags
                $cache2 = $storage2->getCache();
-               Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+               Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
                $view = new View('/' . self::$user . '/files');
                $folderCachedData = $view->getFileInfo('folder');
                $substorageCachedData = $cache2->get('');
@@ -179,9 +179,9 @@ class UpdaterLegacyTest extends \Test\TestCase {
        }
 
        public function testDeleteWithMountPoints() {
-               $storage2 = new \OC\Files\Storage\Temporary(array());
+               $storage2 = new \OC\Files\Storage\Temporary([]);
                $cache2 = $storage2->getCache();
-               Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+               Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
                Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
                $view = new View('/' . self::$user . '/files');
                $this->assertTrue($cache2->inCache('foo.txt'));
@@ -235,9 +235,9 @@ class UpdaterLegacyTest extends \Test\TestCase {
        }
 
        public function testRenameWithMountPoints() {
-               $storage2 = new \OC\Files\Storage\Temporary(array());
+               $storage2 = new \OC\Files\Storage\Temporary([]);
                $cache2 = $storage2->getCache();
-               Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+               Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
                Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
                $view = new View('/' . self::$user . '/files');
                $this->assertTrue($cache2->inCache('foo.txt'));
index 8dc5893007bb3186c477e42163b5876c78a84c83..f8880d0f2a87bcd9b4cd36ee71f0b3c650e14820 100644 (file)
@@ -45,7 +45,7 @@ class UpdaterTest extends \Test\TestCase {
 
                $this->loginAsUser();
 
-               $this->storage = new Temporary(array());
+               $this->storage = new Temporary([]);
                $this->updater = $this->storage->getUpdater();
                $this->cache = $this->storage->getCache();
        }
@@ -220,9 +220,9 @@ class UpdaterTest extends \Test\TestCase {
        }
 
        public function testMoveCrossStorage() {
-               $storage2 = new Temporary(array());
+               $storage2 = new Temporary([]);
                $cache2 = $storage2->getCache();
-               Filesystem::mount($storage2, array(), '/bar');
+               Filesystem::mount($storage2, [], '/bar');
                $this->storage->file_put_contents('foo.txt', 'qwerty');
 
                $this->updater->update('foo.txt');
@@ -251,9 +251,9 @@ class UpdaterTest extends \Test\TestCase {
        }
 
        public function testMoveFolderCrossStorage() {
-               $storage2 = new Temporary(array());
+               $storage2 = new Temporary([]);
                $cache2 = $storage2->getCache();
-               Filesystem::mount($storage2, array(), '/bar');
+               Filesystem::mount($storage2, [], '/bar');
                $this->storage->mkdir('foo');
                $this->storage->mkdir('foo/bar');
                $this->storage->file_put_contents('foo/foo.txt', 'qwerty');
index 18f0ebe98a926d1bab0e94ceef342e4c314431db..2a42a9e603f55728518cf8042467192f3ec7c622 100644 (file)
@@ -20,7 +20,7 @@ class WatcherTest extends \Test\TestCase {
        /**
         * @var \OC\Files\Storage\Storage[] $storages
         */
-       private $storages = array();
+       private $storages = [];
 
        protected function setUp(): void {
                parent::setUp();
@@ -49,7 +49,7 @@ class WatcherTest extends \Test\TestCase {
                $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
 
                //set the mtime to the past so it can detect an mtime change
-               $cache->put('', array('storage_mtime' => 10));
+               $cache->put('', ['storage_mtime' => 10]);
 
                $this->assertTrue($cache->inCache('folder/bar.txt'));
                $this->assertTrue($cache->inCache('folder/bar2.txt'));
@@ -61,7 +61,7 @@ class WatcherTest extends \Test\TestCase {
                $cachedData = $cache->get('bar.test');
                $this->assertEquals(3, $cachedData['size']);
 
-               $cache->put('bar.test', array('storage_mtime' => 10));
+               $cache->put('bar.test', ['storage_mtime' => 10]);
                $storage->file_put_contents('bar.test', 'test data');
 
                // make sure that PHP can read the new size correctly
@@ -71,7 +71,7 @@ class WatcherTest extends \Test\TestCase {
                $cachedData = $cache->get('bar.test');
                $this->assertEquals(9, $cachedData['size']);
 
-               $cache->put('folder', array('storage_mtime' => 10));
+               $cache->put('folder', ['storage_mtime' => 10]);
 
                $storage->unlink('folder/bar2.txt');
                $updater->checkUpdate('folder');
@@ -90,7 +90,7 @@ class WatcherTest extends \Test\TestCase {
                $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
 
                //set the mtime to the past so it can detect an mtime change
-               $cache->put('', array('storage_mtime' => 10));
+               $cache->put('', ['storage_mtime' => 10]);
 
                $storage->unlink('foo.txt');
                $storage->rename('folder', 'foo.txt');
@@ -107,7 +107,7 @@ class WatcherTest extends \Test\TestCase {
                $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
 
                //set the mtime to the past so it can detect an mtime change
-               $cache->put('foo.txt', array('storage_mtime' => 10));
+               $cache->put('foo.txt', ['storage_mtime' => 10]);
 
                $storage->unlink('foo.txt');
                $storage->rename('folder', 'foo.txt');
@@ -124,14 +124,14 @@ class WatcherTest extends \Test\TestCase {
                $updater = $storage->getWatcher();
 
                //set the mtime to the past so it can detect an mtime change
-               $cache->put('foo.txt', array('storage_mtime' => 10));
+               $cache->put('foo.txt', ['storage_mtime' => 10]);
 
                $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_NEVER);
 
                $storage->file_put_contents('foo.txt', 'q');
                $this->assertFalse($updater->checkUpdate('foo.txt'));
 
-               $cache->put('foo.txt', array('storage_mtime' => 20));
+               $cache->put('foo.txt', ['storage_mtime' => 20]);
                $storage->file_put_contents('foo.txt', 'w');
                $this->assertFalse($updater->checkUpdate('foo.txt'));
        }
@@ -142,14 +142,14 @@ class WatcherTest extends \Test\TestCase {
                $updater = $storage->getWatcher();
 
                //set the mtime to the past so it can detect an mtime change
-               $cache->put('foo.txt', array('storage_mtime' => 10));
+               $cache->put('foo.txt', ['storage_mtime' => 10]);
 
                $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
 
                $storage->file_put_contents('foo.txt', 'q');
                $this->assertTrue($updater->checkUpdate('foo.txt'));
 
-               $cache->put('foo.txt', array('storage_mtime' => 20));
+               $cache->put('foo.txt', ['storage_mtime' => 20]);
                $storage->file_put_contents('foo.txt', 'w');
                $this->assertFalse($updater->checkUpdate('foo.txt'));
        }
@@ -160,14 +160,14 @@ class WatcherTest extends \Test\TestCase {
                $updater = $storage->getWatcher();
 
                //set the mtime to the past so it can detect an mtime change
-               $cache->put('foo.txt', array('storage_mtime' => 10));
+               $cache->put('foo.txt', ['storage_mtime' => 10]);
 
                $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ALWAYS);
 
                $storage->file_put_contents('foo.txt', 'q');
                $this->assertTrue($updater->checkUpdate('foo.txt'));
 
-               $cache->put('foo.txt', array('storage_mtime' => 20));
+               $cache->put('foo.txt', ['storage_mtime' => 20]);
                $storage->file_put_contents('foo.txt', 'w');
                $this->assertTrue($updater->checkUpdate('foo.txt'));
        }
@@ -177,7 +177,7 @@ class WatcherTest extends \Test\TestCase {
         * @return \OC\Files\Storage\Storage
         */
        private function getTestStorage($scan = true) {
-               $storage = new \OC\Files\Storage\Temporary(array());
+               $storage = new \OC\Files\Storage\Temporary([]);
                $textData = "dummy file data\n";
                $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
                $storage->mkdir('folder');
index 9c1a8c14101ad0ad537dbe63157a475cb577ace0..5d7e9f8ec08f1e2b1973588d9db4c98c17093144 100644 (file)
@@ -34,7 +34,7 @@ class CacheJailTest extends CacheTest {
        function testSearchOutsideJail() {
                $file1 = 'foo/foobar';
                $file2 = 'folder/foobar';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
 
                $this->sourceCache->put($file1, $data1);
                $this->sourceCache->put($file2, $data1);
@@ -50,7 +50,7 @@ class CacheJailTest extends CacheTest {
                $file1 = 'foo/foobar';
                $file2 = 'foo/foobar/asd';
                $file3 = 'folder/foobar';
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                $this->sourceCache->put('foo', $data1);
                $this->sourceCache->put($file1, $data1);
@@ -64,7 +64,7 @@ class CacheJailTest extends CacheTest {
        }
 
        function testGetById() {
-               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
                $id = $this->sourceCache->put('foo/bar', $data1);
 
                // path from jailed foo of foo/bar is bar
@@ -83,7 +83,7 @@ class CacheJailTest extends CacheTest {
        }
 
        function testMoveFromJail() {
-               $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                $this->sourceCache->put('source', $folderData);
                $this->sourceCache->put('source/foo', $folderData);
@@ -99,7 +99,7 @@ class CacheJailTest extends CacheTest {
        }
 
        function testMoveToJail() {
-               $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                $this->sourceCache->put('source', $folderData);
                $this->sourceCache->put('source/foo', $folderData);
@@ -115,7 +115,7 @@ class CacheJailTest extends CacheTest {
        }
 
        function testMoveBetweenJail() {
-               $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+               $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
 
                $this->sourceCache->put('source', $folderData);
                $this->sourceCache->put('source/foo', $folderData);
index 9883fc1da276c0a83c311893050138309059085a..20c20974c07405dd169537aa82e0aebaea38aec5 100644 (file)
@@ -36,12 +36,12 @@ class CachePermissionsMaskTest extends CacheTest {
        }
 
        public function maskProvider() {
-               return array(
-                       array(Constants::PERMISSION_ALL),
-                       array(Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE),
-                       array(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE),
-                       array(Constants::PERMISSION_READ)
-               );
+               return [
+                       [Constants::PERMISSION_ALL],
+                       [Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE],
+                       [Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE],
+                       [Constants::PERMISSION_READ]
+               ];
        }
 
        /**
@@ -50,12 +50,12 @@ class CachePermissionsMaskTest extends CacheTest {
         */
        public function testGetMasked($mask) {
                $cache = $this->getMaskedCached($mask);
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL);
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL];
                $this->sourceCache->put('foo', $data);
                $result = $cache->get('foo');
                $this->assertEquals($mask, $result['permissions']);
 
-               $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE);
+               $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE];
                $this->sourceCache->put('bar', $data);
                $result = $cache->get('bar');
                $this->assertEquals($mask & ~Constants::PERMISSION_DELETE, $result['permissions']);
index d3b372fe1376245d79eb4af9bf66b62e7e7c21b6..8c6dd1964aba85ee4bd7345b68713975cd532295 100644 (file)
@@ -67,7 +67,7 @@ class EtagTest extends \Test\TestCase {
                Filesystem::file_put_contents('/folder/bar.txt', 'fgh');
                Filesystem::file_put_contents('/folder/subfolder/qwerty.txt', 'jkl');
 
-               $files = array('/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt');
+               $files = ['/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt'];
                $originalEtags = $this->getEtags($files);
 
                $scanner = new \OC\Files\Utils\Scanner($user1, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->getLogger());
@@ -84,7 +84,7 @@ class EtagTest extends \Test\TestCase {
         * @param string[] $files
         */
        private function getEtags($files) {
-               $etags = array();
+               $etags = [];
                foreach ($files as $file) {
                        $info = Filesystem::getFileInfo($file);
                        $etags[$file] = $info['etag'];
index 6d0362772ca699c947abc95c3cde9b3618a1d512..d98256501b159b57dd76a90bc955a14f42d9a18d 100644 (file)
@@ -66,7 +66,7 @@ class FilesystemTest extends \Test\TestCase {
        /**
         * @var array tmpDirs
         */
-       private $tmpDirs = array();
+       private $tmpDirs = [];
 
        /**
         * @return array
@@ -74,7 +74,7 @@ class FilesystemTest extends \Test\TestCase {
        private function getStorageData() {
                $dir = \OC::$server->getTempManager()->getTemporaryFolder();
                $this->tmpDirs[] = $dir;
-               return array('datadir' => $dir);
+               return ['datadir' => $dir];
        }
 
        protected function setUp(): void {
@@ -225,29 +225,29 @@ class FilesystemTest extends \Test\TestCase {
        }
 
        public function isValidPathData() {
-               return array(
-                       array('/', true),
-                       array('/path', true),
-                       array('/foo/bar', true),
-                       array('/foo//bar/', true),
-                       array('/foo////bar', true),
-                       array('/foo//\///bar', true),
-                       array('/foo/bar/.', true),
-                       array('/foo/bar/./', true),
-                       array('/foo/bar/./.', true),
-                       array('/foo/bar/././', true),
-                       array('/foo/bar/././..bar', true),
-                       array('/foo/bar/././..bar/a', true),
-                       array('/foo/bar/././..', false),
-                       array('/foo/bar/././../', false),
-                       array('/foo/bar/.././', false),
-                       array('/foo/bar/../../', false),
-                       array('/foo/bar/../..\\', false),
-                       array('..', false),
-                       array('../', false),
-                       array('../foo/bar', false),
-                       array('..\foo/bar', false),
-               );
+               return [
+                       ['/', true],
+                       ['/path', true],
+                       ['/foo/bar', true],
+                       ['/foo//bar/', true],
+                       ['/foo////bar', true],
+                       ['/foo//\///bar', true],
+                       ['/foo/bar/.', true],
+                       ['/foo/bar/./', true],
+                       ['/foo/bar/./.', true],
+                       ['/foo/bar/././', true],
+                       ['/foo/bar/././..bar', true],
+                       ['/foo/bar/././..bar/a', true],
+                       ['/foo/bar/././..', false],
+                       ['/foo/bar/././../', false],
+                       ['/foo/bar/.././', false],
+                       ['/foo/bar/../../', false],
+                       ['/foo/bar/../..\\', false],
+                       ['..', false],
+                       ['../', false],
+                       ['../foo/bar', false],
+                       ['..\foo/bar', false],
+               ];
        }
 
        /**
@@ -258,18 +258,18 @@ class FilesystemTest extends \Test\TestCase {
        }
 
        public function isFileBlacklistedData() {
-               return array(
-                       array('/etc/foo/bar/foo.txt', false),
-                       array('\etc\foo/bar\foo.txt', false),
-                       array('.htaccess', true),
-                       array('.htaccess/', true),
-                       array('.htaccess\\', true),
-                       array('/etc/foo\bar/.htaccess\\', true),
-                       array('/etc/foo\bar/.htaccess/', true),
-                       array('/etc/foo\bar/.htaccess/foo', false),
-                       array('//foo//bar/\.htaccess/', true),
-                       array('\foo\bar\.HTAccess', true),
-               );
+               return [
+                       ['/etc/foo/bar/foo.txt', false],
+                       ['\etc\foo/bar\foo.txt', false],
+                       ['.htaccess', true],
+                       ['.htaccess/', true],
+                       ['.htaccess\\', true],
+                       ['/etc/foo\bar/.htaccess\\', true],
+                       ['/etc/foo\bar/.htaccess/', true],
+                       ['/etc/foo\bar/.htaccess/foo', false],
+                       ['//foo//bar/\.htaccess/', true],
+                       ['\foo\bar\.HTAccess', true],
+               ];
        }
 
        /**
@@ -304,7 +304,7 @@ class FilesystemTest extends \Test\TestCase {
                \OC_Hook::clear('OC_Filesystem');
                \OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook');
 
-               \OC\Files\Filesystem::mount('OC\Files\Storage\Temporary', array(), '/');
+               \OC\Files\Filesystem::mount('OC\Files\Storage\Temporary', [], '/');
 
                $rootView = new \OC\Files\View('');
                $rootView->mkdir('/' . $user);
index f3cdc4264e4b76fc21db7f7136030693514afe20..1e80ec17ea118196ee56c172d88b2a2645837a19 100644 (file)
@@ -30,39 +30,39 @@ class ManagerTest extends \Test\TestCase {
        public function testFind() {
                $this->assertNull($this->manager->find('/'));
 
-               $rootMount = new \OC\Files\Mount\MountPoint(new Temporary(array()), '/');
+               $rootMount = new \OC\Files\Mount\MountPoint(new Temporary([]), '/');
                $this->manager->addMount($rootMount);
                $this->assertEquals($rootMount, $this->manager->find('/'));
                $this->assertEquals($rootMount, $this->manager->find('/foo/bar'));
 
-               $storage = new Temporary(array());
+               $storage = new Temporary([]);
                $mount1 = new \OC\Files\Mount\MountPoint($storage, '/foo');
                $this->manager->addMount($mount1);
                $this->assertEquals($rootMount, $this->manager->find('/'));
                $this->assertEquals($mount1, $this->manager->find('/foo/bar'));
 
                $this->assertEquals(1, count($this->manager->findIn('/')));
-               $mount2 = new \OC\Files\Mount\MountPoint(new Temporary(array()), '/bar');
+               $mount2 = new \OC\Files\Mount\MountPoint(new Temporary([]), '/bar');
                $this->manager->addMount($mount2);
                $this->assertEquals(2, count($this->manager->findIn('/')));
 
                $id = $mount1->getStorageId();
-               $this->assertEquals(array($mount1), $this->manager->findByStorageId($id));
+               $this->assertEquals([$mount1], $this->manager->findByStorageId($id));
 
                $mount3 = new \OC\Files\Mount\MountPoint($storage, '/foo/bar');
                $this->manager->addMount($mount3);
-               $this->assertEquals(array($mount1, $mount3), $this->manager->findByStorageId($id));
+               $this->assertEquals([$mount1, $mount3], $this->manager->findByStorageId($id));
        }
 
        public function testLong() {
-               $storage = new LongId(array());
+               $storage = new LongId([]);
                $mount = new \OC\Files\Mount\MountPoint($storage, '/foo');
                $this->manager->addMount($mount);
 
                $id = $mount->getStorageId();
                $storageId = $storage->getId();
-               $this->assertEquals(array($mount), $this->manager->findByStorageId($id));
-               $this->assertEquals(array($mount), $this->manager->findByStorageId($storageId));
-               $this->assertEquals(array($mount), $this->manager->findByStorageId(md5($storageId)));
+               $this->assertEquals([$mount], $this->manager->findByStorageId($id));
+               $this->assertEquals([$mount], $this->manager->findByStorageId($storageId));
+               $this->assertEquals([$mount], $this->manager->findByStorageId(md5($storageId)));
        }
 }
index f21095f2fa52b2cd65a03369bb0a76813bebf468..160545e784cdece6c7b262a5c3a251a58ca1218b 100644 (file)
@@ -31,7 +31,7 @@ class MountTest extends \Test\TestCase {
                $wrapper = function ($mountPoint, $storage) use (&$test) {
                        $test->assertEquals('/foo/', $mountPoint);
                        $test->assertInstanceOf('\OC\Files\Storage\Storage', $storage);
-                       return new Wrapper(array('storage' => $storage));
+                       return new Wrapper(['storage' => $storage]);
                };
 
                $loader = new StorageFactory();
@@ -40,7 +40,7 @@ class MountTest extends \Test\TestCase {
                $storage = $this->getMockBuilder('\OC\Files\Storage\Temporary')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $mount = new \OC\Files\Mount\MountPoint($storage, '/foo', array(), $loader);
+               $mount = new \OC\Files\Mount\MountPoint($storage, '/foo', [], $loader);
                $this->assertInstanceOf('\OC\Files\Storage\Wrapper\Wrapper', $mount->getStorage());
        }
 }
index 69d31b28a963dff7a9d0088923c0fcff87b8d386..c6f468b796bbee6f5c5352b6773e1e0c6217bee0 100644 (file)
@@ -53,7 +53,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $this->assertEquals('bar', $node->getContent());
@@ -75,7 +75,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => 0)));
+                       ->willReturn($this->getFileInfo(['permissions' => 0]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $node->getContent();
@@ -94,7 +94,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $this->view->expects($this->once())
                        ->method('file_put_contents')
@@ -117,7 +117,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $node->putContent('bar');
@@ -132,7 +132,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('mimetype' => 'text/plain')));
+                       ->willReturn($this->getFileInfo(['mimetype' => 'text/plain']));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $this->assertEquals('text/plain', $node->getMimeType());
@@ -167,7 +167,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $fh = $node->fopen('r');
@@ -202,7 +202,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $fh = $node->fopen('w');
@@ -232,7 +232,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => 0)));
+                       ->willReturn($this->getFileInfo(['permissions' => 0]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $node->fopen('r');
@@ -257,7 +257,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_UPDATE)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_UPDATE]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $node->fopen('w');
@@ -282,7 +282,7 @@ class FileTest extends NodeTest {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
 
                $node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
                $node->fopen('w');
index 979c7fd6da63191d3bb88d53b46f2b385f05efeb..83ebc478370c1ab8778db8957ccd2dbfe48d495a 100644 (file)
@@ -64,10 +64,10 @@ class FolderTest extends NodeTest {
                $view->expects($this->any())
                        ->method('getDirectoryContent')
                        ->with('/bar/foo')
-                       ->willReturn(array(
+                       ->willReturn([
                                new FileInfo('/bar/foo/asd', null, 'foo/asd', ['fileid' => 2, 'path' => '/bar/foo/asd', 'name' => 'asd', 'size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'], null),
                                new FileInfo('/bar/foo/qwerty', null, 'foo/qwerty', ['fileid' => 3, 'path' => '/bar/foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'httpd/unix-directory'], null)
-                       ));
+                       ]);
 
                $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
                $children = $node->getDirectoryListing();
@@ -163,7 +163,7 @@ class FolderTest extends NodeTest {
                $view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $view->expects($this->once())
                        ->method('mkdir')
@@ -195,7 +195,7 @@ class FolderTest extends NodeTest {
                $view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
 
                $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
                $node->newFolder('asd');
@@ -217,7 +217,7 @@ class FolderTest extends NodeTest {
                $view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $view->expects($this->once())
                        ->method('touch')
@@ -249,7 +249,7 @@ class FolderTest extends NodeTest {
                $view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
 
                $node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
                $node->newFile('asd');
@@ -308,14 +308,14 @@ class FolderTest extends NodeTest {
                $cache->expects($this->once())
                        ->method('search')
                        ->with('%qw%')
-                       ->willReturn(array(
-                               array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
-                       ));
+                       ->willReturn([
+                               ['fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+                       ]);
 
                $root->expects($this->once())
                        ->method('getMountsIn')
                        ->with('/bar/foo')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $root->expects($this->once())
                        ->method('getMount')
@@ -361,15 +361,15 @@ class FolderTest extends NodeTest {
                $cache->expects($this->once())
                        ->method('search')
                        ->with('%qw%')
-                       ->willReturn(array(
-                               array('fileid' => 3, 'path' => 'files/foo', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'),
-                               array('fileid' => 3, 'path' => 'files_trashbin/foo2.d12345', 'name' => 'foo2.d12345', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'),
-                       ));
+                       ->willReturn([
+                               ['fileid' => 3, 'path' => 'files/foo', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'],
+                               ['fileid' => 3, 'path' => 'files_trashbin/foo2.d12345', 'name' => 'foo2.d12345', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'],
+                       ]);
 
                $root->expects($this->once())
                        ->method('getMountsIn')
                        ->with('')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $root->expects($this->once())
                        ->method('getMount')
@@ -412,14 +412,14 @@ class FolderTest extends NodeTest {
                $cache->expects($this->once())
                        ->method('search')
                        ->with('%qw%')
-                       ->willReturn(array(
-                               array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
-                       ));
+                       ->willReturn([
+                               ['fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+                       ]);
 
                $root->expects($this->once())
                        ->method('getMountsIn')
                        ->with('/bar')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $root->expects($this->once())
                        ->method('getMount')
@@ -478,21 +478,21 @@ class FolderTest extends NodeTest {
                $cache->expects($this->once())
                        ->method('search')
                        ->with('%qw%')
-                       ->willReturn(array(
-                               array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
-                       ));
+                       ->willReturn([
+                               ['fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+                       ]);
 
                $subCache->expects($this->once())
                        ->method('search')
                        ->with('%qw%')
-                       ->willReturn(array(
-                               array('fileid' => 4, 'path' => 'asd/qweasd', 'name' => 'qweasd', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
-                       ));
+                       ->willReturn([
+                               ['fileid' => 4, 'path' => 'asd/qweasd', 'name' => 'qweasd', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+                       ]);
 
                $root->expects($this->once())
                        ->method('getMountsIn')
                        ->with('/bar/foo')
-                       ->willReturn(array($subMount));
+                       ->willReturn([$subMount]);
 
                $root->expects($this->once())
                        ->method('getMount')
@@ -556,7 +556,7 @@ class FolderTest extends NodeTest {
                $root->expects($this->once())
                        ->method('getMountsIn')
                        ->with('/bar/foo')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $root->expects($this->once())
                        ->method('getMount')
@@ -659,7 +659,7 @@ class FolderTest extends NodeTest {
                $root->expects($this->once())
                        ->method('getMountsIn')
                        ->with('/bar/foo')
-                       ->willReturn(array());
+                       ->willReturn([]);
 
                $root->expects($this->once())
                        ->method('getMount')
@@ -727,7 +727,7 @@ class FolderTest extends NodeTest {
                $root->expects($this->any())
                        ->method('getMountsIn')
                        ->with('/bar/foo')
-                       ->willReturn(array($mount2));
+                       ->willReturn([$mount2]);
 
                $root->expects($this->once())
                        ->method('getMount')
index 2a542a1097a1dbeb4a767e99714f5c50b37d3d3d..26cdf398d94a2a79e6d9122a4164bffa0a7ce55f 100644 (file)
@@ -57,8 +57,8 @@ class IntegrationTest extends \Test\TestCase {
                        $this->createMock(ILogger::class),
                        $this->createMock(IUserManager::class)
                );
-               $storage = new Temporary(array());
-               $subStorage = new Temporary(array());
+               $storage = new Temporary([]);
+               $subStorage = new Temporary([]);
                $this->storages[] = $storage;
                $this->storages[] = $subStorage;
                $this->root->mount($storage, '/');
index 18cc4d8057480b7532875c51c16dedbeb7f5248b..b963a395560d18adfdf619e490f809c05e75a831 100644 (file)
@@ -203,13 +203,13 @@ abstract class NodeTest extends \Test\TestCase {
                        ->method('getUser')
                        ->willReturn($this->user);
 
-               $stat = array(
+               $stat = [
                        'fileid' => 1,
                        'size' => 100,
                        'etag' => 'qwerty',
                        'mtime' => 50,
                        'permissions' => 0
-               );
+               ];
 
                $this->view->expects($this->once())
                        ->method('stat')
@@ -225,12 +225,12 @@ abstract class NodeTest extends \Test\TestCase {
                        ->method('getUser')
                        ->willReturn($this->user);
 
-               $stat = $this->getFileInfo(array(
+               $stat = $this->getFileInfo([
                        'fileid' => 1,
                        'size' => 100,
                        'etag' => 'qwerty',
                        'mtime' => 50
-               ));
+               ]);
 
                $this->view->expects($this->once())
                        ->method('getFileInfo')
@@ -247,12 +247,12 @@ abstract class NodeTest extends \Test\TestCase {
                        ->willReturn($this->user);
 
 
-               $stat = $this->getFileInfo(array(
+               $stat = $this->getFileInfo([
                        'fileid' => 1,
                        'size' => 100,
                        'etag' => 'qwerty',
                        'mtime' => 50
-               ));
+               ]);
 
                $this->view->expects($this->once())
                        ->method('getFileInfo')
@@ -268,12 +268,12 @@ abstract class NodeTest extends \Test\TestCase {
                        ->method('getUser')
                        ->willReturn($this->user);
 
-               $stat = $this->getFileInfo(array(
+               $stat = $this->getFileInfo([
                        'fileid' => 1,
                        'size' => 100,
                        'etag' => 'qwerty',
                        'mtime' => 50
-               ));
+               ]);
 
                $this->view->expects($this->once())
                        ->method('getFileInfo')
@@ -289,12 +289,12 @@ abstract class NodeTest extends \Test\TestCase {
                        ->method('getUser')
                        ->willReturn($this->user);
 
-               $stat = $this->getFileInfo(array(
+               $stat = $this->getFileInfo([
                        'fileid' => 1,
                        'size' => 100,
                        'etag' => 'qwerty',
                        'mtime' => 50
-               ));
+               ]);
 
                $this->view->expects($this->once())
                        ->method('getFileInfo')
@@ -319,7 +319,7 @@ abstract class NodeTest extends \Test\TestCase {
                $this->view->expects($this->once())
                        ->method('resolvePath')
                        ->with('/bar/foo')
-                       ->willReturn(array($storage, 'foo'));
+                       ->willReturn([$storage, 'foo']);
 
 
                $node = $this->createTestNode($this->root, $this->view, '/bar/foo');
@@ -349,7 +349,7 @@ abstract class NodeTest extends \Test\TestCase {
                $this->view->expects($this->once())
                        ->method('resolvePath')
                        ->with('/bar/foo')
-                       ->willReturn(array($storage, 'foo'));
+                       ->willReturn([$storage, 'foo']);
 
 
                $node = $this->createTestNode($this->root, $this->view, '/bar/foo');
@@ -378,7 +378,7 @@ abstract class NodeTest extends \Test\TestCase {
                $this->view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $node = $this->createTestNode($this->root, $this->view, '/bar/foo');
                $node->touch(100);
@@ -425,12 +425,12 @@ abstract class NodeTest extends \Test\TestCase {
                $this->view->expects($this->any())
                        ->method('resolvePath')
                        ->with('/bar/foo')
-                       ->willReturn(array(null, 'foo'));
+                       ->willReturn([null, 'foo']);
 
                $this->view->expects($this->any())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
 
                $node = $this->createTestNode($root, $this->view, '/bar/foo');
                $node->touch(100);
@@ -448,7 +448,7 @@ abstract class NodeTest extends \Test\TestCase {
                $this->view->expects($this->any())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+                       ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
 
                $node = $this->createTestNode($this->root, $this->view, '/bar/foo');
                $node->touch(100);
index 6c4189bdec7c93477c0d57823171524159c9524b..c78bef07627ed4320be91636e953d95bab1d456c 100644 (file)
@@ -79,7 +79,7 @@ class RootTest extends \Test\TestCase {
                $view->expects($this->once())
                        ->method('getFileInfo')
                        ->with('/bar/foo')
-                       ->willReturn($this->getFileInfo(array('fileid' => 10, 'path' => 'bar/foo', 'name', 'mimetype' => 'text/plain')));
+                       ->willReturn($this->getFileInfo(['fileid' => 10, 'path' => 'bar/foo', 'name', 'mimetype' => 'text/plain']));
 
                $root->mount($storage, '');
                $node = $root->get('/bar/foo');
index 8b879e8ab371e0a8eba7a0cd801e7b616e83f427..570fc16ee98956c621bae5aba2eacbfaa1cf847c 100644 (file)
@@ -22,7 +22,7 @@ class NoopScannerTest extends \Test\TestCase {
        protected function setUp(): void {
                parent::setUp();
 
-               $this->storage = new \OC\Files\Storage\Temporary(array());
+               $this->storage = new \OC\Files\Storage\Temporary([]);
                $this->scanner = new \OC\Files\ObjectStore\NoopScanner($this->storage);
        }
 
index 91b24d8b6150fc0f61dcfe62857a1b6680fd2477..b56978f4fee83ccadb26c34a1bbb8df1dd69233b 100644 (file)
@@ -34,11 +34,11 @@ class MultiPartUploadS3 extends S3 {
 
 class NonSeekableStream extends Wrapper {
        public static function wrap($source) {
-               $context = stream_context_create(array(
-                       'nonseek' => array(
+               $context = stream_context_create([
+                       'nonseek' => [
                                'source' => $source
-                       )
-               ));
+                       ]
+               ]);
                return Wrapper::wrapSource($source, $context, 'nonseek', self::class);
        }
 
index 6075e9af2934cb299951b058547cf9e1eb1feeb3..d5feb40840fcfe168a8905919d4b81f99deec147 100644 (file)
@@ -73,7 +73,7 @@ class HomeTest extends Storage {
                $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
                $this->userId = $this->getUniqueID('user_');
                $this->user = new DummyUser($this->userId, $this->tmpDir);
-               $this->instance = new \OC\Files\Storage\Home(array('user' => $this->user));
+               $this->instance = new \OC\Files\Storage\Home(['user' => $this->user]);
        }
 
        protected function tearDown(): void {
index 23738a25c2a331050083e9bcf058d2bd72ed27ef..467848112488c1e1e0c5fffcef5d313e4cb65611 100644 (file)
@@ -39,7 +39,7 @@ class LocalTest extends Storage {
                parent::setUp();
 
                $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
-               $this->instance = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
+               $this->instance = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
        }
 
        protected function tearDown(): void {
index a25a3f74f9e435675fd1b841f682b7dcbcbd16cc..736cbfff4f0c4512b273f30879e0d18e2e101bea 100644 (file)
@@ -80,13 +80,13 @@ abstract class Storage extends \Test\TestCase {
                $this->assertTrue($this->instance->isUpdatable('/' . $directory));
 
                $dh = $this->instance->opendir('/');
-               $content = array();
+               $content = [];
                while ($file = readdir($dh)) {
                        if ($file != '.' and $file != '..') {
                                $content[] = $file;
                        }
                }
-               $this->assertEquals(array($directory), $content);
+               $this->assertEquals([$directory], $content);
 
                $this->assertFalse($this->instance->mkdir('/' . $directory)); //can't create existing folders
                $this->assertTrue($this->instance->rmdir('/' . $directory));
@@ -97,13 +97,13 @@ abstract class Storage extends \Test\TestCase {
                $this->assertFalse($this->instance->rmdir('/' . $directory)); //can't remove non existing folders
 
                $dh = $this->instance->opendir('/');
-               $content = array();
+               $content = [];
                while ($file = readdir($dh)) {
                        if ($file != '.' and $file != '..') {
                                $content[] = $file;
                        }
                }
-               $this->assertEquals(array(), $content);
+               $this->assertEquals([], $content);
        }
 
        public function fileNameProvider() {
@@ -130,12 +130,12 @@ abstract class Storage extends \Test\TestCase {
 
        function loremFileProvider() {
                $root = \OC::$SERVERROOT . '/tests/data/';
-               return array(
+               return [
                        // small file
-                       array($root . 'lorem.txt'),
+                       [$root . 'lorem.txt'],
                        // bigger file (> 8 KB which is the standard PHP block size)
-                       array($root . 'lorem-big.txt')
-               );
+                       [$root . 'lorem-big.txt']
+               ];
        }
 
        /**
@@ -413,11 +413,11 @@ abstract class Storage extends \Test\TestCase {
        }
 
        public function hashProvider() {
-               return array(
-                       array('Foobar', 'md5'),
-                       array('Foobar', 'sha1'),
-                       array('Foobar', 'sha256'),
-               );
+               return [
+                       ['Foobar', 'md5'],
+                       ['Foobar', 'sha1'],
+                       ['Foobar', 'sha256'],
+               ];
        }
 
        /**
@@ -438,14 +438,14 @@ abstract class Storage extends \Test\TestCase {
                $this->assertEquals('data', $this->instance->file_get_contents('#foo/test.txt'));
 
                $dh = $this->instance->opendir('#foo');
-               $content = array();
+               $content = [];
                while ($file = readdir($dh)) {
                        if ($file != '.' and $file != '..') {
                                $content[] = $file;
                        }
                }
 
-               $this->assertEquals(array('test.txt'), $content);
+               $this->assertEquals(['test.txt'], $content);
        }
 
        public function testCopyOverWriteFile() {
index a9d678e76e998f7bbea1c95a975e0a82ec5b667b..ac3880309c097d3e4e77d2ce0e09d32fb371711d 100644 (file)
@@ -148,7 +148,7 @@ class EncryptionTest extends Storage {
 
                $this->logger = $this->createMock(Log::class);
 
-               $this->sourceStorage = new Temporary(array());
+               $this->sourceStorage = new Temporary([]);
 
                $this->keyStore = $this->getMockBuilder('\OC\Encryption\Keys\Storage')
                        ->disableOriginalConstructor()->getMock();
@@ -458,13 +458,13 @@ class EncryptionTest extends Storage {
         * @return array
         */
        public function dataTestCopyAndRename() {
-               return array(
-                       array('source', 'target', true, false, false),
-                       array('source', 'target', true, true, false),
-                       array('source', '/subFolder/target', true, false, false),
-                       array('source', '/subFolder/target', true, true, true),
-                       array('source', '/subFolder/target', false, true, false),
-               );
+               return [
+                       ['source', 'target', true, false, false],
+                       ['source', 'target', true, true, false],
+                       ['source', '/subFolder/target', true, false, false],
+                       ['source', '/subFolder/target', true, true, true],
+                       ['source', '/subFolder/target', false, true, false],
+               ];
        }
 
        public function testIsLocal() {
@@ -512,16 +512,16 @@ class EncryptionTest extends Storage {
        }
 
        public function dataTestRmdir() {
-               return array(
-                       array('/file.txt', true, true, true),
-                       array('/file.txt', false, true, true),
-                       array('/file.txt', true, false, true),
-                       array('/file.txt', false, false, true),
-                       array('/file.txt', true, true, false),
-                       array('/file.txt', false, true, false),
-                       array('/file.txt', true, false, false),
-                       array('/file.txt', false, false, false),
-               );
+               return [
+                       ['/file.txt', true, true, true],
+                       ['/file.txt', false, true, true],
+                       ['/file.txt', true, false, true],
+                       ['/file.txt', false, false, true],
+                       ['/file.txt', true, true, false],
+                       ['/file.txt', false, true, false],
+                       ['/file.txt', true, false, false],
+                       ['/file.txt', false, false, false],
+               ];
        }
 
        /**
@@ -547,10 +547,10 @@ class EncryptionTest extends Storage {
        }
 
        public function dataTestCopyKeys() {
-               return array(
-                       array(true, false),
-                       array(false, true),
-               );
+               return [
+                       [true, false],
+                       [false, true],
+               ];
        }
 
        /**
@@ -613,13 +613,13 @@ class EncryptionTest extends Storage {
        }
 
        public function dataTestGetHeader() {
-               return array(
-                       array('/foo/bar.txt', false, '/foo/bar.txt'),
-                       array('/foo/bar.txt.part', false, '/foo/bar.txt'),
-                       array('/foo/bar.txt.ocTransferId7437493.part', false, '/foo/bar.txt'),
-                       array('/foo/bar.txt.part', true, '/foo/bar.txt'),
-                       array('/foo/bar.txt.ocTransferId7437493.part', true, '/foo/bar.txt'),
-               );
+               return [
+                       ['/foo/bar.txt', false, '/foo/bar.txt'],
+                       ['/foo/bar.txt.part', false, '/foo/bar.txt'],
+                       ['/foo/bar.txt.ocTransferId7437493.part', false, '/foo/bar.txt'],
+                       ['/foo/bar.txt.part', true, '/foo/bar.txt'],
+                       ['/foo/bar.txt.ocTransferId7437493.part', true, '/foo/bar.txt'],
+               ];
        }
 
        /**
index cb7003cb7ea3ad7158dbf547edf88bf5b451402c..6c8905af76561efd29fc3913466d10266a25936b 100644 (file)
@@ -17,24 +17,24 @@ class JailTest extends \Test\Files\Storage\Storage {
 
        protected function setUp(): void {
                parent::setUp();
-               $this->sourceStorage = new \OC\Files\Storage\Temporary(array());
+               $this->sourceStorage = new \OC\Files\Storage\Temporary([]);
                $this->sourceStorage->mkdir('foo');
-               $this->instance = new \OC\Files\Storage\Wrapper\Jail(array(
+               $this->instance = new \OC\Files\Storage\Wrapper\Jail([
                        'storage' => $this->sourceStorage,
                        'root' => 'foo'
-               ));
+               ]);
        }
 
        protected function tearDown(): void {
                // test that nothing outside our jail is touched
-               $contents = array();
+               $contents = [];
                $dh = $this->sourceStorage->opendir('');
                while ($file = readdir($dh)) {
                        if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
                                $contents[] = $file;
                        }
                }
-               $this->assertEquals(array('foo'), $contents);
+               $this->assertEquals(['foo'], $contents);
                $this->sourceStorage->cleanUp();
                parent::tearDown();
        }
index bfdd3d3ddbb84dfae144a5d1a06ae21e2d9ca3bb..1e69ee7165efc4946a5c8e19c3a66c62f3852e81 100644 (file)
@@ -24,7 +24,7 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
 
        protected function setUp(): void {
                parent::setUp();
-               $this->sourceStorage = new \OC\Files\Storage\Temporary(array());
+               $this->sourceStorage = new \OC\Files\Storage\Temporary([]);
                $this->instance = $this->getMaskedStorage(Constants::PERMISSION_ALL);
        }
 
@@ -34,10 +34,10 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
        }
 
        protected function getMaskedStorage($mask) {
-               return new \OC\Files\Storage\Wrapper\PermissionsMask(array(
+               return new \OC\Files\Storage\Wrapper\PermissionsMask([
                        'storage' => $this->sourceStorage,
                        'mask' => $mask
-               ));
+               ]);
        }
 
        public function testMkdirNoCreate() {
@@ -129,10 +129,10 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
 
        public function testScanNewFilesNested() {
                $storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE + Constants::PERMISSION_UPDATE);
-               $nestedStorage = new \OC\Files\Storage\Wrapper\PermissionsMask(array(
+               $nestedStorage = new \OC\Files\Storage\Wrapper\PermissionsMask([
                        'storage' => $storage,
                        'mask' => Constants::PERMISSION_READ + Constants::PERMISSION_CREATE
-               ));
+               ]);
                $wrappedStorage = new Wrapper(['storage' => $nestedStorage]);
                $wrappedStorage->file_put_contents('foo', 'bar');
                $wrappedStorage->getScanner()->scan('');
index 164541b670cb079162ab7606a94b7836ffaddd8d..65cfe30eb1c58fdf584733c379ac30ddcaf5ab56 100644 (file)
@@ -31,8 +31,8 @@ class QuotaTest extends \Test\Files\Storage\Storage {
                parent::setUp();
 
                $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
-               $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
-               $this->instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 10000000));
+               $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
+               $this->instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 10000000]);
        }
 
        protected function tearDown(): void {
@@ -44,10 +44,10 @@ class QuotaTest extends \Test\Files\Storage\Storage {
         * @param integer $limit
         */
        protected function getLimitedStorage($limit) {
-               $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
+               $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
                $storage->mkdir('files');
                $storage->getScanner()->scan('');
-               return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $limit));
+               return new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => $limit]);
        }
 
        public function testFilePutContentsNotEnoughSpace() {
@@ -70,7 +70,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
        public function testFreeSpaceWithUsedSpace() {
                $instance = $this->getLimitedStorage(9);
                $instance->getCache()->put(
-                       '', array('size' => 3)
+                       '', ['size' => 3]
                );
                $this->assertEquals(6, $instance->free_space(''));
        }
@@ -85,9 +85,9 @@ class QuotaTest extends \Test\Files\Storage\Storage {
                        ->willReturn(-2);
                $storage->getScanner()->scan('');
 
-               $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 9));
+               $instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 9]);
                $instance->getCache()->put(
-                       '', array('size' => 3)
+                       '', ['size' => 3]
                );
                $this->assertEquals(6, $instance->free_space(''));
        }
@@ -95,7 +95,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
        public function testFreeSpaceWithUsedSpaceAndEncryption() {
                $instance = $this->getLimitedStorage(9);
                $instance->getCache()->put(
-                       '', array('size' => 7)
+                       '', ['size' => 7]
                );
                $this->assertEquals(2, $instance->free_space(''));
        }
@@ -140,7 +140,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
                        ->method('fopen')
                        ->willReturn(false);
 
-               $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $failStorage, 'quota' => 1000));
+               $instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $failStorage, 'quota' => 1000]);
 
                $this->assertFalse($instance->fopen('failedfopen', 'r'));
        }
@@ -198,7 +198,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
                        ->with('files')
                        ->willReturn(new CacheEntry(['size' => 50]));
 
-               $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 1024, 'root' => 'files'));
+               $instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 1024, 'root' => 'files']);
 
                $this->assertEquals(1024 - 50, $instance->free_space(''));
        }
index 2477b361bc11782193e682e24d8778859760818e..b9bb54e09b2dbdc7d37555083c31e2660b71bfd0 100644 (file)
@@ -18,8 +18,8 @@ class WrapperTest extends \Test\Files\Storage\Storage {
                parent::setUp();
 
                $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
-               $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
-               $this->instance = new \OC\Files\Storage\Wrapper\Wrapper(array('storage' => $storage));
+               $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
+               $this->instance = new \OC\Files\Storage\Wrapper\Wrapper(['storage' => $storage]);
        }
 
        protected function tearDown(): void {
index e55dae98cb671e5d2c5f4bac379c72b2a9b20317..43114ff70f3abdc5263a173ed7efbfc9c719d8af 100644 (file)
@@ -101,7 +101,7 @@ class EncryptionTest extends \Test\TestCase {
                        $fileMock->expects($this->once())->method('getAccessList')
                                ->willReturnCallback(function ($sharePath) use ($expectedSharePath) {
                                        $this->assertSame($expectedSharePath, $sharePath);
-                                       return array();
+                                       return [];
                                });
                }
                $utilMock = $this->getMockBuilder('\OC\Encryption\Util')
@@ -138,7 +138,7 @@ class EncryptionTest extends \Test\TestCase {
                $fullPathP->setAccessible(false);
                $header = $stream->getProperty('header');
                $header->setAccessible(true);
-               $header->setValue($streamWrapper, array());
+               $header->setValue($streamWrapper, []);
                $header->setAccessible(false);
                $this->invokePrivate($streamWrapper, 'signed', [true]);
 
index 9d82e4ae1e1dc819e1d8892a1898d48c072698bb..c5183ac3929e81619667d2dc9bfd214fecb470dc 100644 (file)
@@ -21,7 +21,7 @@ class TestScanner extends \OC\Files\Utils\Scanner {
        /**
         * @var \OC\Files\Mount\MountPoint[] $mounts
         */
-       private $mounts = array();
+       private $mounts = [];
 
        /**
         * @param \OC\Files\Mount\MountPoint $mount
@@ -63,7 +63,7 @@ class ScannerTest extends \Test\TestCase {
        }
 
        public function testReuseExistingRoot() {
-               $storage = new Temporary(array());
+               $storage = new Temporary([]);
                $mount = new MountPoint($storage, '');
                Filesystem::getMountManager()->addMount($mount);
                $cache = $storage->getCache();
@@ -85,7 +85,7 @@ class ScannerTest extends \Test\TestCase {
        }
 
        public function testReuseExistingFile() {
-               $storage = new Temporary(array());
+               $storage = new Temporary([]);
                $mount = new MountPoint($storage, '');
                Filesystem::getMountManager()->addMount($mount);
                $cache = $storage->getCache();
@@ -112,7 +112,7 @@ class ScannerTest extends \Test\TestCase {
 
                $mountProvider = $this->createMock(IMountProvider::class);
 
-               $storage = new Temporary(array());
+               $storage = new Temporary([]);
                $mount = new MountPoint($storage, '/' . $uid . '/files/foo');
 
                $mountProvider->expects($this->any())
@@ -169,7 +169,7 @@ class ScannerTest extends \Test\TestCase {
        }
 
        public function testPropagateEtag() {
-               $storage = new Temporary(array());
+               $storage = new Temporary([]);
                $mount = new MountPoint($storage, '');
                Filesystem::getMountManager()->addMount($mount);
                $cache = $storage->getCache();
@@ -213,7 +213,7 @@ class ScannerTest extends \Test\TestCase {
        }
 
        public function testShallow() {
-               $storage = new Temporary(array());
+               $storage = new Temporary([]);
                $mount = new MountPoint($storage, '');
                Filesystem::getMountManager()->addMount($mount);
                $cache = $storage->getCache();
index f702d94b2b480813960f449de2bb7e36ce9bc0bd..541ed78719b3d11b893353e9861f2189c494ae4c 100644 (file)
@@ -108,15 +108,15 @@ abstract class Backend extends \Test\TestCase {
 
                $this->assertFalse($this->backend->addToGroup($user1, $group1));
 
-               $this->assertEquals(array($user1), $this->backend->usersInGroup($group1));
-               $this->assertEquals(array(), $this->backend->usersInGroup($group2));
+               $this->assertEquals([$user1], $this->backend->usersInGroup($group1));
+               $this->assertEquals([], $this->backend->usersInGroup($group2));
 
-               $this->assertEquals(array($group1), $this->backend->getUserGroups($user1));
-               $this->assertEquals(array(), $this->backend->getUserGroups($user2));
+               $this->assertEquals([$group1], $this->backend->getUserGroups($user1));
+               $this->assertEquals([], $this->backend->getUserGroups($user2));
 
                $this->backend->deleteGroup($group1);
-               $this->assertEquals(array(), $this->backend->getUserGroups($user1));
-               $this->assertEquals(array(), $this->backend->usersInGroup($group1));
+               $this->assertEquals([], $this->backend->getUserGroups($user1));
+               $this->assertEquals([], $this->backend->usersInGroup($group1));
                $this->assertFalse($this->backend->inGroup($user1, $group1));
        }
 
index 4af8b1cd4308c644ea5a1ccc8afc97a4bb5ba8bf..586d77e0ec0b5f392d13b80bce6c794f1366315c 100644 (file)
@@ -31,7 +31,7 @@ namespace Test\Group;
  * @group DB
  */
 class DatabaseTest extends Backend {
-       private $groups = array();
+       private $groups = [];
 
        /**
         * get a new unique group name
index 554432a2c865b8352abcb255b6c6c30799e98b4e..fe4421688701970444b13c5c38b557f5d076e65e 100644 (file)
@@ -56,11 +56,11 @@ class GroupTest extends \Test\TestCase {
                $user3 = $this->newUser('user3', $backend);
                $userManager->expects($this->any())
                        ->method('get')
-                       ->willReturnMap(array(
-                               array('user1', $user1),
-                               array('user2', $user2),
-                               array('user3', $user3)
-                       ));
+                       ->willReturnMap([
+                               ['user1', $user1],
+                               ['user2', $user2],
+                               ['user3', $user3]
+                       ]);
                return $userManager;
        }
 
@@ -69,12 +69,12 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1')
-                       ->willReturn(array('user1', 'user2'));
+                       ->willReturn(['user1', 'user2']);
 
                $users = $group->getUsers();
 
@@ -93,17 +93,17 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1')
-                       ->willReturn(array('user1', 'user2'));
+                       ->willReturn(['user1', 'user2']);
 
                $backend2->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1')
-                       ->willReturn(array('user2', 'user3'));
+                       ->willReturn(['user2', 'user3']);
 
                $users = $group->getUsers();
 
@@ -124,7 +124,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder('\OC\User\Backend')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('inGroup')
@@ -145,7 +145,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder(\OC\User\Backend::class)
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('inGroup')
@@ -168,7 +168,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder('\OC\User\Backend')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('inGroup')
@@ -193,7 +193,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder('\OC\User\Backend')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('inGroup')
@@ -217,7 +217,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder('\OC\User\Backend')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('inGroup')
@@ -242,7 +242,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder(\OC\User\Backend::class)
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('inGroup')
@@ -269,7 +269,7 @@ class GroupTest extends \Test\TestCase {
                $userBackend = $this->getMockBuilder('\OC\User\Backend')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('inGroup')
@@ -303,12 +303,12 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1', '2')
-                       ->willReturn(array('user2'));
+                       ->willReturn(['user2']);
 
                $users = $group->searchUsers('2');
 
@@ -325,16 +325,16 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1', '2')
-                       ->willReturn(array('user2'));
+                       ->willReturn(['user2']);
                $backend2->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1', '2')
-                       ->willReturn(array('user2'));
+                       ->willReturn(['user2']);
 
                $users = $group->searchUsers('2');
 
@@ -348,12 +348,12 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1', 'user', 1, 1)
-                       ->willReturn(array('user2'));
+                       ->willReturn(['user2']);
 
                $users = $group->searchUsers('user', 1, 1);
 
@@ -370,16 +370,16 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1', 'user', 2, 1)
-                       ->willReturn(array('user2'));
+                       ->willReturn(['user2']);
                $backend2->expects($this->once())
                        ->method('usersInGroup')
                        ->with('group1', 'user', 2, 1)
-                       ->willReturn(array('user1'));
+                       ->willReturn(['user1']);
 
                $users = $group->searchUsers('user', 2, 1);
 
@@ -395,7 +395,7 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend1), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('countUsersInGroup')
@@ -419,7 +419,7 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
 
                $backend1->expects($this->once())
                        ->method('countUsersInGroup')
@@ -447,7 +447,7 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend1), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend1], $this->dispatcher, $userManager);
 
                $backend1->expects($this->never())
                        ->method('countUsersInGroup');
@@ -465,7 +465,7 @@ class GroupTest extends \Test\TestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
                $userManager = $this->getUserManager();
-               $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+               $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
 
                $backend->expects($this->once())
                        ->method('deleteGroup')
index 8385c924edfffddf60668b42732e76aee10acb0d..73b315ac297b6f27ae94453e6e684776d63cdc6b 100644 (file)
@@ -255,7 +255,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getGroups')
                        ->with('1')
-                       ->willReturn(array('group1'));
+                       ->willReturn(['group1']);
                $backend->expects($this->once())
                        ->method('groupExists')
                        ->with('group1')
@@ -278,7 +278,7 @@ class ManagerTest extends TestCase {
                $backend1->expects($this->once())
                        ->method('getGroups')
                        ->with('1')
-                       ->willReturn(array('group1'));
+                       ->willReturn(['group1']);
                $backend1->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -290,7 +290,7 @@ class ManagerTest extends TestCase {
                $backend2->expects($this->once())
                        ->method('getGroups')
                        ->with('1')
-                       ->willReturn(array('group12', 'group1'));
+                       ->willReturn(['group12', 'group1']);
                $backend2->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -315,7 +315,7 @@ class ManagerTest extends TestCase {
                $backend1->expects($this->once())
                        ->method('getGroups')
                        ->with('1', 2, 1)
-                       ->willReturn(array('group1'));
+                       ->willReturn(['group1']);
                $backend1->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -327,7 +327,7 @@ class ManagerTest extends TestCase {
                $backend2->expects($this->once())
                        ->method('getGroups')
                        ->with('1', 2, 1)
-                       ->willReturn(array('group12'));
+                       ->willReturn(['group12']);
                $backend2->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -374,7 +374,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1'));
+                       ->willReturn(['group1']);
                $backend->expects($this->any())
                        ->method('groupExists')
                        ->with('group1')
@@ -421,7 +421,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1'));
+                       ->willReturn(['group1']);
                $backend->expects($this->any())
                        ->method('groupExists')
                        ->with('group1')
@@ -448,7 +448,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1', 'admin', 'group2'));
+                       ->willReturn(['group1', 'admin', 'group2']);
                $backend->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -467,7 +467,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1', 'admin', 'group2'));
+                       ->willReturn(['group1', 'admin', 'group2']);
                $backend->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -486,7 +486,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1', 'group2'));
+                       ->willReturn(['group1', 'group2']);
                $backend->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -505,7 +505,7 @@ class ManagerTest extends TestCase {
                $backend1->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1'));
+                       ->willReturn(['group1']);
                $backend1->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -517,7 +517,7 @@ class ManagerTest extends TestCase {
                $backend2->expects($this->once())
                        ->method('getUserGroups')
                        ->with('user1')
-                       ->willReturn(array('group1', 'group2'));
+                       ->willReturn(['group1', 'group2']);
                $backend1->expects($this->any())
                        ->method('groupExists')
                        ->willReturn(true);
@@ -730,7 +730,7 @@ class ManagerTest extends TestCase {
                                $backend->expects($this->once())
                        ->method('usersInGroup')
                        ->with('testgroup', '', -1, 0)
-                       ->willReturn(array('user2', 'user33'));
+                       ->willReturn(['user2', 'user33']);
 
                $this->userManager->expects($this->any())
                        ->method('get')
@@ -769,7 +769,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('usersInGroup')
                        ->with('testgroup', '', 1, 0)
-                       ->willReturn(array('user2'));
+                       ->willReturn(['user2']);
 
                $this->userManager->expects($this->any())
                        ->method('get')
@@ -808,7 +808,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('usersInGroup')
                        ->with('testgroup', '', 1, 1)
-                       ->willReturn(array('user33'));
+                       ->willReturn(['user33']);
 
                $this->userManager->expects($this->any())
                        ->method('get')
@@ -857,7 +857,7 @@ class ManagerTest extends TestCase {
                // prime cache
                $user1 = $this->getTestUser('user1');
                $groups = $manager->getUserGroups($user1);
-               $this->assertEquals(array(), $groups);
+               $this->assertEquals([], $groups);
 
                // add user
                $group = $manager->get('group1');
@@ -907,7 +907,7 @@ class ManagerTest extends TestCase {
                // remove user
                $group = $manager->get('group1');
                $group->removeUser($user1);
-               $expectedGroups = array();
+               $expectedGroups = [];
 
                // check result
                $groups = $manager->getUserGroups($user1);
index 29250109d02209aa56e740acc5bf9bcec1d200fe..606a527f5c9b8acda1be6f7c757754b3ecfef7e5 100644 (file)
@@ -46,7 +46,7 @@ class HelperStorageTest extends \Test\TestCase {
                        $this->storageMock = null;
                }
                \OC\Files\Filesystem::tearDown();
-               \OC\Files\Filesystem::mount($this->storage, array(), '/');
+               \OC\Files\Filesystem::mount($this->storage, [], '/');
 
                \OC_User::setUserId('');
                $user = \OC::$server->getUserManager()->get($this->user);
@@ -80,7 +80,7 @@ class HelperStorageTest extends \Test\TestCase {
         */
        function testGetStorageInfo() {
                $homeStorage = $this->getStorageMock(12);
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
                $homeStorage->file_put_contents('test.txt', '01234');
 
                $storageInfo = \OC_Helper::getStorageInfo('');
@@ -94,14 +94,14 @@ class HelperStorageTest extends \Test\TestCase {
         */
        function testGetStorageInfoExcludingExtStorage() {
                $homeStorage = $this->getStorageMock(12);
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
                $homeStorage->file_put_contents('test.txt', '01234');
 
-               $extStorage = new \OC\Files\Storage\Temporary(array());
+               $extStorage = new \OC\Files\Storage\Temporary([]);
                $extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
                $extStorage->getScanner()->scan(''); // update root size
 
-               \OC\Files\Filesystem::mount($extStorage, array(), '/' . $this->user . '/files/ext');
+               \OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
 
                $storageInfo = \OC_Helper::getStorageInfo('');
                $this->assertEquals(12, $storageInfo['free']);
@@ -113,15 +113,15 @@ class HelperStorageTest extends \Test\TestCase {
         * Test getting the storage info, including extra mount points
         */
        function testGetStorageInfoIncludingExtStorage() {
-               $homeStorage = new \OC\Files\Storage\Temporary(array());
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               $homeStorage = new \OC\Files\Storage\Temporary([]);
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
                $homeStorage->file_put_contents('test.txt', '01234');
 
-               $extStorage = new \OC\Files\Storage\Temporary(array());
+               $extStorage = new \OC\Files\Storage\Temporary([]);
                $extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
                $extStorage->getScanner()->scan(''); // update root size
 
-               \OC\Files\Filesystem::mount($extStorage, array(), '/' . $this->user . '/files/ext');
+               \OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
 
                $config = \OC::$server->getConfig();
                $oldConfig = $config->getSystemValue('quota_include_external_storage', false);
@@ -145,14 +145,14 @@ class HelperStorageTest extends \Test\TestCase {
         */
        function testGetStorageInfoIncludingExtStorageWithNoUserQuota() {
                $homeStorage = $this->getStorageMock(12);
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
                $homeStorage->file_put_contents('test.txt', '01234');
 
-               $extStorage = new \OC\Files\Storage\Temporary(array());
+               $extStorage = new \OC\Files\Storage\Temporary([]);
                $extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
                $extStorage->getScanner()->scan(''); // update root size
 
-               \OC\Files\Filesystem::mount($extStorage, array(), '/' . $this->user . '/files/ext');
+               \OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
 
                $config = \OC::$server->getConfig();
                $oldConfig = $config->getSystemValue('quota_include_external_storage', false);
@@ -174,12 +174,12 @@ class HelperStorageTest extends \Test\TestCase {
                $homeStorage = $this->getStorageMock(12);
                $homeStorage->file_put_contents('test.txt', '01234');
                $homeStorage = new \OC\Files\Storage\Wrapper\Quota(
-                       array(
+                       [
                                'storage' => $homeStorage,
                                'quota' => 7
-                       )
+                       ]
                );
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
 
                $storageInfo = \OC_Helper::getStorageInfo('');
                $this->assertEquals(2, $storageInfo['free']);
@@ -194,12 +194,12 @@ class HelperStorageTest extends \Test\TestCase {
                $homeStorage = $this->getStorageMock(12);
                $homeStorage->file_put_contents('test.txt', '0123456789');
                $homeStorage = new \OC\Files\Storage\Wrapper\Quota(
-                       array(
+                       [
                                'storage' => $homeStorage,
                                'quota' => 7
-                       )
+                       ]
                );
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
 
                $storageInfo = \OC_Helper::getStorageInfo('');
                $this->assertEquals(0, $storageInfo['free']);
@@ -216,12 +216,12 @@ class HelperStorageTest extends \Test\TestCase {
                $homeStorage = $this->getStorageMock(12);
                $homeStorage->file_put_contents('test.txt', '01234');
                $homeStorage = new \OC\Files\Storage\Wrapper\Quota(
-                       array(
+                       [
                                'storage' => $homeStorage,
                                'quota' => 18
-                       )
+                       ]
                );
-               \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+               \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
 
                $storageInfo = \OC_Helper::getStorageInfo('');
                $this->assertEquals(12, $storageInfo['free']);
index f1cce831477b86e9d1d0716340ad9f9c145b8016..5e040724d90f6307149c7a4a1596240f0a124ed3 100644 (file)
@@ -62,45 +62,45 @@ class HookHelper {
        }
 
        public static function createCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_create,
                        'params' => $params
-               );
+               ];
        }
 
        public static function updateCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_update,
                        'params' => $params
-               );
+               ];
        }
 
        public static function writeCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_write,
                        'params' => $params
-               );
+               ];
        }
 
        public static function postCreateCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_post_create,
                        'params' => $params
-               );
+               ];
        }
 
        public static function postUpdateCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_post_update,
                        'params' => $params
-               );
+               ];
        }
 
        public static function postWriteCallback($params) {
-               self::$hookCalls[] = array(
+               self::$hookCalls[] = [
                        'signal' => Filesystem::signal_post_write,
                        'params' => $params
-               );
+               ];
        }
 
        /**
index 1f88dee103250ffad4dc638bb969bb1b68dea41f..01ae4d4f28b03a8e3af8bdccc034c120410a5e08 100644 (file)
@@ -16,7 +16,7 @@ namespace Test\Hooks;
  * @package Test\Hooks
  */
 class DummyEmitter extends \OC\Hooks\BasicEmitter {
-       public function emitEvent($scope, $method, $arguments = array()) {
+       public function emitEvent($scope, $method, $arguments = []) {
                $this->emit($scope, $method, $arguments);
        }
 }
@@ -64,7 +64,7 @@ class BasicEmitterTest extends \Test\TestCase {
        public function testStaticCallback() {
                $this->expectException(\Test\Hooks\EmittedException::class);
 
-               $this->emitter->listen('Test', 'test', array('\Test\Hooks\BasicEmitterTest', 'staticCallBack'));
+               $this->emitter->listen('Test', 'test', ['\Test\Hooks\BasicEmitterTest', 'staticCallBack']);
                $this->emitter->emitEvent('Test', 'test');
        }
 
@@ -72,7 +72,7 @@ class BasicEmitterTest extends \Test\TestCase {
        public function testNonStaticCallback() {
                $this->expectException(\Test\Hooks\EmittedException::class);
 
-               $this->emitter->listen('Test', 'test', array($this, 'nonStaticCallBack'));
+               $this->emitter->listen('Test', 'test', [$this, 'nonStaticCallBack']);
                $this->emitter->emitEvent('Test', 'test');
        }
 
@@ -134,7 +134,7 @@ class BasicEmitterTest extends \Test\TestCase {
                                throw new EmittedException;
                        }
                });
-               $this->emitter->emitEvent('Test', 'test', array('foo', 'bar'));
+               $this->emitter->emitEvent('Test', 'test', ['foo', 'bar']);
        }
 
        
@@ -146,7 +146,7 @@ class BasicEmitterTest extends \Test\TestCase {
                                throw new EmittedException;
                        }
                });
-               $this->emitter->emitEvent('Test', 'test', array('foo' => 'foo', 'bar' => 'bar'));
+               $this->emitter->emitEvent('Test', 'test', ['foo' => 'foo', 'bar' => 'bar']);
        }
 
        public function testRemoveAllSpecified() {
index ea8ee5c412130817c8a9af5c33847fbb51d792b6..9b0a51d1bd48c063b1b8536a28d4490ed966ab1d 100644 (file)
@@ -10,7 +10,7 @@ namespace Test\Hooks;
 use OC\Hooks\PublicEmitter;
 
 class DummyForwardingEmitter extends \OC\Hooks\ForwardingEmitter {
-       public function emitEvent($scope, $method, $arguments = array()) {
+       public function emitEvent($scope, $method, $arguments = []) {
                $this->emit($scope, $method, $arguments);
        }
 
index 32c923d8013a491db3395c1efba3ec5fd5bbaaff..3b9eb26ec504be3df7d387c7114eb2627cc5ed3d 100644 (file)
@@ -16,7 +16,7 @@ namespace Test\Hooks;
  * @package Test\Hooks
  */
 class DummyLegacyEmitter extends \OC\Hooks\LegacyEmitter {
-       public function emitEvent($scope, $method, $arguments = array()) {
+       public function emitEvent($scope, $method, $arguments = []) {
                $this->emit($scope, $method, $arguments);
        }
 }
@@ -51,7 +51,7 @@ class LegacyEmitterTest extends BasicEmitterTest {
 
        public function testLegacyArguments() {
                \OC_Hook::connect('Test', 'test', '\Test\Hooks\LegacyEmitterTest', 'staticLegacyArgumentsCallBack');
-               $this->emitter->emitEvent('Test', 'test', array('foo' => 'foo', 'bar' => 'bar'));
+               $this->emitter->emitEvent('Test', 'test', ['foo' => 'foo', 'bar' => 'bar']);
                $this->assertEquals(true, self::$emitted);
        }
 }
index 34fcf0e004dc734b1389978e92f818f869536b7c..3858945d19178d22afe65f716c8998ff7f762eb8 100644 (file)
@@ -345,11 +345,11 @@ class ImageTest extends \Test\TestCase {
        }
 
        function convertDataProvider() {
-               return array(
-                       array( 'image/gif'),
-                       array( 'image/jpeg'),
-                       array( 'image/png'),
-               );
+               return [
+                       [ 'image/gif'],
+                       [ 'image/jpeg'],
+                       [ 'image/png'],
+               ];
        }
 
        /**
index 22b026eaae5246f6b49177a9b360b43b54feff9e..7d99316f479f17d590feeb102509095c79144380 100644 (file)
@@ -780,7 +780,7 @@ class CheckerTest extends TestCase {
                        ->expects($this->once())
                        ->method('getOnlyDefaultAliases')
                        ->willReturn(
-                               array (
+                                [
                                        '_comment' => 'Array of mimetype aliases.',
                                        '_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
                                        '_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
@@ -881,13 +881,13 @@ class CheckerTest extends TestCase {
                                        'text/x-shellscript' => 'text/code',
                                        'web' => 'text/code',
                                        'application/internet-shortcut' => 'link',
-                               ));
+                               ]);
 
                $this->mimeTypeDetector
                        ->expects($this->once())
                        ->method('getAllAliases')
                        ->willReturn(
-                               array (
+                                [
                                        '_comment' => 'Array of mimetype aliases.',
                                        '_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
                                        '_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
@@ -989,7 +989,7 @@ class CheckerTest extends TestCase {
                                        'text/x-shellscript' => 'text/code',
                                        'web' => 'text/code',
                                        'application/internet-shortcut' => 'link',
-                               ));
+                               ]);
 
                $this->environmentHelper
                        ->expects($this->any())
index dd0fa000b7e3b9e75a8d04abc3dca5f8b83ccd3b..b2e7d5ebfc955acc61c7e49c5726c3224c3e469f 100644 (file)
@@ -78,39 +78,39 @@ class L10nTest extends TestCase {
        }
 
        public function localizationData() {
-               return array(
+               return [
                        // timestamp as string
-                       array('February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', '1234567890'),
-                       array('13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', '1234567890'),
-                       array('February 13, 2009', 'en', 'en_US', 'date', '1234567890'),
-                       array('13. Februar 2009', 'de', 'de_DE', 'date', '1234567890'),
-                       array('11:31:30 PM GMT+0', 'en', 'en_US', 'time', '1234567890'),
-                       array('23:31:30 GMT+0', 'de', 'de_DE', 'time', '1234567890'),
+                       ['February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', '1234567890'],
+                       ['13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', '1234567890'],
+                       ['February 13, 2009', 'en', 'en_US', 'date', '1234567890'],
+                       ['13. Februar 2009', 'de', 'de_DE', 'date', '1234567890'],
+                       ['11:31:30 PM GMT+0', 'en', 'en_US', 'time', '1234567890'],
+                       ['23:31:30 GMT+0', 'de', 'de_DE', 'time', '1234567890'],
 
                        // timestamp as int
-                       array('February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', 1234567890),
-                       array('13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', 1234567890),
-                       array('February 13, 2009', 'en', 'en_US', 'date', 1234567890),
-                       array('13. Februar 2009', 'de', 'de_DE', 'date', 1234567890),
-                       array('11:31:30 PM GMT+0', 'en', 'en_US', 'time', 1234567890),
-                       array('23:31:30 GMT+0', 'de', 'de_DE', 'time', 1234567890),
+                       ['February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', 1234567890],
+                       ['13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', 1234567890],
+                       ['February 13, 2009', 'en', 'en_US', 'date', 1234567890],
+                       ['13. Februar 2009', 'de', 'de_DE', 'date', 1234567890],
+                       ['11:31:30 PM GMT+0', 'en', 'en_US', 'time', 1234567890],
+                       ['23:31:30 GMT+0', 'de', 'de_DE', 'time', 1234567890],
 
                        // DateTime object
-                       array('February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', new DateTime('@1234567890')),
-                       array('13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', new DateTime('@1234567890')),
-                       array('February 13, 2009', 'en', 'en_US', 'date', new DateTime('@1234567890')),
-                       array('13. Februar 2009', 'de', 'de_DE', 'date', new DateTime('@1234567890')),
-                       array('11:31:30 PM GMT+0', 'en', 'en_US', 'time', new DateTime('@1234567890')),
-                       array('23:31:30 GMT+0', 'de', 'de_DE', 'time', new DateTime('@1234567890')),
+                       ['February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', new DateTime('@1234567890')],
+                       ['13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', new DateTime('@1234567890')],
+                       ['February 13, 2009', 'en', 'en_US', 'date', new DateTime('@1234567890')],
+                       ['13. Februar 2009', 'de', 'de_DE', 'date', new DateTime('@1234567890')],
+                       ['11:31:30 PM GMT+0', 'en', 'en_US', 'time', new DateTime('@1234567890')],
+                       ['23:31:30 GMT+0', 'de', 'de_DE', 'time', new DateTime('@1234567890')],
 
                        // en_GB
-                       array('13 February 2009 at 23:31:30 GMT+0', 'en_GB', 'en_GB', 'datetime', new DateTime('@1234567890')),
-                       array('13 February 2009', 'en_GB', 'en_GB', 'date', new DateTime('@1234567890')),
-                       array('23:31:30 GMT+0', 'en_GB', 'en_GB', 'time', new DateTime('@1234567890')),
-                       array('13 February 2009 at 23:31:30 GMT+0', 'en-GB', 'en_GB', 'datetime', new DateTime('@1234567890')),
-                       array('13 February 2009', 'en-GB', 'en_GB', 'date', new DateTime('@1234567890')),
-                       array('23:31:30 GMT+0', 'en-GB', 'en_GB', 'time', new DateTime('@1234567890')),
-               );
+                       ['13 February 2009 at 23:31:30 GMT+0', 'en_GB', 'en_GB', 'datetime', new DateTime('@1234567890')],
+                       ['13 February 2009', 'en_GB', 'en_GB', 'date', new DateTime('@1234567890')],
+                       ['23:31:30 GMT+0', 'en_GB', 'en_GB', 'time', new DateTime('@1234567890')],
+                       ['13 February 2009 at 23:31:30 GMT+0', 'en-GB', 'en_GB', 'datetime', new DateTime('@1234567890')],
+                       ['13 February 2009', 'en-GB', 'en_GB', 'date', new DateTime('@1234567890')],
+                       ['23:31:30 GMT+0', 'en-GB', 'en_GB', 'time', new DateTime('@1234567890')],
+               ];
        }
 
        /**
@@ -122,10 +122,10 @@ class L10nTest extends TestCase {
        }
 
        public function firstDayData() {
-               return array(
-                       array(1, 'de', 'de_DE'),
-                       array(0, 'en', 'en_US'),
-               );
+               return [
+                       [1, 'de', 'de_DE'],
+                       [0, 'en', 'en_US'],
+               ];
        }
 
        /**
@@ -140,10 +140,10 @@ class L10nTest extends TestCase {
        }
 
        public function jsDateData() {
-               return array(
-                       array('dd.MM.yy', 'de', 'de_DE'),
-                       array('M/d/yy', 'en', 'en_US'),
-               );
+               return [
+                       ['dd.MM.yy', 'de', 'de_DE'],
+                       ['M/d/yy', 'en', 'en_US'],
+               ];
        }
 
        /**
index e023819a08893fd0d7f267a558991b4e16bc84cf..f6e85ea188c6b31b43a7815d5fb7ba1e71049131 100644 (file)
@@ -35,15 +35,15 @@ class LegacyHelperTest extends \Test\TestCase {
 
        public function humanFileSizeProvider()
        {
-               return array(
-                       array('0 B', 0),
-                       array('1 KB', 1024),
-                       array('9.5 MB', 10000000),
-                       array('1.3 GB', 1395864371),
-                       array('465.7 GB', 500000000000),
-                       array('454.7 TB', 500000000000000),
-                       array('444.1 PB', 500000000000000000),
-               );
+               return [
+                       ['0 B', 0],
+                       ['1 KB', 1024],
+                       ['9.5 MB', 10000000],
+                       ['1.3 GB', 1395864371],
+                       ['465.7 GB', 500000000000],
+                       ['454.7 TB', 500000000000000],
+                       ['444.1 PB', 500000000000000000],
+               ];
        }
 
        /**
@@ -66,36 +66,36 @@ class LegacyHelperTest extends \Test\TestCase {
        }
 
        function testMb_array_change_key_case() {
-               $arrayStart = array(
+               $arrayStart = [
                        "Foo" => "bar",
                        "Bar" => "foo",
-                       );
-               $arrayResult = array(
+                       ];
+               $arrayResult = [
                        "foo" => "bar",
                        "bar" => "foo",
-                       );
+                       ];
                $result = OC_Helper::mb_array_change_key_case($arrayStart);
                $expected = $arrayResult;
                $this->assertEquals($result, $expected);
 
-               $arrayStart = array(
+               $arrayStart = [
                        "foo" => "bar",
                        "bar" => "foo",
-                       );
-               $arrayResult = array(
+                       ];
+               $arrayResult = [
                        "FOO" => "bar",
                        "BAR" => "foo",
-                       );
+                       ];
                $result = OC_Helper::mb_array_change_key_case($arrayStart, MB_CASE_UPPER);
                $expected = $arrayResult;
                $this->assertEquals($result, $expected);
        }
 
        function testRecursiveArraySearch() {
-               $haystack = array(
+               $haystack = [
                        "Foo" => "own",
                        "Bar" => "Cloud",
-                       );
+                       ];
 
                $result = OC_Helper::recursiveArraySearch($haystack, "own");
                $expected = "Foo";
@@ -192,12 +192,12 @@ class LegacyHelperTest extends \Test\TestCase {
 
 
        function streamCopyDataProvider() {
-               return array(
-                       array(0, false, false, false),
-                       array(0, false, \OC::$SERVERROOT . '/tests/data/lorem.txt', false),
-                       array(filesize(\OC::$SERVERROOT . '/tests/data/lorem.txt'), true, \OC::$SERVERROOT . '/tests/data/lorem.txt', \OC::$SERVERROOT . '/tests/data/lorem-copy.txt'),
-                       array(3670, true, \OC::$SERVERROOT . '/tests/data/testimage.png', \OC::$SERVERROOT . '/tests/data/testimage-copy.png'),
-               );
+               return [
+                       [0, false, false, false],
+                       [0, false, \OC::$SERVERROOT . '/tests/data/lorem.txt', false],
+                       [filesize(\OC::$SERVERROOT . '/tests/data/lorem.txt'), true, \OC::$SERVERROOT . '/tests/data/lorem.txt', \OC::$SERVERROOT . '/tests/data/lorem-copy.txt'],
+                       [3670, true, \OC::$SERVERROOT . '/tests/data/testimage.png', \OC::$SERVERROOT . '/tests/data/testimage-copy.png'],
+               ];
        }
 
        /**
@@ -234,7 +234,7 @@ class LegacyHelperTest extends \Test\TestCase {
         * @return mixed
         * @deprecated Please extend \Test\TestCase and use self::invokePrivate() then
         */
-       public static function invokePrivate($object, $methodName, array $parameters = array()) {
+       public static function invokePrivate($object, $methodName, array $parameters = []) {
                return parent::invokePrivate($object, $methodName, $parameters);
        }
 }
index fa4e481ac489cfdf8963a8e3d85f06eac5aa2d58..fd695c8c68ddce4583ca6e53c3bfae2f5b086c9d 100644 (file)
@@ -37,9 +37,9 @@ class LoggerTest extends TestCase implements IWriter {
 
        public function testInterpolation() {
                $logger = $this->logger;
-               $logger->warning('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
+               $logger->warning('{Message {nothing} {user} {foo.bar} a}', ['user' => 'Bob', 'foo.bar' => 'Bar']);
 
-               $expected = array('2 {Message {nothing} Bob Bar a}');
+               $expected = ['2 {Message {nothing} Bob Bar a}'];
                $this->assertEquals($expected, $this->getLogs());
        }
 
index 19ab04fd524b2c7efa70f8b83658e61c30a3db98..173d9414cdabd975bdb004ea679165e58759ad0a 100644 (file)
@@ -23,22 +23,22 @@ class MessageTest extends TestCase {
         * @return array
         */
        public function mailAddressProvider() {
-               return array(
-                       array(array('lukas@owncloud.com' => 'Lukas Reschke'), array('lukas@owncloud.com' => 'Lukas Reschke')),
-                       array(array('lukas@owncloud.com' => 'Lukas Reschke', 'lukas@öwnclöüd.com', 'lukäs@owncloud.örg' => 'Lükäs Réschke'),
-                               array('lukas@owncloud.com' => 'Lukas Reschke', 'lukas@xn--wncld-iuae2c.com', 'lukäs@owncloud.xn--rg-eka' => 'Lükäs Réschke')),
-                       array(array('lukas@öwnclöüd.com'), array('lukas@xn--wncld-iuae2c.com')),
-               );
+               return [
+                       [['lukas@owncloud.com' => 'Lukas Reschke'], ['lukas@owncloud.com' => 'Lukas Reschke']],
+                       [['lukas@owncloud.com' => 'Lukas Reschke', 'lukas@öwnclöüd.com', 'lukäs@owncloud.örg' => 'Lükäs Réschke'],
+                               ['lukas@owncloud.com' => 'Lukas Reschke', 'lukas@xn--wncld-iuae2c.com', 'lukäs@owncloud.xn--rg-eka' => 'Lükäs Réschke']],
+                       [['lukas@öwnclöüd.com'], ['lukas@xn--wncld-iuae2c.com']],
+               ];
        }
 
        /**
         * @return array
         */
        public function getMailAddressProvider() {
-               return array(
-                       array(null, array()),
-                       array(array('lukas@owncloud.com' => 'Lukas Reschke'), array('lukas@owncloud.com' => 'Lukas Reschke')),
-               );
+               return [
+                       [null, []],
+                       [['lukas@owncloud.com' => 'Lukas Reschke'], ['lukas@owncloud.com' => 'Lukas Reschke']],
+               ];
        }
 
        protected function setUp(): void {
@@ -58,15 +58,15 @@ class MessageTest extends TestCase {
         * @param string $expected
         */
        public function testConvertAddresses($unconverted, $expected) {
-               $this->assertSame($expected, self::invokePrivate($this->message, 'convertAddresses', array($unconverted)));
+               $this->assertSame($expected, self::invokePrivate($this->message, 'convertAddresses', [$unconverted]));
        }
 
        public function testSetFrom() {
                $this->swiftMessage
                        ->expects($this->once())
                        ->method('setFrom')
-                       ->with(array('lukas@owncloud.com'));
-               $this->message->setFrom(array('lukas@owncloud.com'));
+                       ->with(['lukas@owncloud.com']);
+               $this->message->setFrom(['lukas@owncloud.com']);
        }
 
 
@@ -106,8 +106,8 @@ class MessageTest extends TestCase {
                $this->swiftMessage
                        ->expects($this->once())
                        ->method('setTo')
-                       ->with(array('lukas@owncloud.com'));
-               $this->message->setTo(array('lukas@owncloud.com'));
+                       ->with(['lukas@owncloud.com']);
+               $this->message->setTo(['lukas@owncloud.com']);
        }
 
        /**
@@ -126,8 +126,8 @@ class MessageTest extends TestCase {
                $this->swiftMessage
                        ->expects($this->once())
                        ->method('setCc')
-                       ->with(array('lukas@owncloud.com'));
-               $this->message->setCc(array('lukas@owncloud.com'));
+                       ->with(['lukas@owncloud.com']);
+               $this->message->setCc(['lukas@owncloud.com']);
        }
 
        /**
@@ -146,8 +146,8 @@ class MessageTest extends TestCase {
                $this->swiftMessage
                        ->expects($this->once())
                        ->method('setBcc')
-                       ->with(array('lukas@owncloud.com'));
-               $this->message->setBcc(array('lukas@owncloud.com'));
+                       ->with(['lukas@owncloud.com']);
+               $this->message->setBcc(['lukas@owncloud.com']);
        }
 
        /**
index 50c2d0be9f0ab09a8508384421a8684db6135ee2..1408a64dadd51b422224d12885e588d3d86ce5f5 100644 (file)
@@ -20,7 +20,7 @@ class NaturalSortTest extends \Test\TestCase {
                        return;
                }
                $comparator = \OC\NaturalSort::getInstance();
-               usort($array, array($comparator, 'compare'));
+               usort($array, [$comparator, 'compare']);
                $this->assertEquals($sorted, $array);
        }
 
@@ -30,7 +30,7 @@ class NaturalSortTest extends \Test\TestCase {
        public function testDefaultCollatorCompare($array, $sorted)
        {
                $comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
-               usort($array, array($comparator, 'compare'));
+               usort($array, [$comparator, 'compare']);
                $this->assertEquals($sorted, $array);
        }
 
@@ -41,28 +41,28 @@ class NaturalSortTest extends \Test\TestCase {
         */
        public function naturalSortDataProvider()
        {
-               return array(
+               return [
                        // different casing
-                       array(
+                       [
                                // unsorted
-                               array(
+                               [
                                        'aaa',
                                        'bbb',
                                        'BBB',
                                        'AAA'
-                               ),
+                               ],
                                // sorted
-                               array(
+                               [
                                        'aaa',
                                        'AAA',
                                        'bbb',
                                        'BBB'
-                               )
-                       ),
+                               ]
+                       ],
                        // numbers
-                       array(
+                       [
                                // unsorted
-                               array(
+                               [
                                        '124.txt',
                                        'abc1',
                                        '123.txt',
@@ -85,9 +85,9 @@ class NaturalSortTest extends \Test\TestCase {
                                        'zz',
                                        '15.txt',
                                        '15b.txt',
-                               ),
+                               ],
                                // sorted
-                               array(
+                               [
                                        '15.txt',
                                        '15b.txt',
                                        '123.txt',
@@ -110,12 +110,12 @@ class NaturalSortTest extends \Test\TestCase {
                                        'z',
                                        'za',
                                        'zz',
-                               )
-                       ),
+                               ]
+                       ],
                        // chinese characters
-                       array(
+                       [
                                // unsorted
-                               array(
+                               [
                                        '十.txt',
                                        '一.txt',
                                        '二.txt',
@@ -134,9 +134,9 @@ class NaturalSortTest extends \Test\TestCase {
                                        '莫.txt',
                                        '啊.txt',
                                        '123.txt',
-                               ),
+                               ],
                                // sorted
-                               array(
+                               [
                                        '123.txt',
                                        'abc.txt',
                                        '一.txt',
@@ -155,12 +155,12 @@ class NaturalSortTest extends \Test\TestCase {
                                        '波.txt',
                                        '破.txt',
                                        '莫.txt',
-                               )
-                       ),
+                               ]
+                       ],
                        // with umlauts
-                       array(
+                       [
                                // unsorted
-                               array(
+                               [
                                        'öh.txt',
                                        'Äh.txt',
                                        'oh.txt',
@@ -171,9 +171,9 @@ class NaturalSortTest extends \Test\TestCase {
                                        'uh.txt',
                                        'üh.txt',
                                        'äh.txt',
-                               ),
+                               ],
                                // sorted
-                               array(
+                               [
                                        'ah.txt',
                                        'äh.txt',
                                        'Äh.txt',
@@ -184,9 +184,9 @@ class NaturalSortTest extends \Test\TestCase {
                                        'üh.txt',
                                        'Üh.txt',
                                        'Üh 2.txt',
-                               )
-                       ),
-               );
+                               ]
+                       ],
+               ];
        }
 
        /**
@@ -196,28 +196,28 @@ class NaturalSortTest extends \Test\TestCase {
        */
        public function defaultCollatorDataProvider()
        {
-               return array(
+               return [
                        // different casing
-                       array(
+                       [
                                // unsorted
-                               array(
+                               [
                                        'aaa',
                                        'bbb',
                                        'BBB',
                                        'AAA'
-                               ),
+                               ],
                                // sorted
-                               array(
+                               [
                                        'aaa',
                                        'AAA',
                                        'bbb',
                                        'BBB'
-                               )
-                       ),
+                               ]
+                       ],
                        // numbers
-                       array(
+                       [
                                // unsorted
-                               array(
+                               [
                                        '124.txt',
                                        'abc1',
                                        '123.txt',
@@ -240,9 +240,9 @@ class NaturalSortTest extends \Test\TestCase {
                                        'zz',
                                        '15.txt',
                                        '15b.txt',
-                               ),
+                               ],
                                // sorted
-                               array(
+                               [
                                        '15.txt',
                                        '15b.txt',
                                        '123.txt',
@@ -265,8 +265,8 @@ class NaturalSortTest extends \Test\TestCase {
                                        'z',
                                        'za',
                                        'zz',
-                               )
-                       ),
-               );
+                               ]
+                       ],
+               ];
        }
 }
index c7008179a0dc2147cfcded665dfa38c4e6739799..66b30ca033f2fe93091769dcdcc04b13efa49c9e 100644 (file)
@@ -65,7 +65,7 @@ class RepairSqliteAutoincrementTest extends \Test\TestCase {
        protected function checkAutoincrement() {
                $this->connection->executeUpdate('INSERT INTO ' . $this->tableName . ' ("text") VALUES ("test")');
                $insertId = $this->connection->lastInsertId();
-               $this->connection->executeUpdate('DELETE FROM ' . $this->tableName . ' WHERE "someid" = ?', array($insertId));
+               $this->connection->executeUpdate('DELETE FROM ' . $this->tableName . ' WHERE "someid" = ?', [$insertId]);
 
                // insert again
                $this->connection->executeUpdate('INSERT INTO ' . $this->tableName . ' ("text") VALUES ("test2")');
index bc1671d9178f8b2739b964272bc81b51be8d90d0..00506e5dba7ae6cb6d97b079c989560fb0f7308d 100644 (file)
@@ -64,10 +64,10 @@ class RepairTest extends TestCase {
                $this->repair->run();
 
                $this->assertEquals(
-                       array(
+                       [
                                'step: Test Name',
                                'info: Simulated info',
-                       ),
+                       ],
                        $this->outputArray
                );
        }
@@ -78,10 +78,10 @@ class RepairTest extends TestCase {
                $this->repair->run();
 
                $this->assertEquals(
-                       array(
+                       [
                                'step: Test Name',
                                'warning: Simulated warning',
-                       ),
+                       ],
                        $this->outputArray
                );
        }
@@ -109,9 +109,9 @@ class RepairTest extends TestCase {
                $this->assertTrue($thrown);
                // jump out after exception
                $this->assertEquals(
-                       array(
+                       [
                                'step: Exception Test',
-                       ),
+                       ],
                        $this->outputArray
                );
        }
@@ -122,12 +122,12 @@ class RepairTest extends TestCase {
                $this->repair->run();
 
                $this->assertEquals(
-                       array(
+                       [
                                'step: Test Name',
                                'warning: Simulated warning',
                                'step: Test Name',
                                'info: Simulated info',
-                       ),
+                       ],
                        $this->outputArray
                );
        }
index 136c3160413a12be494bc7add9d8a0940f4d4bc3..f7196373c0002a8076bb57664a027f32ff580fa0 100644 (file)
@@ -79,11 +79,11 @@ class CertificateManagerTest extends \Test\TestCase {
 
        function testListCertificates() {
                // Test empty certificate bundle
-               $this->assertSame(array(), $this->certificateManager->listCertificates());
+               $this->assertSame([], $this->certificateManager->listCertificates());
 
                // Add some certificates
                $this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate');
-               $certificateStore = array();
+               $certificateStore = [];
                $certificateStore[] = new \OC\Security\Certificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate');
                $this->assertEqualsArrays($certificateStore, $this->certificateManager->listCertificates());
 
index a2c8055750b008175447bf032e0bcccba6e7052a..5e079c8018fe19d86efed9822e31701f72c153e9 100644 (file)
@@ -14,11 +14,11 @@ class CryptoTest extends \Test\TestCase {
 
        public function defaultEncryptionProvider()
        {
-               return array(
-                       array('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'),
-                       array(''),
-                       array('我看这本书。 我看這本書')
-               );
+               return [
+                       ['Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'],
+                       [''],
+                       ['我看这本书。 我看這本書']
+               ];
        }
 
        /** @var Crypto */
index 71839115a3cb306f3d473d782af2dfaf37ee9130..6898c1d8b0f520d7cd0fc91f0cf38a6759dd5812 100644 (file)
@@ -13,23 +13,23 @@ use OC\Security\SecureRandom;
 class SecureRandomTest extends \Test\TestCase {
 
        public function stringGenerationProvider() {
-               return array(
-                       array(0, 0),
-                       array(1, 1),
-                       array(128, 128),
-                       array(256, 256),
-                       array(1024, 1024),
-                       array(2048, 2048),
-                       array(64000, 64000),
-               );
+               return [
+                       [0, 0],
+                       [1, 1],
+                       [128, 128],
+                       [256, 256],
+                       [1024, 1024],
+                       [2048, 2048],
+                       [64000, 64000],
+               ];
        }
 
        public static function charCombinations() {
-               return array(
-                       array('CHAR_LOWER', '[a-z]'),
-                       array('CHAR_UPPER', '[A-Z]'),
-                       array('CHAR_DIGITS', '[0-9]'),
-               );
+               return [
+                       ['CHAR_LOWER', '[a-z]'],
+                       ['CHAR_UPPER', '[A-Z]'],
+                       ['CHAR_DIGITS', '[0-9]'],
+               ];
        }
 
        /** @var SecureRandom */
index 13a86bfae30cb840ffcc510699bc109849bd7b10..1a443229dffa2f6ab849b898aadc09ee9329ea8e 100644 (file)
@@ -49,7 +49,7 @@ class Backend implements \OCP\Share_Backend {
 
                $shares = \OC\Share\Share::getItemsSharedWithUser('test', $shareWith);
 
-               $knownTargets = array();
+               $knownTargets = [];
                foreach ($shares as $share) {
                        $knownTargets[] = $share['item_target'];
                }
@@ -73,7 +73,7 @@ class Backend implements \OCP\Share_Backend {
        }
 
        public function formatItems($items, $format, $parameters = null) {
-               $testItems = array();
+               $testItems = [];
                foreach ($items as $item) {
                        if ($format === self::FORMAT_SOURCE) {
                                $testItems[] = $item['item_source'];
index dc2d26509e349c4915084537793909d3238b6a09..2056e6bd1e2f57a772c6841cb8a750842f73a32b 100644 (file)
@@ -28,24 +28,24 @@ namespace Test\Share;
 class HelperTest extends \Test\TestCase {
 
        public function expireDateProvider() {
-               return array(
+               return [
                        // no default expire date, we take the users expire date
-                       array(array('defaultExpireDateSet' => false), 2000000000, 2000010000, 2000010000),
+                       [['defaultExpireDateSet' => false], 2000000000, 2000010000, 2000010000],
                        // no default expire date and no user defined expire date, return false
-                       array(array('defaultExpireDateSet' => false), 2000000000, null, false),
+                       [['defaultExpireDateSet' => false], 2000000000, null, false],
                        // unenforced expire data and no user defined expire date, return false (because the default is not enforced)
-                       array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false), 2000000000, null, false),
+                       [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false], 2000000000, null, false],
                        // enforced expire date and no user defined expire date, take default expire date
-                       array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true), 2000000000, null, 2000086400),
+                       [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true], 2000000000, null, 2000086400],
                        // unenforced expire date and user defined date > default expire date, take users expire date
-                       array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false), 2000000000, 2000100000, 2000100000),
+                       [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false], 2000000000, 2000100000, 2000100000],
                        // unenforced expire date and user expire date < default expire date, take users expire date
-                       array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false), 2000000000, 2000010000, 2000010000),
+                       [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false], 2000000000, 2000010000, 2000010000],
                        // enforced expire date and user expire date < default expire date, take users expire date
-                       array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true), 2000000000, 2000010000, 2000010000),
+                       [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true], 2000000000, 2000010000, 2000010000],
                        // enforced expire date and users expire date > default expire date, take default expire date
-                       array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true), 2000000000, 2000100000, 2000086400),
-               );
+                       [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true], 2000000000, 2000100000, 2000086400],
+               ];
        }
 
        /**
@@ -101,21 +101,21 @@ class HelperTest extends \Test\TestCase {
        }
 
        public function dataTestSplitUserRemoteError() {
-               return array(
+               return [
                        // Invalid path
-                       array('user@'),
+                       ['user@'],
 
                        // Invalid user
-                       array('@server'),
-                       array('us/er@server'),
-                       array('us:er@server'),
+                       ['@server'],
+                       ['us/er@server'],
+                       ['us:er@server'],
 
                        // Invalid splitting
-                       array('user'),
-                       array(''),
-                       array('us/erserver'),
-                       array('us:erserver'),
-               );
+                       ['user'],
+                       [''],
+                       ['us/erserver'],
+                       ['us:erserver'],
+               ];
        }
 
        /**
index 7feccdd82f5693e363eec4e7ec08d107b6bb4210..178694364289448403fb41937ec1f639c09afbcb 100644 (file)
@@ -26,14 +26,14 @@ class SearchResultSorterTest extends \Test\TestCase {
                $search = 'lin';
                $sorter = new \OC\Share\SearchResultSorter($search, 'foobar');
 
-               $result = array(
-                       array('foobar' => 'woot'),
-                       array('foobar' => 'linux'),
-                       array('foobar' => 'Linus'),
-                       array('foobar' => 'Bicyclerepairwoman'),
-               );
+               $result = [
+                       ['foobar' => 'woot'],
+                       ['foobar' => 'linux'],
+                       ['foobar' => 'Linus'],
+                       ['foobar' => 'Bicyclerepairwoman'],
+               ];
 
-               usort($result, array($sorter, 'sort'));
+               usort($result, [$sorter, 'sort']);
                $this->assertTrue($result[0]['foobar'] === 'Linus');
                $this->assertTrue($result[1]['foobar'] === 'linux');
                $this->assertTrue($result[2]['foobar'] === 'Bicyclerepairwoman');
index af05d0c4bdd1a5f5ce73b01669ed7e468c716c2d..9b20744edb7604ac5db54b7a722e13335897d52c 100644 (file)
@@ -115,7 +115,7 @@ class ShareTest extends \Test\TestCase {
 
        protected function tearDown(): void {
                $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `item_type` = ?');
-               $query->execute(array('test'));
+               $query->execute(['test']);
                \OC::$server->getConfig()->setAppValue('core', 'shareapi_allow_resharing', $this->resharing);
 
                $this->user1->delete();
@@ -141,37 +141,37 @@ class ShareTest extends \Test\TestCase {
                $query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` ('
                        .' `item_type`, `item_source`, `item_target`, `share_type`,'
                        .' `share_with`, `uid_owner`) VALUES (?,?,?,?,?,?)');
-               $args = array('test', 99, 'target1', \OCP\Share::SHARE_TYPE_USER, $this->user2->getUID(), $this->user1->getUID());
+               $args = ['test', 99, 'target1', \OCP\Share::SHARE_TYPE_USER, $this->user2->getUID(), $this->user1->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target2', \OCP\Share::SHARE_TYPE_USER, $this->user4->getUID(), $this->user1->getUID());
+               $args = ['test', 99, 'target2', \OCP\Share::SHARE_TYPE_USER, $this->user4->getUID(), $this->user1->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target3', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user2->getUID());
+               $args = ['test', 99, 'target3', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user2->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user4->getUID());
+               $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user4->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user6->getUID(), $this->user4->getUID());
+               $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user6->getUID(), $this->user4->getUID()];
                $query->execute($args);
 
 
                $result1 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user2->getUID(), $this->user1->getUID());
                $this->assertSame(1, count($result1));
-               $this->verifyResult($result1, array('target1'));
+               $this->verifyResult($result1, ['target1']);
 
                $result2 = \OCP\Share::getItemSharedWithUser('test', 99, null, $this->user1->getUID());
                $this->assertSame(2, count($result2));
-               $this->verifyResult($result2, array('target1', 'target2'));
+               $this->verifyResult($result2, ['target1', 'target2']);
 
                $result3 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user3->getUID());
                $this->assertSame(2, count($result3));
-               $this->verifyResult($result3, array('target3', 'target4'));
+               $this->verifyResult($result3, ['target3', 'target4']);
 
                $result4 = \OCP\Share::getItemSharedWithUser('test', 99, null, null);
                $this->assertSame(5, count($result4)); // 5 because target4 appears twice
-               $this->verifyResult($result4, array('target1', 'target2', 'target3', 'target4'));
+               $this->verifyResult($result4, ['target1', 'target2', 'target3', 'target4']);
 
                $result6 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user6->getUID(), null);
                $this->assertSame(1, count($result6));
-               $this->verifyResult($result6, array('target4'));
+               $this->verifyResult($result6, ['target4']);
        }
 
        public function testGetItemSharedWithUserFromGroupShare() {
@@ -181,32 +181,32 @@ class ShareTest extends \Test\TestCase {
                $query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` ('
                        .' `item_type`, `item_source`, `item_target`, `share_type`,'
                        .' `share_with`, `uid_owner`) VALUES (?,?,?,?,?,?)');
-               $args = array('test', 99, 'target1', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user1->getUID());
+               $args = ['test', 99, 'target1', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user1->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target2', \OCP\Share::SHARE_TYPE_GROUP, $this->group2->getGID(), $this->user1->getUID());
+               $args = ['test', 99, 'target2', \OCP\Share::SHARE_TYPE_GROUP, $this->group2->getGID(), $this->user1->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target3', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user2->getUID());
+               $args = ['test', 99, 'target3', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user2->getUID()];
                $query->execute($args);
-               $args = array('test', 99, 'target4', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user4->getUID());
+               $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user4->getUID()];
                $query->execute($args);
 
                // user2 is in group1 and group2
                $result1 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user2->getUID(), $this->user1->getUID());
                $this->assertSame(2, count($result1));
-               $this->verifyResult($result1, array('target1', 'target2'));
+               $this->verifyResult($result1, ['target1', 'target2']);
 
                $result2 = \OCP\Share::getItemSharedWithUser('test', 99, null, $this->user1->getUID());
                $this->assertSame(2, count($result2));
-               $this->verifyResult($result2, array('target1', 'target2'));
+               $this->verifyResult($result2, ['target1', 'target2']);
 
                // user3 is in group1 and group2
                $result3 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user3->getUID());
                $this->assertSame(3, count($result3));
-               $this->verifyResult($result3, array('target1', 'target3', 'target4'));
+               $this->verifyResult($result3, ['target1', 'target3', 'target4']);
 
                $result4 = \OCP\Share::getItemSharedWithUser('test', 99, null, null);
                $this->assertSame(4, count($result4));
-               $this->verifyResult($result4, array('target1', 'target2', 'target3', 'target4'));
+               $this->verifyResult($result4, ['target1', 'target2', 'target3', 'target4']);
 
                $result6 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user6->getUID(), null);
                $this->assertSame(0, count($result6));
@@ -229,16 +229,16 @@ class ShareTest extends \Test\TestCase {
         */
        function testRemoveProtocolFromUrl($url, $expectedResult) {
                $share = new \OC\Share\Share();
-               $result = self::invokePrivate($share, 'removeProtocolFromUrl', array($url));
+               $result = self::invokePrivate($share, 'removeProtocolFromUrl', [$url]);
                $this->assertSame($expectedResult, $result);
        }
 
        function urls() {
-               return array(
-                       array('http://owncloud.org', 'owncloud.org'),
-                       array('https://owncloud.org', 'owncloud.org'),
-                       array('owncloud.org', 'owncloud.org'),
-               );
+               return [
+                       ['http://owncloud.org', 'owncloud.org'],
+                       ['https://owncloud.org', 'owncloud.org'],
+                       ['owncloud.org', 'owncloud.org'],
+               ];
        }
 
        /**
@@ -265,57 +265,57 @@ class ShareTest extends \Test\TestCase {
        }
 
        function dataProviderTestGroupItems() {
-               return array(
+               return [
                        // one array with one share
-                       array(
-                               array( // input
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1')),
-                               array( // expected result
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1'))),
+                       [
+                               [ // input
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1']],
+                               [ // expected result
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1']]],
                        // two shares both point to the same source
-                       array(
-                               array( // input
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
-                                       ),
-                               array( // expected result
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
-                                               'grouped' => array(
-                                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
-                                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
-                                                       )
-                                               ),
-                                       )
-                               ),
+                       [
+                               [ // input
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+                                       ],
+                               [ // expected result
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
+                                               'grouped' => [
+                                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+                                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+                                                       ]
+                                               ],
+                                       ]
+                               ],
                        // two shares both point to the same source but with different targets
-                       array(
-                               array( // input
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'),
-                                       ),
-                               array( // expected result
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'),
-                                       )
-                               ),
+                       [
+                               [ // input
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'],
+                                       ],
+                               [ // expected result
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'],
+                                       ]
+                               ],
                        // three shares two point to the same source
-                       array(
-                               array( // input
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
-                                       array('item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'),
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
-                                       ),
-                               array( // expected result
-                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
-                                               'grouped' => array(
-                                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
-                                                       array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
-                                                       )
-                                               ),
-                                       array('item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'),
-                                       )
-                               ),
-               );
+                       [
+                               [ // input
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+                                       ['item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'],
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+                                       ],
+                               [ // expected result
+                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
+                                               'grouped' => [
+                                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+                                                       ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+                                                       ]
+                                               ],
+                                       ['item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'],
+                                       ]
+                               ],
+               ];
        }
 }
 
index ad41c928dedaf736e466095ba95f4b1c9d5f05e5..463ec5809dd7b365e978fb437b90f70d3a32df0f 100644 (file)
@@ -84,7 +84,7 @@ class TagsTest extends \Test\TestCase {
        }
 
        public function testInstantiateWithDefaults() {
-               $defaultTags = array('Friends', 'Family', 'Work', 'Other');
+               $defaultTags = ['Friends', 'Family', 'Work', 'Other'];
 
                $tagger = $this->tagMgr->load($this->objectType, $defaultTags);
 
@@ -92,7 +92,7 @@ class TagsTest extends \Test\TestCase {
        }
 
        public function testAddTags() {
-               $tags = array('Friends', 'Family', 'Work', 'Other');
+               $tags = ['Friends', 'Family', 'Work', 'Other'];
 
                $tagger = $this->tagMgr->load($this->objectType);
 
@@ -109,7 +109,7 @@ class TagsTest extends \Test\TestCase {
        }
 
        public function testAddMultiple() {
-               $tags = array('Friends', 'Family', 'Work', 'Other');
+               $tags = ['Friends', 'Family', 'Work', 'Other'];
 
                $tagger = $this->tagMgr->load($this->objectType);
 
@@ -169,37 +169,37 @@ class TagsTest extends \Test\TestCase {
        }
 
        public function testGetTagsForObjects() {
-               $defaultTags = array('Friends', 'Family', 'Work', 'Other');
+               $defaultTags = ['Friends', 'Family', 'Work', 'Other'];
                $tagger = $this->tagMgr->load($this->objectType, $defaultTags);
 
                $tagger->tagAs(1, 'Friends');
                $tagger->tagAs(1, 'Other');
                $tagger->tagAs(2, 'Family');
 
-               $tags = $tagger->getTagsForObjects(array(1));
+               $tags = $tagger->getTagsForObjects([1]);
                $this->assertEquals(1, count($tags));
                $tags = current($tags);
                sort($tags);
-               $this->assertSame(array('Friends', 'Other'), $tags);
+               $this->assertSame(['Friends', 'Other'], $tags);
 
-               $tags = $tagger->getTagsForObjects(array(1, 2));
+               $tags = $tagger->getTagsForObjects([1, 2]);
                $this->assertEquals(2, count($tags));
                $tags1 = $tags[1];
                sort($tags1);
-               $this->assertSame(array('Friends', 'Other'), $tags1);
-               $this->assertSame(array('Family'), $tags[2]);
+               $this->assertSame(['Friends', 'Other'], $tags1);
+               $this->assertSame(['Family'], $tags[2]);
                $this->assertEquals(
-                       array(),
-                       $tagger->getTagsForObjects(array(4))
+                       [],
+                       $tagger->getTagsForObjects([4])
                );
                $this->assertEquals(
-                       array(),
-                       $tagger->getTagsForObjects(array(4, 5))
+                       [],
+                       $tagger->getTagsForObjects([4, 5])
                );
        }
 
        public function testGetTagsForObjectsMassiveResults() {
-               $defaultTags = array('tag1');
+               $defaultTags = ['tag1'];
                $tagger = $this->tagMgr->load($this->objectType, $defaultTags);
                $tagData = $tagger->getTags();
                $tagId = $tagData[0]['id'];
@@ -213,9 +213,9 @@ class TagsTest extends \Test\TestCase {
                );
 
                // insert lots of entries
-               $idsArray = array();
+               $idsArray = [];
                for($i = 1; $i <= 1500; $i++) {
-                       $statement->execute(array($i, $tagId, $tagType));
+                       $statement->execute([$i, $tagId, $tagType]);
                        $idsArray[] = $i;
                }
 
@@ -224,7 +224,7 @@ class TagsTest extends \Test\TestCase {
        }
 
        public function testDeleteTags() {
-               $defaultTags = array('Friends', 'Family', 'Work', 'Other');
+               $defaultTags = ['Friends', 'Family', 'Work', 'Other'];
                $tagger = $this->tagMgr->load($this->objectType, $defaultTags);
 
                $this->assertEquals(4, count($tagger->getTags()));
@@ -232,12 +232,12 @@ class TagsTest extends \Test\TestCase {
                $tagger->delete('family');
                $this->assertEquals(3, count($tagger->getTags()));
 
-               $tagger->delete(array('Friends', 'Work', 'Other'));
+               $tagger->delete(['Friends', 'Work', 'Other']);
                $this->assertEquals(0, count($tagger->getTags()));
        }
 
        public function testRenameTag() {
-               $defaultTags = array('Friends', 'Family', 'Wrok', 'Other');
+               $defaultTags = ['Friends', 'Family', 'Wrok', 'Other'];
                $tagger = $this->tagMgr->load($this->objectType, $defaultTags);
 
                $this->assertTrue($tagger->rename('Wrok', 'Work'));
@@ -248,7 +248,7 @@ class TagsTest extends \Test\TestCase {
        }
 
        public function testTagAs() {
-               $objids = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
+               $objids = [1, 2, 3, 4, 5, 6, 7, 8, 9];
 
                $tagger = $this->tagMgr->load($this->objectType);
 
@@ -264,7 +264,7 @@ class TagsTest extends \Test\TestCase {
        * @depends testTagAs
        */
        public function testUnTag() {
-               $objIds = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
+               $objIds = [1, 2, 3, 4, 5, 6, 7, 8, 9];
 
                // Is this "legal"?
                $this->testTagAs();
@@ -283,9 +283,9 @@ class TagsTest extends \Test\TestCase {
        public function testFavorite() {
                $tagger = $this->tagMgr->load($this->objectType);
                $this->assertTrue($tagger->addToFavorites(1));
-               $this->assertEquals(array(1), $tagger->getFavorites());
+               $this->assertEquals([1], $tagger->getFavorites());
                $this->assertTrue($tagger->removeFromFavorites(1));
-               $this->assertEquals(array(), $tagger->getFavorites());
+               $this->assertEquals([], $tagger->getFavorites());
        }
 
        public function testShareTags() {
@@ -318,7 +318,7 @@ class TagsTest extends \Test\TestCase {
                \OC\Share\Share::shareItem('test', 1, \OCP\Share::SHARE_TYPE_USER, $otherUserId, \OCP\Constants::PERMISSION_READ);
 
                \OC_User::setUserId($otherUserId);
-               $otherTagger = $otherTagMgr->load('test', array(), true); // Update tags, load shared ones.
+               $otherTagger = $otherTagMgr->load('test', [], true); // Update tags, load shared ones.
                $this->assertTrue($otherTagger->hasTag($testTag));
                $this->assertContains(1, $otherTagger->getIdsForTag($testTag));
        }
index 6262bd5a00a0d948724d1c1978631e57300272df..f43573c1e3a8729dda9b425734c8e56c1e25a993 100644 (file)
@@ -17,7 +17,7 @@ class NullLogger extends Log {
                //disable original constructor
        }
 
-       public function log(int $level, string $message, array $context = array()) {
+       public function log(int $level, string $message, array $context = []) {
                //noop
        }
 }
index 7c9f3585038b09645826c00abc5ec27d8c1605d2..7aa1eb177d726e08f2df8f5f1d7b4ec36093ff5b 100644 (file)
@@ -85,14 +85,14 @@ class CSSResourceLocatorTest extends \Test\TestCase {
                return new CSSResourceLocator(
                        $this->logger,
                        'theme',
-                       array('core'=>'map'),
-                       array('3rd'=>'party'),
+                       ['core'=>'map'],
+                       ['3rd'=>'party'],
                        $scssCacher
                );
        }
 
        private function rrmdir($directory) {
-               $files = array_diff(scandir($directory), array('.','..'));
+               $files = array_diff(scandir($directory), ['.','..']);
                foreach ($files as $file) {
                        if (is_dir($directory . '/' . $file)) {
                                $this->rrmdir($directory . '/' . $file);
@@ -111,10 +111,10 @@ class CSSResourceLocatorTest extends \Test\TestCase {
                $locator = $this->cssResourceLocator();
                $this->assertAttributeEquals('theme', 'theme', $locator);
                $this->assertAttributeEquals('core', 'serverroot', $locator);
-               $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
+               $this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
                $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
                $this->assertAttributeEquals('map', 'webroot', $locator);
-               $this->assertAttributeEquals(array(), 'resources', $locator);
+               $this->assertAttributeEquals([], 'resources', $locator);
        }
 
        public function testFindWithAppPathSymlink() {
@@ -136,7 +136,7 @@ class CSSResourceLocatorTest extends \Test\TestCase {
                 ];
 
                $locator = $this->cssResourceLocator();
-               $locator->find(array('test-css-app/test-file'));
+               $locator->find(['test-css-app/test-file']);
 
                $resources = $locator->getResources();
                $this->assertCount(1, $resources);
index 8e36426393f3ebd3a4960862a6ca6361e4d5e560..f7d7f7b57e51b0f39f1547460906981c092adc60 100644 (file)
@@ -90,9 +90,9 @@ class IconsCacherTest extends \Test\TestCase {
                        }
                ";
                $actual = self::invokePrivate($this->iconsCacher, 'getIconsFromCss', [$css]);
-               $expected = array(
+               $expected = [
                        'icon-test' => '/svg/core/actions/add/000?v=1'
-               );
+               ];
                $this->assertEquals($expected, $actual);
        }
 
index 38c5fc0eadd1a323b2f4d86b6e02863fd1029afa..8c8fc99c9619e34f0a68af953f6951631079da56 100644 (file)
@@ -64,14 +64,14 @@ class JSResourceLocatorTest extends \Test\TestCase {
                return new JSResourceLocator(
                        $this->logger,
                        'theme',
-                       array('core'=>'map'),
-                       array('3rd'=>'party'),
+                       ['core'=>'map'],
+                       ['3rd'=>'party'],
                        $jsCombiner
                );
        }
 
        private function rrmdir($directory) {
-               $files = array_diff(scandir($directory), array('.','..'));
+               $files = array_diff(scandir($directory), ['.','..']);
                foreach ($files as $file) {
                        if (is_dir($directory . '/' . $file)) {
                                $this->rrmdir($directory . '/' . $file);
@@ -91,10 +91,10 @@ class JSResourceLocatorTest extends \Test\TestCase {
                $locator = $this->jsResourceLocator();
                $this->assertAttributeEquals('theme', 'theme', $locator);
                $this->assertAttributeEquals('core', 'serverroot', $locator);
-               $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
+               $this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
                $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
                $this->assertAttributeEquals('map', 'webroot', $locator);
-               $this->assertAttributeEquals(array(), 'resources', $locator);
+               $this->assertAttributeEquals([], 'resources', $locator);
        }
 
        public function testFindWithAppPathSymlink() {
@@ -116,7 +116,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
                 ];
 
                $locator = $this->jsResourceLocator();
-               $locator->find(array('test-js-app/test-file'));
+               $locator->find(['test-js-app/test-file']);
 
                $resources = $locator->getResources();
                $this->assertCount(1, $resources);
index 90488071b4f098150aae5003246399ac7287a292..f0fa8186686a800c16433cf2ee2d74fc92d7d45d 100644 (file)
@@ -29,24 +29,24 @@ class ResourceLocatorTest extends \Test\TestCase {
         */
        public function getResourceLocator($theme, $core_map, $party_map, $appsRoots) {
                return $this->getMockForAbstractClass('OC\Template\ResourceLocator',
-                       array($this->logger, $theme, $core_map, $party_map, $appsRoots ),
-                       '', true, true, true, array());
+                       [$this->logger, $theme, $core_map, $party_map, $appsRoots ],
+                       '', true, true, true, []);
        }
 
        public function testConstructor() {
                $locator = $this->getResourceLocator('theme',
-                       array('core'=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
+                       ['core'=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
                $this->assertAttributeEquals('theme', 'theme', $locator);
                $this->assertAttributeEquals('core', 'serverroot', $locator);
-               $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
+               $this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
                $this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
                $this->assertAttributeEquals('map', 'webroot', $locator);
-               $this->assertAttributeEquals(array(), 'resources', $locator);
+               $this->assertAttributeEquals([], 'resources', $locator);
        }
 
        public function testFind() {
                $locator = $this->getResourceLocator('theme',
-                       array('core' => 'map'), array('3rd' => 'party'), array('foo' => 'bar'));
+                       ['core' => 'map'], ['3rd' => 'party'], ['foo' => 'bar']);
                $locator->expects($this->once())
                        ->method('doFind')
                        ->with('foo');
@@ -54,12 +54,12 @@ class ResourceLocatorTest extends \Test\TestCase {
                        ->method('doFindTheme')
                        ->with('foo');
                /** @var \OC\Template\ResourceLocator $locator */
-               $locator->find(array('foo'));
+               $locator->find(['foo']);
        }
 
        public function testFindNotFound() {
                $locator = $this->getResourceLocator('theme',
-                       array('core'=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
+                       ['core'=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
                $locator->expects($this->once())
                        ->method('doFind')
                        ->with('foo')
@@ -72,25 +72,25 @@ class ResourceLocatorTest extends \Test\TestCase {
                        ->method('debug')
                        ->with($this->stringContains('map/foo'));
                /** @var \OC\Template\ResourceLocator $locator */
-               $locator->find(array('foo'));
+               $locator->find(['foo']);
        }
 
        public function testAppendIfExist() {
                $locator = $this->getResourceLocator('theme',
-                       array(__DIR__=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
+                       [__DIR__=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
                /** @var \OC\Template\ResourceLocator $locator */
                $method = new \ReflectionMethod($locator, 'appendIfExist');
                $method->setAccessible(true);
 
                $method->invoke($locator, __DIR__, basename(__FILE__), 'webroot');
-               $resource1 = array(__DIR__, 'webroot', basename(__FILE__));
-               $this->assertEquals(array($resource1), $locator->getResources());
+               $resource1 = [__DIR__, 'webroot', basename(__FILE__)];
+               $this->assertEquals([$resource1], $locator->getResources());
 
                $method->invoke($locator, __DIR__, basename(__FILE__));
-               $resource2 = array(__DIR__, 'map', basename(__FILE__));
-               $this->assertEquals(array($resource1, $resource2), $locator->getResources());
+               $resource2 = [__DIR__, 'map', basename(__FILE__)];
+               $this->assertEquals([$resource1, $resource2], $locator->getResources());
 
                $method->invoke($locator, __DIR__, 'does-not-exist');
-               $this->assertEquals(array($resource1, $resource2), $locator->getResources());
+               $this->assertEquals([$resource1, $resource2], $locator->getResources());
        }
 }
index 9e8c30961fb5a6678a763cd2c9b12d70185a8528..446821e62f8cf2361a234dbb74401b6811b647e4 100644 (file)
@@ -471,7 +471,7 @@ class SCSSCacherTest extends \Test\TestCase {
        }
 
        private function rrmdir($directory) {
-               $files = array_diff(scandir($directory), array('.','..'));
+               $files = array_diff(scandir($directory), ['.','..']);
                foreach ($files as $file) {
                        if (is_dir($directory . '/' . $file)) {
                                $this->rrmdir($directory . '/' . $file);
index b76105e9346d5ec98738037711ea562ef9ab7f31..be4a7ade78733da5c750d840064000f8f4e86e37 100644 (file)
@@ -194,7 +194,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
         * @param array $parameters
         * @return mixed
         */
-       protected static function invokePrivate($object, $methodName, array $parameters = array()) {
+       protected static function invokePrivate($object, $methodName, array $parameters = []) {
                if (is_string($object)) {
                        $className = $object;
                } else {
@@ -297,14 +297,14 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
         * @param string $dataDir
         */
        static protected function tearDownAfterClassCleanStrayDataFiles($dataDir) {
-               $knownEntries = array(
+               $knownEntries = [
                        'nextcloud.log' => true,
                        'audit.log' => true,
                        'owncloud.db' => true,
                        '.ocdata' => true,
                        '..' => true,
                        '.' => true,
-               );
+               ];
 
                if ($dh = opendir($dataDir)) {
                        while (($file = readdir($dh)) !== false) {
@@ -479,7 +479,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
                $l10n
                        ->expects($this->any())
                        ->method('t')
-                       ->willReturnCallback(function($text, $parameters = array()) {
+                       ->willReturnCallback(function($text, $parameters = []) {
                                return vsprintf($text, $parameters);
                        });
 
index ad98ba91212f81a8b0ff9bb425f3d19935d27273..8799ce72fd0b0e0fb7e0b11c6e8061e5a79ff86d 100644 (file)
@@ -75,7 +75,7 @@ trait EncryptionTrait {
                        \OC::$server->getLogger()
                );
 
-               $this->registerStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'));
+               $this->registerStorageWrapper('oc_encryption', [$encryptionWrapper, 'wrapStorage']);
        }
 
        protected function setUpEncryptionTrait() {
index 1dc0182a960b6b22c9db3972935b8cf4b6710edc..3d53301b325a2d7821d4a2f18446c7123e1f9c11 100644 (file)
@@ -245,7 +245,7 @@ class ManagerTest extends TestCase {
                $backend->expects($this->once())
                        ->method('getUsers')
                        ->with($this->equalTo('fo'))
-                       ->willReturn(array('foo', 'afoo', 'Afoo1', 'Bfoo'));
+                       ->willReturn(['foo', 'afoo', 'Afoo1', 'Bfoo']);
                $backend->expects($this->never())
                        ->method('loginName2UserName');
 
@@ -268,7 +268,7 @@ class ManagerTest extends TestCase {
                $backend1->expects($this->once())
                        ->method('getUsers')
                        ->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
-                       ->willReturn(array('foo1', 'foo2'));
+                       ->willReturn(['foo1', 'foo2']);
                $backend1->expects($this->never())
                        ->method('loginName2UserName');
 
@@ -279,7 +279,7 @@ class ManagerTest extends TestCase {
                $backend2->expects($this->once())
                        ->method('getUsers')
                        ->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
-                       ->willReturn(array('foo3'));
+                       ->willReturn(['foo3']);
                $backend2->expects($this->never())
                        ->method('loginName2UserName');
 
index c96a07eb9af2d95030d0958618bb4cc4bb1791ce..f7aba189603a032b58c74d96b4796a421599bdd5 100644 (file)
@@ -814,10 +814,10 @@ class SessionTest extends \Test\TestCase {
        }
 
        public function testActiveUserAfterSetSession() {
-               $users = array(
+               $users = [
                        'foo' => new User('foo', null, $this->createMock(EventDispatcherInterface::class)),
                        'bar' => new User('bar', null, $this->createMock(EventDispatcherInterface::class))
-               );
+               ];
 
                $manager = $this->getMockBuilder('\OC\User\Manager')
                        ->disableOriginalConstructor()
index 0681a317c28136ee97cf0fc48f71ff2985128ee7..f75aef5737e40398c722d1cc50287019aba19e4c 100644 (file)
@@ -35,7 +35,7 @@ use OC\Group\Backend;
  * dummy group backend, does not keep state, only for testing use
  */
 class Dummy extends Backend {
-       private $groups=array();
+       private $groups=[];
        /**
         * Try to create a new group
         * @param string $gid The name of the group to create
@@ -46,7 +46,7 @@ class Dummy extends Backend {
         */
        public function createGroup($gid) {
                if(!isset($this->groups[$gid])) {
-                       $this->groups[$gid]=array();
+                       $this->groups[$gid]=[];
                        return true;
                }else{
                        return false;
@@ -136,7 +136,7 @@ class Dummy extends Backend {
         * if the user exists at all.
         */
        public function getUserGroups($uid) {
-               $groups=array();
+               $groups=[];
                $allGroups=array_keys($this->groups);
                foreach($allGroups as $group) {
                        if($this->inGroup($uid, $group)) {
@@ -157,7 +157,7 @@ class Dummy extends Backend {
                if(empty($search)) {
                        return array_keys($this->groups);
                }
-               $result = array();
+               $result = [];
                foreach(array_keys($this->groups) as $group) {
                        if(stripos($group, $search) !== false) {
                                $result[] = $group;
@@ -180,7 +180,7 @@ class Dummy extends Backend {
                                $length = $limit < 0 ? null : $limit;
                                return array_slice($this->groups[$gid], $offset, $length);
                        }
-                       $result = array();
+                       $result = [];
                        foreach($this->groups[$gid] as $user) {
                                if(stripos($user, $search) !== false) {
                                        $result[] = $user;
@@ -188,7 +188,7 @@ class Dummy extends Backend {
                        }
                        return $result;
                }else{
-                       return array();
+                       return [];
                }
        }
 
index 4771983e9bcfa2f03cc05bc1151f6e7734b2e173..1d3c2d57b423de6012845084faf73492e511e430 100644 (file)
@@ -33,8 +33,8 @@ use OC\User\Backend;
  * dummy user backend, does not keep state, only for testing use
  */
 class Dummy extends Backend implements \OCP\IUserBackend {
-       private $users = array();
-       private $displayNames = array();
+       private $users = [];
+       private $displayNames = [];
 
        /**
         * Create a new user
@@ -127,7 +127,7 @@ class Dummy extends Backend implements \OCP\IUserBackend {
                if (empty($search)) {
                        return array_keys($this->users);
                }
-               $result = array();
+               $result = [];
                foreach (array_keys($this->users) as $user) {
                        if (stripos($user, $search) !== false) {
                                $result[] = $user;
index 9cba59beb475bf8c8f959ced114aad90f87a89b2..e822c3949305e6a28bd89821e5fd5a142caa36c9 100644 (file)
@@ -55,9 +55,9 @@ class UtilCheckServerTest extends \Test\TestCase {
         * Test that checkServer() returns no errors in the regular case.
         */
        public function testCheckServer() {
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => true
-               )));
+               ]));
                $this->assertEmpty($result);
        }
 
@@ -72,9 +72,9 @@ class UtilCheckServerTest extends \Test\TestCase {
 
                // even though ".ocdata" is missing, the error isn't
                // triggered to allow setup to run
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => false
-               )));
+               ]));
                $this->assertEmpty($result);
        }
 
@@ -91,14 +91,14 @@ class UtilCheckServerTest extends \Test\TestCase {
                $oldCurrentVersion = $session->get('OC_Version');
 
                // upgrade condition to simulate needUpgrade() === true
-               $session->set('OC_Version', array(6, 0, 0, 2));
+               $session->set('OC_Version', [6, 0, 0, 2]);
 
                // even though ".ocdata" is missing, the error isn't
                // triggered to allow for upgrade
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => true,
                        'version' => '6.0.0.1'
-               )));
+               ]));
                $this->assertEmpty($result);
 
                // restore versions
@@ -123,10 +123,10 @@ class UtilCheckServerTest extends \Test\TestCase {
                $result = \OC_Util::checkDataDirectoryValidity($this->datadir);
                $this->assertEquals(1, count($result));
 
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => true,
                        'version' => implode('.', \OCP\Util::getVersion())
-               )));
+               ]));
                $this->assertCount(1, $result);
        }
 
@@ -134,10 +134,10 @@ class UtilCheckServerTest extends \Test\TestCase {
         * Tests that no error is given when the datadir is writable
         */
        public function testDataDirWritable() {
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => true,
                        'version' => implode('.', \OCP\Util::getVersion())
-               )));
+               ]));
                $this->assertEmpty($result);
        }
 
@@ -148,10 +148,10 @@ class UtilCheckServerTest extends \Test\TestCase {
                $this->markTestSkipped('TODO: Disable because fails on drone');
 
                chmod($this->datadir, 0300);
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => true,
                        'version' => implode('.', \OCP\Util::getVersion())
-               )));
+               ]));
                $this->assertCount(1, $result);
        }
 
@@ -160,10 +160,10 @@ class UtilCheckServerTest extends \Test\TestCase {
         */
        public function testDataDirNotWritableSetup() {
                chmod($this->datadir, 0300);
-               $result = \OC_Util::checkServer($this->getConfig(array(
+               $result = \OC_Util::checkServer($this->getConfig([
                        'installed' => false,
                        'version' => implode('.', \OCP\Util::getVersion())
-               )));
+               ]));
                chmod($this->datadir, 0700); //needed for cleanup
                $this->assertEmpty($result);
        }
index 94ac17ce345b87050dc32cf96d80291373cb84a0..4d8432294fb4968fe30af5e0239fb302363fb33f 100644 (file)
@@ -206,16 +206,16 @@ class UtilTest extends \Test\TestCase {
        }
 
        public function dataProviderForTestIsSharingDisabledForUser() {
-               return array(
+               return [
                        // existing groups, groups the user belong to, groups excluded from sharing, expected result
-                       array(array('g1', 'g2', 'g3'), array(), array('g1'), false),
-                       array(array('g1', 'g2', 'g3'), array(), array(), false),
-                       array(array('g1', 'g2', 'g3'), array('g2'), array('g1'), false),
-                       array(array('g1', 'g2', 'g3'), array('g2'), array(), false),
-                       array(array('g1', 'g2', 'g3'), array('g1', 'g2'), array('g1'), false),
-                       array(array('g1', 'g2', 'g3'), array('g1', 'g2'), array('g1', 'g2'), true),
-                       array(array('g1', 'g2', 'g3'), array('g1', 'g2'), array('g1', 'g2', 'g3'), true),
-               );
+                       [['g1', 'g2', 'g3'], [], ['g1'], false],
+                       [['g1', 'g2', 'g3'], [], [], false],
+                       [['g1', 'g2', 'g3'], ['g2'], ['g1'], false],
+                       [['g1', 'g2', 'g3'], ['g2'], [], false],
+                       [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1'], false],
+                       [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1', 'g2'], true],
+                       [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1', 'g2', 'g3'], true],
+               ];
        }
 
        /**
@@ -250,32 +250,32 @@ class UtilTest extends \Test\TestCase {
        }
 
        function defaultAppsProvider() {
-               return array(
+               return [
                        // none specified, default to files
-                       array(
+                       [
                                '',
                                'index.php/apps/files/',
-                               array('files'),
-                       ),
+                               ['files'],
+                       ],
                        // unexisting or inaccessible app specified, default to files
-                       array(
+                       [
                                'unexist',
                                'index.php/apps/files/',
-                               array('files'),
-                       ),
+                               ['files'],
+                       ],
                        // non-standard app
-                       array(
+                       [
                                'calendar',
                                'index.php/apps/calendar/',
-                               array('files', 'calendar'),
-                       ),
+                               ['files', 'calendar'],
+                       ],
                        // non-standard app with fallback
-                       array(
+                       [
                                'contacts,calendar',
                                'index.php/apps/calendar/',
-                               array('files', 'calendar'),
-                       ),
-               );
+                               ['files', 'calendar'],
+                       ],
+               ];
        }
 
        public function testGetDefaultPageUrlWithRedirectUrlWithoutFrontController() {
@@ -319,14 +319,14 @@ class UtilTest extends \Test\TestCase {
                $this->assertFalse(\OCP\Util::needUpgrade());
 
                $config->setSystemValue('version', '7.0.0.0');
-               \OC::$server->getSession()->set('OC_Version', array(7, 0, 0, 1));
-               self::invokePrivate(new \OCP\Util, 'needUpgradeCache', array(null));
+               \OC::$server->getSession()->set('OC_Version', [7, 0, 0, 1]);
+               self::invokePrivate(new \OCP\Util, 'needUpgradeCache', [null]);
 
                $this->assertTrue(\OCP\Util::needUpgrade());
 
                $config->setSystemValue('version', $oldConfigVersion);
                \OC::$server->getSession()->set('OC_Version', $oldSessionVersion);
-               self::invokePrivate(new \OCP\Util, 'needUpgradeCache', array(null));
+               self::invokePrivate(new \OCP\Util, 'needUpgradeCache', [null]);
 
                $this->assertFalse(\OCP\Util::needUpgrade());
        }
index 2d88d9391575c36f3a83736bc5b9d767ddcca57c..6831ec66f6ba7e6b30e0ca24d4f31e5001dea102 100644 (file)
@@ -21,7 +21,7 @@ if (is_dir(OC::$SERVERROOT.'/apps2')) {
 if (getenv('OBJECT_STORE') === 's3') {
        $CONFIG['objectstore'] = [
                'class' => 'OC\\Files\\ObjectStore\\S3',
-               'arguments' => array(
+               'arguments' => [
                        'bucket' => 'nextcloud',
                        'autocreate' => true,
                        'key' => 'dummy',
@@ -31,7 +31,7 @@ if (getenv('OBJECT_STORE') === 's3') {
                        'use_ssl' => false,
                        // required for some non amazon s3 implementations
                        'use_path_style' => true
-               )
+               ]
        ];
 }
 if (getenv('OBJECT_STORE') === 'swift') {
@@ -40,7 +40,7 @@ if (getenv('OBJECT_STORE') === 'swift') {
        if (getenv('SWIFT-AUTH') === 'v2.0') {
                $CONFIG['objectstore'] = [
                        'class' => 'OC\\Files\\ObjectStore\\Swift',
-                       'arguments' => array(
+                       'arguments' => [
                                'autocreate' => true,
                                'username' => 'swift',
                                'tenantName' => 'service',
@@ -49,12 +49,12 @@ if (getenv('OBJECT_STORE') === 'swift') {
                                'region' => 'regionOne',
                                'url' => "http://$swiftHost:5000/v2.0",
                                'bucket' => 'nextcloud'
-                       )
+                       ]
                ];
        } else {
                $CONFIG['objectstore'] = [
                        'class' => 'OC\\Files\\ObjectStore\\Swift',
-                       'arguments' => array(
+                       'arguments' => [
                                'autocreate' => true,
                                'user' => [
                                        'name' => 'swift',
@@ -76,19 +76,19 @@ if (getenv('OBJECT_STORE') === 'swift') {
                                'region' => 'regionOne',
                                'url' => "http://$swiftHost:5000/v3",
                                'bucket' => 'nextcloud'
-                       )
+                       ]
                ];
        }
 }
 if (getenv('OBJECT_STORE') === 'azure') {
        $CONFIG['objectstore'] = [
                'class' => 'OC\\Files\\ObjectStore\\Azure',
-               'arguments' => array(
+               'arguments' => [
                        'container' => 'test',
                        'account_name' => 'devstoreaccount1',
                        'account_key' => 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
                        'endpoint' => 'http://' . (getenv('DRONE') === 'true' ? 'azurite' : 'localhost') . ':10000/devstoreaccount1',
                        'autocreate' => true
-               )
+               ]
        ];
 }
index 002a01605950bd3c178c289417efaae21571f655..f39ef9497e9f0a9b328450f7bc2a44b2ec637617 100644 (file)
@@ -29,7 +29,7 @@
 // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
 // when updating major/minor version number.
 
-$OC_Version = array(19, 0, 0, 0);
+$OC_Version = [19, 0, 0, 0];
 
 // The human readable string
 $OC_VersionString = '19.0.0 alpha';