Passed
Pull Request — master (#107)
by
unknown
03:07
created
Tests/Functional/Repository/DocumentRepositoryTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@
 block discarded – undo
21 21
 
22 22
         $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000);
23 23
 
24
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml');
25
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml');
26
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
24
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml');
25
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml');
26
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml');
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
 use Kitodo\Dlf\Tests\Functional\FunctionalTestCase;
9 9
 use TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage;
10 10
 
11
-class DocumentRepositoryTest extends FunctionalTestCase
12
-{
11
+class DocumentRepositoryTest extends FunctionalTestCase {
13 12
     /**
14 13
      * @var DocumentRepository
15 14
      */
Please login to merge, or discard this patch.
Tests/Functional/Common/SolrIndexingTest.php 3 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
         $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000);
38 38
         $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000);
39 39
 
40
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml');
41
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
42
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml');
40
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml');
41
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml');
42
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml');
43 43
     }
44 44
 
45 45
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
 use TYPO3\CMS\Extbase\Object\ObjectManager;
15 15
 use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
16 16
 
17
-class SolrIndexingTest extends FunctionalTestCase
18
-{
17
+class SolrIndexingTest extends FunctionalTestCase {
19 18
     /** @var PersistenceManager */
20 19
     protected $persistenceManager;
21 20
 
@@ -45,8 +44,7 @@  discard block
 block discarded – undo
45 44
     /**
46 45
      * @test
47 46
      */
48
-    public function canCreateCore()
49
-    {
47
+    public function canCreateCore() {
50 48
         $coreName = uniqid('testCore');
51 49
         $solr = Solr::getInstance($coreName);
52 50
         $this->assertNull($solr->core);
@@ -61,8 +59,7 @@  discard block
 block discarded – undo
61 59
     /**
62 60
      * @test
63 61
      */
64
-    public function canIndexAndSearchDocument()
65
-    {
62
+    public function canIndexAndSearchDocument() {
66 63
         $core = $this->createSolrCore();
67 64
 
68 65
         $document = $this->documentRepository->findByUid(1001);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,16 +80,16 @@
 block discarded – undo
80 80
             'storagePid' => $document->getPid(),
81 81
         ];
82 82
 
83
-        $result = $this->documentRepository->findSolrByCollection(null, $solrSettings, ['query' => '*']);
83
+        $result = $this->documentRepository->findSolrByCollection(NULL, $solrSettings, ['query' => '*']);
84 84
         $this->assertEquals(1, $result['numberOfToplevels']);
85 85
         $this->assertEquals(15, count($result['solrResults']['documents']));
86 86
 
87 87
         // Check that the title stored in Solr matches the title of database entry
88
-        $docTitleInSolr = false;
88
+        $docTitleInSolr = FALSE;
89 89
         foreach ($result['solrResults']['documents'] as $solrDoc) {
90 90
             if ($solrDoc['toplevel'] && $solrDoc['uid'] === $document->getUid()) {
91 91
                 $this->assertEquals($document->getTitle(), $solrDoc['title']);
92
-                $docTitleInSolr = true;
92
+                $docTitleInSolr = TRUE;
93 93
                 break;
94 94
             }
95 95
         }
Please login to merge, or discard this patch.
Build/Documentation/dbdocs/Generator.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
             // There may be a single non-signifying space after the doc-comment asterisk,
185 185
             // which is not included.
186
-            $text .= preg_replace('#\\s*/?[*/]*\\s?(.*)$#', '$1', $line) . "\n";
186
+            $text .= preg_replace('#\\s*/?[*/]*\\s?(.*)$#', '$1', $line)."\n";
187 187
         }
188 188
         $text = trim($text);
189 189
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 RST);
205 205
 
206 206
         // Sort tables alphabetically
207
-        usort($tables, function ($lhs, $rhs) {
207
+        usort($tables, function($lhs, $rhs) {
208 208
             return $lhs->name <=> $rhs->name;
209 209
         });
210 210
 
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
             // Set header
215 215
             $header = $tableInfo->name;
216 216
             if (!empty($tableInfo->feComment)) {
217
-                $header .= ': ' . $tableInfo->feComment;
217
+                $header .= ': '.$tableInfo->feComment;
218 218
             }
219 219
             $section->setHeader($header);
220 220
 
221 221
             // Set introductory text of subsection
222 222
             if ($tableInfo->modelClass) {
223
-                $section->addText('Extbase domain model: ``' . $tableInfo->modelClass . '``');
223
+                $section->addText('Extbase domain model: ``'.$tableInfo->modelClass.'``');
224 224
             }
225 225
             $section->addText($tableInfo->classComment);
226 226
             $section->addText($tableInfo->sqlComment);
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                 'description' => 'Description',
232 232
             ]];
233 233
 
234
-            $rows = array_map(function ($column) use ($page) {
234
+            $rows = array_map(function($column) use ($page) {
235 235
                 return [
236 236
                     'field' => (
237 237
                         $page->format($column->name, ['bold' => $column->isPrimary])
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
  * @subpackage dlf
33 33
  * @access public
34 34
  */
35
-class Generator
36
-{
35
+class Generator {
37 36
     /**
38 37
      * @var ObjectManager
39 38
      */
@@ -49,8 +48,7 @@  discard block
 block discarded – undo
49 48
      */
50 49
     protected $dataMapper;
51 50
 
52
-    public function __construct()
53
-    {
51
+    public function __construct() {
54 52
         $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
55 53
         $this->languageService = $this->objectManager->get(LanguageService::class);
56 54
         $this->dataMapper = $this->objectManager->get(DataMapper::class);
@@ -167,8 +165,7 @@  discard block
 block discarded – undo
167 165
         return $result;
168 166
     }
169 167
 
170
-    protected function parseDocComment($docComment)
171
-    {
168
+    protected function parseDocComment($docComment) {
172 169
         // TODO: Consider using phpDocumentor (though that splits the docblock into summary and description)
173 170
 
174 171
         // Adopted from DocCommentParser in TYPO3 v9
@@ -193,8 +190,7 @@  discard block
 block discarded – undo
193 190
     /**
194 191
      * Transform table structure into .rst page.
195 192
      */
196
-    public function generatePage(array $tables)
197
-    {
193
+    public function generatePage(array $tables) {
198 194
         $page = new RstSection();
199 195
         $page->setHeader('Database Tables');
200 196
         $page->addText(<<<RST
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function collectTables(): array
64 64
     {
65 65
         $sqlReader = $this->objectManager->get(SqlReader::class);
66
-        $sqlCode = $sqlReader->getTablesDefinitionString(true);
66
+        $sqlCode = $sqlReader->getTablesDefinitionString(TRUE);
67 67
         $createTableStatements = $sqlReader->getCreateTableStatementArray($sqlCode);
68 68
 
69 69
         $tableToClassName = $this->getTableClassMap();
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 continue;
80 80
             }
81 81
 
82
-            $className = $tableToClassName[$tableName] ?? null;
82
+            $className = $tableToClassName[$tableName] ?? NULL;
83 83
 
84 84
             $result[] = $this->getTableInfo($table, $className);
85 85
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $isPrimary = [];
121 121
         if (!is_null($primaryKey = $table->getPrimaryKey())) {
122 122
             foreach ($primaryKey->getUnquotedColumns() as $primaryColumn) {
123
-                $isPrimary[$primaryColumn] = true;
123
+                $isPrimary[$primaryColumn] = TRUE;
124 124
             }
125 125
         }
126 126
 
@@ -141,21 +141,21 @@  discard block
 block discarded – undo
141 141
         $result = (object) [
142 142
             'name' => $tableName,
143 143
             'columns' => $columns,
144
-            'modelClass' => null,
144
+            'modelClass' => NULL,
145 145
             'sqlComment' => $table->getComment() ?? '',
146 146
             'classComment' => '',
147 147
             'feComment' => $this->languageService->sL($GLOBALS['TCA'][$tableName]['ctrl']['title'] ?? ''),
148 148
         ];
149 149
 
150 150
         // Integrate doc-comments from model class and its fields
151
-        if ($className !== null) {
151
+        if ($className !== NULL) {
152 152
             $reflection = new ReflectionClass($className);
153 153
 
154 154
             $dataMap = $this->dataMapper->getDataMap($className);
155 155
 
156 156
             foreach ($reflection->getProperties() as $property) {
157 157
                 $column = $dataMap->getColumnMap($property->getName());
158
-                if ($column !== null) {
158
+                if ($column !== NULL) {
159 159
                     $result->columns[$column->getColumnName()]->fieldComment = $this->parseDocComment($property->getDocComment());
160 160
                 }
161 161
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $lines = explode("\n", $docComment);
178 178
         foreach ($lines as $line) {
179 179
             // Stop parsing at first tag
180
-            if ($line !== '' && strpos($line, '@') !== false) {
180
+            if ($line !== '' && strpos($line, '@') !== FALSE) {
181 181
                 break;
182 182
             }
183 183
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 This is a reference of all database tables defined by Kitodo.Presentation.
202 202
 
203 203
 .. tip:: This page is auto-generated. If you would like to edit it, please use doc-comments in the model class, COMMENT fields in ``ext_tables.sql`` if the table does not have one, or TCA labels. Then, you may re-generate the page by running ``composer docs:db`` inside the Kitodo.Presentation base folder.
204
-RST);
204
+rst);
205 205
 
206 206
         // Sort tables alphabetically
207 207
         usort($tables, function ($lhs, $rhs) {
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
                     'field' => (
237 237
                         $page->format($column->name, ['bold' => $column->isPrimary])
238 238
                         . "\u{00a0}\u{00a0}"
239
-                        . $page->format($column->type->getName(), ['italic' => true])
239
+                        . $page->format($column->type->getName(), ['italic' => TRUE])
240 240
                     ),
241 241
 
242 242
                     'description' => $page->paragraphs([
243
-                        $page->format($column->feComment, ['italic' => true]),
243
+                        $page->format($column->feComment, ['italic' => TRUE]),
244 244
                         $column->fieldComment,
245 245
                         $column->sqlComment,
246 246
                     ]),
Please login to merge, or discard this patch.
Classes/Domain/Repository/TokenRepository.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
      *
26 26
      * @return void
27 27
      */
28
-    public function deleteExpiredTokens($expireTime)
29
-    {
28
+    public function deleteExpiredTokens($expireTime) {
30 29
         $query = $this->createQuery();
31 30
 
32 31
         $constraints = [];
Please login to merge, or discard this patch.
Classes/Domain/Repository/MailRepository.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
 class MailRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
19 19
 {
20 20
 
21
-    public function findAllWithPid($pid)
22
-    {
21
+    public function findAllWithPid($pid) {
23 22
         /** @var Typo3QuerySettings $querySettings */
24 23
         $querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
25 24
 
Please login to merge, or discard this patch.
Classes/Domain/Model/Metadata.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -109,14 +109,12 @@  discard block
 block discarded – undo
109 109
     /**
110 110
      * constructor
111 111
      */
112
-    public function __construct()
113
-    {
112
+    public function __construct() {
114 113
         // Do not remove the next line: It would break the functionality
115 114
         $this->initStorageObjects();
116 115
     }
117 116
 
118
-    protected function initStorageObjects()
119
-    {
117
+    protected function initStorageObjects() {
120 118
         $this->format = new ObjectStorage();
121 119
     }
122 120
 
@@ -187,8 +185,7 @@  discard block
 block discarded – undo
187 185
     /**
188 186
      * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> $format
189 187
      */
190
-    public function getFormat()
191
-    {
188
+    public function getFormat() {
192 189
         return $this->format;
193 190
     }
194 191
 
@@ -207,8 +204,7 @@  discard block
 block discarded – undo
207 204
      *
208 205
      * @return void
209 206
      */
210
-    public function addFormat(MetadataFormat $format)
211
-    {
207
+    public function addFormat(MetadataFormat $format) {
212 208
         $this->format->attach($format);
213 209
     }
214 210
 
@@ -219,8 +215,7 @@  discard block
 block discarded – undo
219 215
      *
220 216
      * @return void
221 217
      */
222
-    public function removeFormat(MetadataFormat $formatToRemove)
223
-    {
218
+    public function removeFormat(MetadataFormat $formatToRemove) {
224 219
         $this->format->detach($formatToRemove);
225 220
     }
226 221
 
Please login to merge, or discard this patch.
Classes/Format/TeiHeader.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
32 32
      *
33 33
      * @return void
34 34
      */
35
-    public function extractMetadata(\SimpleXMLElement $xml, array &$metadata)
36
-    {
35
+    public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) {
37 36
         $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0');
38 37
     }
39 38
 }
Please login to merge, or discard this patch.
Classes/Controller/Backend/NewTenantController.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     public function addFormatAction()
159 159
     {
160 160
         // Include formats definition file.
161
-        $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php');
161
+        $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php');
162 162
 
163 163
         $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK);
164 164
         // tx_dlf_formats are stored on PID = 0
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     public function addMetadataAction()
197 197
     {
198 198
         // Include metadata definition file.
199
-        $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php');
199
+        $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php');
200 200
 
201 201
         $doPersist = false;
202 202
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             if ($this->metadataRepository->findOneByIndexName($indexName) === null) {
209 209
 
210 210
                 $newRecord = GeneralUtility::makeInstance(Metadata::class);
211
-                $newRecord->setLabel($this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels));
211
+                $newRecord->setLabel($this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels));
212 212
                 $newRecord->setIndexName($indexName);
213 213
                 $newRecord->setDefaultValue($values['default_value']);
214 214
                 $newRecord->setWrap($values['wrap'] ? : $GLOBALS['TCA']['tx_dlf_metadata']['columns']['wrap']['config']['default']);
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                     $translatedRecord = GeneralUtility::makeInstance(Metadata::class);
244 244
                     $translatedRecord->setL18nParent($newRecord);
245 245
                     $translatedRecord->_setProperty('_languageUid', $siteLanguage->getLanguageId());
246
-                    $translatedRecord->setLabel($this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels));
246
+                    $translatedRecord->setLabel($this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels));
247 247
                     $translatedRecord->setIndexName($indexName);
248 248
                     $translatedRecord->setWrap($newRecord->getWrap());
249 249
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
         if ($this->solrCoreRepository->findOneByPid($this->pid) === null) {
279 279
             $newRecord = GeneralUtility::makeInstance(SolrCore::class);
280
-            $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')');
280
+            $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')');
281 281
             $indexName = Solr::createCore('');
282 282
             $newRecord->setIndexName($indexName);
283 283
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     public function addStructureAction()
302 302
     {
303 303
         // Include structure definition file.
304
-        $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php');
304
+        $structureDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php');
305 305
 
306 306
         $doPersist = false;
307 307
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
             // if default format record is not found, add it to the repository
313 313
             if ($this->structureRepository->findOneByIndexName($indexName) === null) {
314 314
                 $newRecord = GeneralUtility::makeInstance(Structure::class);
315
-                $newRecord->setLabel($this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structLabels));
315
+                $newRecord->setLabel($this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structLabels));
316 316
                 $newRecord->setIndexName($indexName);
317 317
                 $newRecord->setToplevel($values['toplevel']);
318 318
                 $newRecord->setOaiName($values['oai_name']);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                     $translatedRecord = GeneralUtility::makeInstance(Structure::class);
327 327
                     $translatedRecord->setL18nParent($newRecord);
328 328
                     $translatedRecord->_setProperty('_languageUid', $siteLanguage->getLanguageId());
329
-                    $translatedRecord->setLabel($this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structLabels));
329
+                    $translatedRecord->setLabel($this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structLabels));
330 330
                     $translatedRecord->setIndexName($indexName);
331 331
 
332 332
                     $this->structureRepository->add($translatedRecord);
@@ -378,15 +378,15 @@  discard block
 block discarded – undo
378 378
             $this->forward('error');
379 379
         }
380 380
 
381
-        $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php');
381
+        $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/FormatDefaults.php');
382 382
         $recordInfos['formats']['numCurrent'] = $this->formatRepository->countAll();
383 383
         $recordInfos['formats']['numDefault'] = count($formatsDefaults);
384 384
 
385
-        $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php');
385
+        $structuresDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/StructureDefaults.php');
386 386
         $recordInfos['structures']['numCurrent'] = $this->structureRepository->countByPid($this->pid);
387 387
         $recordInfos['structures']['numDefault'] = count($structuresDefaults);
388 388
 
389
-        $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php');
389
+        $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf').'Resources/Private/Data/MetadataDefaults.php');
390 390
         $recordInfos['metadata']['numCurrent'] = $this->metadataRepository->countByPid($this->pid);
391 391
         $recordInfos['metadata']['numDefault'] = count($metadataDefaults);
392 392
 
Please login to merge, or discard this patch.
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
  * @subpackage dlf
45 45
  * @access public
46 46
  */
47
-class NewTenantController extends AbstractController
48
-{
47
+class NewTenantController extends AbstractController {
49 48
     /**
50 49
      * @var int
51 50
      */
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
     /**
86 85
      * @param FormatRepository $formatRepository
87 86
      */
88
-    public function injectFormatRepository(FormatRepository $formatRepository)
89
-    {
87
+    public function injectFormatRepository(FormatRepository $formatRepository) {
90 88
         $this->formatRepository = $formatRepository;
91 89
     }
92 90
 
@@ -98,8 +96,7 @@  discard block
 block discarded – undo
98 96
     /**
99 97
      * @param MetadataRepository $metadataRepository
100 98
      */
101
-    public function injectMetadataRepository(MetadataRepository $metadataRepository)
102
-    {
99
+    public function injectMetadataRepository(MetadataRepository $metadataRepository) {
103 100
         $this->metadataRepository = $metadataRepository;
104 101
     }
105 102
 
@@ -111,8 +108,7 @@  discard block
 block discarded – undo
111 108
     /**
112 109
      * @param StructureRepository $structureRepository
113 110
      */
114
-    public function injectStructureRepository(StructureRepository $structureRepository)
115
-    {
111
+    public function injectStructureRepository(StructureRepository $structureRepository) {
116 112
         $this->structureRepository = $structureRepository;
117 113
     }
118 114
 
@@ -124,8 +120,7 @@  discard block
 block discarded – undo
124 120
     /**
125 121
      * @param SolrCoreRepository $solrCoreRepository
126 122
      */
127
-    public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository)
128
-    {
123
+    public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) {
129 124
         $this->solrCoreRepository = $solrCoreRepository;
130 125
     }
131 126
 
@@ -133,8 +128,7 @@  discard block
 block discarded – undo
133 128
      * Initialization for all actions
134 129
      *
135 130
      */
136
-    protected function initializeAction()
137
-    {
131
+    protected function initializeAction() {
138 132
         $this->pid = (int) GeneralUtility::_GP('id');
139 133
 
140 134
         $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK);
@@ -155,8 +149,7 @@  discard block
 block discarded – undo
155 149
     /**
156 150
      * Action adding formats records
157 151
      */
158
-    public function addFormatAction()
159
-    {
152
+    public function addFormatAction() {
160 153
         // Include formats definition file.
161 154
         $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php');
162 155
 
@@ -193,8 +186,7 @@  discard block
 block discarded – undo
193 186
     /**
194 187
      * Action adding metadata records
195 188
      */
196
-    public function addMetadataAction()
197
-    {
189
+    public function addMetadataAction() {
198 190
         // Include metadata definition file.
199 191
         $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php');
200 192
 
@@ -268,8 +260,7 @@  discard block
 block discarded – undo
268 260
     /**
269 261
      * Action adding Solr core records
270 262
      */
271
-    public function addSolrCoreAction()
272
-    {
263
+    public function addSolrCoreAction() {
273 264
         $doPersist = false;
274 265
 
275 266
         // load language file in own array
@@ -298,8 +289,7 @@  discard block
 block discarded – undo
298 289
     /**
299 290
      * Action adding structure records
300 291
      */
301
-    public function addStructureAction()
302
-    {
292
+    public function addStructureAction() {
303 293
         // Include structure definition file.
304 294
         $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php');
305 295
 
@@ -351,8 +341,7 @@  discard block
 block discarded – undo
351 341
      * @param ViewInterface $view
352 342
      * @return void
353 343
      */
354
-    protected function initializeView(ViewInterface $view)
355
-    {
344
+    protected function initializeView(ViewInterface $view) {
356 345
         /** @var BackendTemplateView $view */
357 346
         parent::initializeView($view);
358 347
         if ($this->actionMethodName == 'indexAction') {
@@ -370,8 +359,7 @@  discard block
 block discarded – undo
370 359
      * @access public
371 360
      *
372 361
      */
373
-    public function indexAction()
374
-    {
362
+    public function indexAction() {
375 363
         $recordInfos = [];
376 364
 
377 365
         if ($this->pageInfo['doktype'] != 254) {
@@ -401,8 +389,7 @@  discard block
 block discarded – undo
401 389
      * @access public
402 390
      *
403 391
      */
404
-    public function errorAction()
405
-    {
392
+    public function errorAction() {
406 393
     }
407 394
 
408 395
     /**
@@ -414,8 +401,7 @@  discard block
 block discarded – undo
414 401
      *
415 402
      * @access public
416 403
      */
417
-    protected function getLLL($index, $lang, $langArray)
418
-    {
404
+    protected function getLLL($index, $lang, $langArray) {
419 405
         if (isset($langArray[$lang][$index][0]['target'])) {
420 406
             return $langArray[$lang][$index][0]['target'];
421 407
         } else {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
         $frameworkConfiguration['persistence']['storagePid'] = 0;
166 166
         $this->configurationManager->setConfiguration($frameworkConfiguration);
167 167
 
168
-        $doPersist = false;
168
+        $doPersist = FALSE;
169 169
 
170 170
         foreach ($formatsDefaults as $type => $values) {
171 171
             // if default format record is not found, add it to the repository
172
-            if ($this->formatRepository->findOneByType($type) === null) {
172
+            if ($this->formatRepository->findOneByType($type) === NULL) {
173 173
                 $newRecord = GeneralUtility::makeInstance(Format::class);
174 174
                 $newRecord->setType($type);
175 175
                 $newRecord->setRoot($values['root']);
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
                 $newRecord->setClass($values['class']);
178 178
                 $this->formatRepository->add($newRecord);
179 179
 
180
-                $doPersist = true;
180
+                $doPersist = TRUE;
181 181
             }
182 182
         }
183 183
 
184 184
         // We must persist here, if we changed anything.
185
-        if ($doPersist === true) {
185
+        if ($doPersist === TRUE) {
186 186
             $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);
187 187
             $persistenceManager->persistAll();
188 188
         }
@@ -198,14 +198,14 @@  discard block
 block discarded – undo
198 198
         // Include metadata definition file.
199 199
         $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php');
200 200
 
201
-        $doPersist = false;
201
+        $doPersist = FALSE;
202 202
 
203 203
         // load language file in own array
204 204
         $metadataLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_metadata.xlf', $this->siteLanguages[0]->getTypo3Language());
205 205
 
206 206
         foreach ($metadataDefaults as $indexName => $values) {
207 207
             // if default format record is not found, add it to the repository
208
-            if ($this->metadataRepository->findOneByIndexName($indexName) === null) {
208
+            if ($this->metadataRepository->findOneByIndexName($indexName) === NULL) {
209 209
 
210 210
                 $newRecord = GeneralUtility::makeInstance(Metadata::class);
211 211
                 $newRecord->setLabel($this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels));
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                     foreach ($values['format'] as $format) {
226 226
                         $formatRecord = $this->formatRepository->findOneByRoot($format['format_root']);
227 227
                         // If formatRecord is null, we cannot create a MetadataFormat record.
228
-                        if ($formatRecord !== null) {
228
+                        if ($formatRecord !== NULL) {
229 229
                             $newMetadataFormat = GeneralUtility::makeInstance(MetadataFormat::class);
230 230
                             $newMetadataFormat->setEncoded($formatRecord->getUid());
231 231
                             $newMetadataFormat->setXpath($format['xpath']);
@@ -252,12 +252,12 @@  discard block
 block discarded – undo
252 252
 
253 253
                 $this->metadataRepository->add($newRecord);
254 254
 
255
-                $doPersist = true;
255
+                $doPersist = TRUE;
256 256
             }
257 257
         }
258 258
 
259 259
         // We must persist here, if we changed anything.
260
-        if ($doPersist === true) {
260
+        if ($doPersist === TRUE) {
261 261
             $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);
262 262
             $persistenceManager->persistAll();
263 263
         }
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
      */
271 271
     public function addSolrCoreAction()
272 272
     {
273
-        $doPersist = false;
273
+        $doPersist = FALSE;
274 274
 
275 275
         // load language file in own array
276 276
         $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language());
277 277
 
278
-        if ($this->solrCoreRepository->findOneByPid($this->pid) === null) {
278
+        if ($this->solrCoreRepository->findOneByPid($this->pid) === NULL) {
279 279
             $newRecord = GeneralUtility::makeInstance(SolrCore::class);
280 280
             $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')');
281 281
             $indexName = Solr::createCore('');
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
 
284 284
             $this->solrCoreRepository->add($newRecord);
285 285
 
286
-            $doPersist = true;
286
+            $doPersist = TRUE;
287 287
         }
288 288
 
289 289
         // We must persist here, if we changed anything.
290
-        if ($doPersist === true) {
290
+        if ($doPersist === TRUE) {
291 291
             $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);
292 292
             $persistenceManager->persistAll();
293 293
         }
@@ -303,14 +303,14 @@  discard block
 block discarded – undo
303 303
         // Include structure definition file.
304 304
         $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php');
305 305
 
306
-        $doPersist = false;
306
+        $doPersist = FALSE;
307 307
 
308 308
         // load language file in own array
309 309
         $structLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_structure.xlf', $this->siteLanguages[0]->getTypo3Language());
310 310
 
311 311
         foreach ($structureDefaults as $indexName => $values) {
312 312
             // if default format record is not found, add it to the repository
313
-            if ($this->structureRepository->findOneByIndexName($indexName) === null) {
313
+            if ($this->structureRepository->findOneByIndexName($indexName) === NULL) {
314 314
                 $newRecord = GeneralUtility::makeInstance(Structure::class);
315 315
                 $newRecord->setLabel($this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structLabels));
316 316
                 $newRecord->setIndexName($indexName);
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
                     $this->structureRepository->add($translatedRecord);
333 333
                 }
334 334
 
335
-                $doPersist = true;
335
+                $doPersist = TRUE;
336 336
             }
337 337
         }
338 338
 
339 339
         // We must persist here, if we changed anything.
340
-        if ($doPersist === true) {
340
+        if ($doPersist === TRUE) {
341 341
             $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);
342 342
             $persistenceManager->persistAll();
343 343
         }
Please login to merge, or discard this patch.
Classes/Eid/SearchInDocument.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
      */
121 121
     private function getQuery($fields, $parameters)
122 122
     {
123
-        return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']);
123
+        return $fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$fields['uid'].':'.$this->getUid($parameters['uid']);
124 124
     }
125 125
 
126 126
     /**
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,16 +28,14 @@  discard block
 block discarded – undo
28 28
  * @subpackage dlf
29 29
  * @access public
30 30
  */
31
-class SearchInDocument
32
-{
31
+class SearchInDocument {
33 32
     /**
34 33
      * The main method of the eID script
35 34
      *
36 35
      * @param ServerRequestInterface $request
37 36
      * @return ResponseInterface JSON response of search suggestions
38 37
      */
39
-    public function main(ServerRequestInterface $request)
40
-    {
38
+    public function main(ServerRequestInterface $request) {
41 39
         $output = [
42 40
             'documents' => [],
43 41
             'numFound' => 0
@@ -118,8 +116,7 @@  discard block
 block discarded – undo
118 116
      *
119 117
      * @return string SOLR query
120 118
      */
121
-    private function getQuery($fields, $parameters)
122
-    {
119
+    private function getQuery($fields, $parameters) {
123 120
         return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']);
124 121
     }
125 122
 
@@ -133,8 +130,7 @@  discard block
 block discarded – undo
133 130
      *
134 131
      * @return int|string uid of the document
135 132
      */
136
-    private function getUid($uid)
137
-    {
133
+    private function getUid($uid) {
138 134
         return is_numeric($uid) ? intval($uid) : $uid;
139 135
     }
140 136
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         ];
45 45
         // Get input parameters and decrypt core name.
46 46
         $parameters = $request->getParsedBody();
47
-        if ($parameters === null) {
47
+        if ($parameters === NULL) {
48 48
             throw new \InvalidArgumentException('No parameters passed!', 1632322297);
49 49
         }
50 50
         $encrypted = (string) $parameters['encrypted'];
Please login to merge, or discard this patch.