@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | * @property int $limit |
| 17 | 17 | * @property int $offset |
| 18 | 18 | */ |
| 19 | -class SolrSearchQuery extends Query |
|
| 20 | -{ |
|
| 19 | +class SolrSearchQuery extends Query { |
|
| 21 | 20 | /** |
| 22 | 21 | * @access private |
| 23 | 22 | * @var SolrSearch |
@@ -33,8 +32,7 @@ discard block |
||
| 33 | 32 | * |
| 34 | 33 | * @return void |
| 35 | 34 | */ |
| 36 | - public function __construct($solrSearch) |
|
| 37 | - { |
|
| 35 | + public function __construct($solrSearch) { |
|
| 38 | 36 | $this->solrSearch = $solrSearch; |
| 39 | 37 | |
| 40 | 38 | $this->offset = 0; |
@@ -52,8 +50,7 @@ discard block |
||
| 52 | 50 | */ |
| 53 | 51 | // TODO: Return type (array) of method SolrSearchQuery::execute() should be compatible with return type (iterable<object>&TYPO3\CMS\Extbase\Persistence\QueryResultInterface) of method TYPO3\CMS\Extbase\Persistence\QueryInterface::execute() |
| 54 | 52 | // @phpstan-ignore-next-line |
| 55 | - public function execute($returnRawQueryResult = false) |
|
| 56 | - { |
|
| 53 | + public function execute($returnRawQueryResult = false) { |
|
| 57 | 54 | $this->solrSearch->submit($this->offset, $this->limit); |
| 58 | 55 | |
| 59 | 56 | // solrSearch now only contains the results in range, indexed in [0, n) |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | // TODO: Return type (array) of method SolrSearchQuery::execute() should be compatible with return type (iterable<object>&TYPO3\CMS\Extbase\Persistence\QueryResultInterface) of method TYPO3\CMS\Extbase\Persistence\QueryInterface::execute() |
| 54 | 54 | // @phpstan-ignore-next-line |
| 55 | - public function execute($returnRawQueryResult = false) |
|
| 55 | + public function execute($returnRawQueryResult = FALSE) |
|
| 56 | 56 | { |
| 57 | 57 | $this->solrSearch->submit($this->offset, $this->limit); |
| 58 | 58 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | 'navigationComponentId' => '@typo3/backend/page-tree/page-tree-element', |
| 27 | 27 | 'controllerActions' => [ |
| 28 | 28 | \Kitodo\Dlf\Controller\Backend\NewTenantController::class => [ |
| 29 | - 'index','error','addFormat','addMetadata','addSolrCore','addStructure' |
|
| 29 | + 'index', 'error', 'addFormat', 'addMetadata', 'addSolrCore', 'addStructure' |
|
| 30 | 30 | ], |
| 31 | 31 | ], |
| 32 | 32 | ], |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
| 97 | 97 | |
| 98 | 98 | if ($this->disableJsonWrappedResponse) { |
| 99 | - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { |
|
| 99 | + $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) { |
|
| 100 | 100 | return $ext !== 'Resources/Core/Functional/Extensions/json_response'; |
| 101 | 101 | }); |
| 102 | 102 | } |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
| 110 | 110 | |
| 111 | - $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
|
| 111 | + $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/'; |
|
| 112 | 112 | $this->httpClient = new HttpClient([ |
| 113 | - 'base_uri' => $this->baseUrl . 'index.php', |
|
| 113 | + 'base_uri' => $this->baseUrl.'index.php', |
|
| 114 | 114 | 'http_errors' => false, |
| 115 | 115 | ]); |
| 116 | 116 | |
@@ -169,13 +169,13 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | protected function addSiteConfig($identifier) |
| 171 | 171 | { |
| 172 | - $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
|
| 172 | + $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml'); |
|
| 173 | 173 | $siteConfig['base'] = $this->baseUrl; |
| 174 | 174 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
| 175 | 175 | |
| 176 | - $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
|
| 176 | + $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier; |
|
| 177 | 177 | @mkdir($siteConfigPath, 0775, true); |
| 178 | - file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
|
| 178 | + file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig)); |
|
| 179 | 179 | |
| 180 | 180 | // refresh site cache (otherwise site config is not found) |
| 181 | 181 | $finder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Site\SiteFinder::class); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 198 | 198 | |
| 199 | 199 | $updateQuery = $solr->service->createUpdate(); |
| 200 | - $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
|
| 200 | + $documents = array_map(function($jsonDoc) use ($updateQuery) { |
|
| 201 | 201 | $document = $updateQuery->createDocument(); |
| 202 | 202 | foreach ($jsonDoc as $key => $value) { |
| 203 | 203 | $document->setField($key, $value); |
@@ -89,8 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | protected $httpClient; |
| 91 | 91 | |
| 92 | - public function __construct() |
|
| 93 | - { |
|
| 92 | + public function __construct() { |
|
| 94 | 93 | parent::__construct(); |
| 95 | 94 | |
| 96 | 95 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
@@ -117,8 +116,7 @@ discard block |
||
| 117 | 116 | $this->addSiteConfig('dlf-testing'); |
| 118 | 117 | } |
| 119 | 118 | |
| 120 | - protected function getDlfConfiguration() |
|
| 121 | - { |
|
| 119 | + protected function getDlfConfiguration() { |
|
| 122 | 120 | $dotenv = Dotenv::createImmutable('/home/runner/work/kitodo-presentation/kitodo-presentation/Build/Test/', 'test.env'); |
| 123 | 121 | $dotenv->load(); |
| 124 | 122 | |
@@ -167,8 +165,7 @@ discard block |
||
| 167 | 165 | ]; |
| 168 | 166 | } |
| 169 | 167 | |
| 170 | - protected function addSiteConfig($identifier) |
|
| 171 | - { |
|
| 168 | + protected function addSiteConfig($identifier) { |
|
| 172 | 169 | $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
| 173 | 170 | $siteConfig['base'] = $this->baseUrl; |
| 174 | 171 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
@@ -182,8 +179,7 @@ discard block |
||
| 182 | 179 | $finder->getAllSites(false); // useCache = false |
| 183 | 180 | } |
| 184 | 181 | |
| 185 | - protected function initializeRepository(string $className, int $storagePid) |
|
| 186 | - { |
|
| 182 | + protected function initializeRepository(string $className, int $storagePid) { |
|
| 187 | 183 | $repository = GeneralUtility::makeInstance($className); |
| 188 | 184 | $querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class); |
| 189 | 185 | $querySettings->setStoragePageIds([$storagePid]); |
@@ -192,8 +188,7 @@ discard block |
||
| 192 | 188 | return $repository; |
| 193 | 189 | } |
| 194 | 190 | |
| 195 | - protected function importSolrDocuments(Solr $solr, string $path) |
|
| 196 | - { |
|
| 191 | + protected function importSolrDocuments(Solr $solr, string $path) { |
|
| 197 | 192 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 198 | 193 | |
| 199 | 194 | $updateQuery = $solr->service->createUpdate(); |
@@ -212,8 +207,7 @@ discard block |
||
| 212 | 207 | $solr->service->update($updateQuery); |
| 213 | 208 | } |
| 214 | 209 | |
| 215 | - protected function initLanguageService(string $locale) |
|
| 216 | - { |
|
| 210 | + protected function initLanguageService(string $locale) { |
|
| 217 | 211 | // create mock backend user and set language |
| 218 | 212 | // which is loaded by LanguageServiceFactory as default value in backend mode |
| 219 | 213 | $backendUser = GeneralUtility::makeInstance(BackendUserAuthentication::class); |
@@ -224,8 +218,7 @@ discard block |
||
| 224 | 218 | /** |
| 225 | 219 | * Assert that $sub is recursively contained within $super. |
| 226 | 220 | */ |
| 227 | - protected function assertArrayMatches(array $sub, array $super, string $message = '') |
|
| 228 | - { |
|
| 221 | + protected function assertArrayMatches(array $sub, array $super, string $message = '') { |
|
| 229 | 222 | self::assertEquals($sub, ArrayUtility::intersectRecursive($super, $sub), $message); |
| 230 | 223 | } |
| 231 | 224 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ], |
| 53 | 53 | 'FE' => [ |
| 54 | 54 | 'cacheHash' => [ |
| 55 | - 'enforceValidation' => false, |
|
| 55 | + 'enforceValidation' => FALSE, |
|
| 56 | 56 | ], |
| 57 | 57 | ], |
| 58 | 58 | 'DB' => [ |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @var bool |
| 74 | 74 | */ |
| 75 | - protected $disableJsonWrappedResponse = false; |
|
| 75 | + protected $disableJsonWrappedResponse = FALSE; |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * @var PersistenceManager |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
| 112 | 112 | $this->httpClient = new HttpClient([ |
| 113 | 113 | 'base_uri' => $this->baseUrl . 'index.php', |
| 114 | - 'http_errors' => false, |
|
| 114 | + 'http_errors' => FALSE, |
|
| 115 | 115 | ]); |
| 116 | 116 | |
| 117 | 117 | $this->addSiteConfig('dlf-testing'); |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
| 175 | 175 | |
| 176 | 176 | $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
| 177 | - @mkdir($siteConfigPath, 0775, true); |
|
| 177 | + @mkdir($siteConfigPath, 0775, TRUE); |
|
| 178 | 178 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
| 179 | 179 | |
| 180 | 180 | // refresh site cache (otherwise site config is not found) |
| 181 | 181 | $finder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Site\SiteFinder::class); |
| 182 | - $finder->getAllSites(false); // useCache = false |
|
| 182 | + $finder->getAllSites(FALSE); // useCache = false |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | protected function initializeRepository(string $className, int $storagePid) |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | protected function importSolrDocuments(Solr $solr, string $path) |
| 196 | 196 | { |
| 197 | - $jsonDocuments = json_decode(file_get_contents($path), true); |
|
| 197 | + $jsonDocuments = json_decode(file_get_contents($path), TRUE); |
|
| 198 | 198 | |
| 199 | 199 | $updateQuery = $solr->service->createUpdate(); |
| 200 | 200 | $documents = array_map(function ($jsonDoc) use ($updateQuery) { |