@@ -30,8 +30,7 @@ |
||
30 | 30 | * |
31 | 31 | * @access public |
32 | 32 | */ |
33 | -class Library extends AbstractEntity |
|
34 | -{ |
|
33 | +class Library extends AbstractEntity { |
|
35 | 34 | /** |
36 | 35 | * @access protected |
37 | 36 | * @var string |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class PageSelectForm extends AbstractEntity |
|
26 | -{ |
|
25 | +class PageSelectForm extends AbstractEntity { |
|
27 | 26 | /** |
28 | 27 | * @access protected |
29 | 28 | * @var integer |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class ActionLog extends AbstractEntity |
|
26 | -{ |
|
25 | +class ActionLog extends AbstractEntity { |
|
27 | 26 | /** |
28 | 27 | * @access protected |
29 | 28 | * @var int |
@@ -24,8 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class SolrCore extends AbstractEntity |
|
28 | -{ |
|
27 | +class SolrCore extends AbstractEntity { |
|
29 | 28 | /** |
30 | 29 | * @access protected |
31 | 30 | * @var int |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $output = []; |
56 | 56 | $solrCore = (string) $parameters['solrcore']; |
57 | 57 | $uHash = (string) $parameters['uHash']; |
58 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
58 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
59 | 59 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
60 | 60 | } |
61 | 61 | // Perform Solr query. |
@@ -30,8 +30,7 @@ |
||
30 | 30 | * |
31 | 31 | * @access public |
32 | 32 | */ |
33 | -class SearchSuggest implements MiddlewareInterface |
|
34 | -{ |
|
33 | +class SearchSuggest implements MiddlewareInterface { |
|
35 | 34 | /** |
36 | 35 | * The process method of the middleware. |
37 | 36 | * |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $output = []; |
56 | 56 | $solrCore = (string) $parameters['solrcore']; |
57 | 57 | $uHash = (string) $parameters['uHash']; |
58 | - if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) { |
|
58 | + if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === FALSE) { |
|
59 | 59 | throw new \InvalidArgumentException('No valid parameter passed!', 1580585079); |
60 | 60 | } |
61 | 61 | // Perform Solr query. |
@@ -152,7 +152,7 @@ |
||
152 | 152 | // field for which highlighting is going to be performed, |
153 | 153 | // is required if you want to have OCR highlighting |
154 | 154 | $solrRequest->addParam('hl.ocr.fl', $this->fields['fulltext']); |
155 | - // return the coordinates of highlighted search as absolute coordinates |
|
155 | + // return the coordinates of highlighted search as absolute coordinates |
|
156 | 156 | $solrRequest->addParam('hl.ocr.absoluteHighlights', 'on'); |
157 | 157 | // max amount of snippets for a single page |
158 | 158 | $solrRequest->addParam('hl.snippets', '40'); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $encrypted = (string) $parameters['encrypted']; |
73 | 73 | if (empty($encrypted)) { |
74 | - throw new \InvalidArgumentException('No valid parameter passed: ' . $parameters['middleware'] . ' ' . $parameters['encrypted'] . '!', 1580585079); |
|
74 | + throw new \InvalidArgumentException('No valid parameter passed: '.$parameters['middleware'].' '.$parameters['encrypted'].'!', 1580585079); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $output = [ |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | private function getQuery(array $parameters): string |
176 | 176 | { |
177 | - return $this->fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $this->fields['uid'] . ':' . $this->getUid($parameters['uid']); |
|
177 | + return $this->fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$this->fields['uid'].':'.$this->getUid($parameters['uid']); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @access public |
33 | 33 | */ |
34 | -class SearchInDocument implements MiddlewareInterface |
|
35 | -{ |
|
34 | +class SearchInDocument implements MiddlewareInterface { |
|
36 | 35 | /** |
37 | 36 | * This holds the solr instance |
38 | 37 | * |
@@ -136,8 +135,7 @@ discard block |
||
136 | 135 | * |
137 | 136 | * @return \Solarium\Core\Query\Result\ResultInterface result |
138 | 137 | */ |
139 | - private function executeSolrQuery($parameters) |
|
140 | - { |
|
138 | + private function executeSolrQuery($parameters) { |
|
141 | 139 | $query = $this->solr->service->createSelect(); |
142 | 140 | $query->setFields([$this->fields['id'], $this->fields['uid'], $this->fields['page']]); |
143 | 141 | $query->setQuery($this->getQuery($parameters)); |
@@ -187,8 +185,7 @@ discard block |
||
187 | 185 | * |
188 | 186 | * @return int|string uid of the document |
189 | 187 | */ |
190 | - private function getUid(string $uid) |
|
191 | - { |
|
188 | + private function getUid(string $uid) { |
|
192 | 189 | return is_numeric($uid) ? intval($uid) : $uid; |
193 | 190 | } |
194 | 191 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_metadata.wrap', |
144 | 144 | 'config' => [ |
145 | 145 | 'behaviour' => [ |
146 | - 'allowLanguageSynchronization' => true |
|
146 | + 'allowLanguageSynchronization' => TRUE |
|
147 | 147 | ], |
148 | 148 | 'type' => 'text', |
149 | 149 | 'cols' => 48, |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | 'wrap' => 'off', |
152 | 152 | 'eval' => 'trim', |
153 | 153 | 'default' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.wrap = <dd>|</dd>", |
154 | - 'fixedFont' => true, |
|
155 | - 'enableTabulator' => true |
|
154 | + 'fixedFont' => TRUE, |
|
155 | + 'enableTabulator' => TRUE |
|
156 | 156 | ], |
157 | 157 | ], |
158 | 158 | 'index_tokenized' => [ |
@@ -157,14 +157,14 @@ |
||
157 | 157 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_collections.description', |
158 | 158 | 'config' => [ |
159 | 159 | 'behaviour' => [ |
160 | - 'allowLanguageSynchronization' => true |
|
160 | + 'allowLanguageSynchronization' => TRUE |
|
161 | 161 | ], |
162 | 162 | 'type' => 'text', |
163 | 163 | 'cols' => 30, |
164 | 164 | 'rows' => 10, |
165 | 165 | 'wrap' => 'virtual', |
166 | 166 | 'default' => '', |
167 | - 'enableRichtext' => true, |
|
167 | + 'enableRichtext' => TRUE, |
|
168 | 168 | ], |
169 | 169 | ], |
170 | 170 | 'thumbnail' => [ |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | * @subpackage dlf |
33 | 33 | * @access public |
34 | 34 | */ |
35 | -class Generator |
|
36 | -{ |
|
35 | +class Generator { |
|
37 | 36 | /** |
38 | 37 | * @var LanguageService |
39 | 38 | */ |
@@ -57,37 +56,32 @@ discard block |
||
57 | 56 | /** |
58 | 57 | * @param LanguageService $languageService |
59 | 58 | */ |
60 | - public function injectLanguageService(LanguageService $languageService) |
|
61 | - { |
|
59 | + public function injectLanguageService(LanguageService $languageService) { |
|
62 | 60 | $this->languageService = $languageService; |
63 | 61 | } |
64 | 62 | |
65 | 63 | /** |
66 | 64 | * @param DataMapper $dataMapper |
67 | 65 | */ |
68 | - public function injectDataMapper(DataMapper $dataMapper) |
|
69 | - { |
|
66 | + public function injectDataMapper(DataMapper $dataMapper) { |
|
70 | 67 | $this->dataMapper = $dataMapper; |
71 | 68 | } |
72 | 69 | |
73 | 70 | /** |
74 | 71 | * @param SqlReader $sqlReader |
75 | 72 | */ |
76 | - public function injectSqlReader(DataMapper $sqlReader) |
|
77 | - { |
|
73 | + public function injectSqlReader(DataMapper $sqlReader) { |
|
78 | 74 | $this->sqlReader = $sqlReader; |
79 | 75 | } |
80 | 76 | |
81 | 77 | /** |
82 | 78 | * @param ConfigurationManager $configurationManager |
83 | 79 | */ |
84 | - public function injectConfigurationManager(ConfigurationManager $configurationManager) |
|
85 | - { |
|
80 | + public function injectConfigurationManager(ConfigurationManager $configurationManager) { |
|
86 | 81 | $this->configurationManager = $configurationManager; |
87 | 82 | } |
88 | 83 | |
89 | - public function __construct() |
|
90 | - { |
|
84 | + public function __construct() { |
|
91 | 85 | |
92 | 86 | } |
93 | 87 | |
@@ -205,8 +199,7 @@ discard block |
||
205 | 199 | return $result; |
206 | 200 | } |
207 | 201 | |
208 | - protected function parseDocComment($docComment) |
|
209 | - { |
|
202 | + protected function parseDocComment($docComment) { |
|
210 | 203 | // TODO: Consider using phpDocumentor (though that splits the docblock into summary and description) |
211 | 204 | |
212 | 205 | // Adopted from DocCommentParser in TYPO3 v9 |
@@ -231,8 +224,7 @@ discard block |
||
231 | 224 | /** |
232 | 225 | * Transform table structure into .rst page. |
233 | 226 | */ |
234 | - public function generatePage(array $tables) |
|
235 | - { |
|
227 | + public function generatePage(array $tables) { |
|
236 | 228 | $page = new RstSection(); |
237 | 229 | $page->setHeader('Database Tables'); |
238 | 230 | $page->addText(<<<RST |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function collectTables(): array |
99 | 99 | { |
100 | - $sqlCode = $this->sqlReader->getTablesDefinitionString(true); |
|
100 | + $sqlCode = $this->sqlReader->getTablesDefinitionString(TRUE); |
|
101 | 101 | $createTableStatements = $this->sqlReader->getCreateTableStatementArray($sqlCode); |
102 | 102 | |
103 | 103 | $tableToClassName = $this->getTableClassMap(); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | continue; |
114 | 114 | } |
115 | 115 | |
116 | - $className = $tableToClassName[$tableName] ?? null; |
|
116 | + $className = $tableToClassName[$tableName] ?? NULL; |
|
117 | 117 | |
118 | 118 | $result[] = $this->getTableInfo($table, $className); |
119 | 119 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $isPrimary = []; |
152 | 152 | if (!is_null($primaryKey = $table->getPrimaryKey())) { |
153 | 153 | foreach ($primaryKey->getUnquotedColumns() as $primaryColumn) { |
154 | - $isPrimary[$primaryColumn] = true; |
|
154 | + $isPrimary[$primaryColumn] = TRUE; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
@@ -172,14 +172,14 @@ discard block |
||
172 | 172 | $result = (object) [ |
173 | 173 | 'name' => $tableName, |
174 | 174 | 'columns' => $columns, |
175 | - 'modelClass' => null, |
|
175 | + 'modelClass' => NULL, |
|
176 | 176 | 'sqlComment' => $table->getComment() ?? '', |
177 | 177 | 'classComment' => '', |
178 | 178 | 'feComment' => $this->languageService->sL($GLOBALS['TCA'][$tableName]['ctrl']['title'] ?? ''), |
179 | 179 | ]; |
180 | 180 | |
181 | 181 | // Integrate doc-comments from model class and its fields |
182 | - if ($className !== null) { |
|
182 | + if ($className !== NULL) { |
|
183 | 183 | $reflection = new ReflectionClass($className); |
184 | 184 | |
185 | 185 | $dataMap = $this->dataMapper->getDataMap($className); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | // In that case, try to guess the column name from the property name. |
190 | 190 | |
191 | 191 | $column = $dataMap->getColumnMap($property->getName()); |
192 | - $columnName = $column === null |
|
192 | + $columnName = $column === NULL |
|
193 | 193 | ? GeneralUtility::camelCaseToLowerCaseUnderscored($property->getName()) |
194 | 194 | : $column->getColumnName(); |
195 | 195 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $lines = explode("\n", $docComment); |
216 | 216 | foreach ($lines as $line) { |
217 | 217 | // Stop parsing at first tag |
218 | - if ($line !== '' && strpos($line, '@') !== false) { |
|
218 | + if ($line !== '' && strpos($line, '@') !== FALSE) { |
|
219 | 219 | break; |
220 | 220 | } |
221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | This is a reference of all database tables defined by Kitodo.Presentation. |
240 | 240 | |
241 | 241 | .. 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. |
242 | -RST); |
|
242 | +rst); |
|
243 | 243 | |
244 | 244 | // Sort tables alphabetically |
245 | 245 | usort($tables, function ($lhs, $rhs) { |
@@ -274,11 +274,11 @@ discard block |
||
274 | 274 | 'field' => ( |
275 | 275 | $page->format($column->name, ['bold' => $column->isPrimary]) |
276 | 276 | . "\u{00a0}\u{00a0}" |
277 | - . $page->format($column->type->getName(), ['italic' => true]) |
|
277 | + . $page->format($column->type->getName(), ['italic' => TRUE]) |
|
278 | 278 | ), |
279 | 279 | |
280 | 280 | 'description' => $page->paragraphs([ |
281 | - $page->format($column->feComment, ['italic' => true]), |
|
281 | + $page->format($column->feComment, ['italic' => TRUE]), |
|
282 | 282 | $column->fieldComment, |
283 | 283 | $column->sqlComment, |
284 | 284 | ]), |