Passed
Pull Request — master (#91)
by Alexander
02:40
created
Classes/Plugin/Tools/PdfDownloadTool.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage dlf
26 26
  * @access public
27 27
  */
28
-class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin
29
-{
28
+class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin {
30 29
     public $scriptRelPath = 'Classes/Plugin/Tools/PdfDownloadTool.php';
31 30
 
32 31
     /**
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
      *
40 39
      * @return string The content that is displayed on the website
41 40
      */
42
-    public function main($content, $conf)
43
-    {
41
+    public function main($content, $conf) {
44 42
         $this->init($conf);
45 43
         // Merge configuration with conf array of toolbox.
46 44
         if (!empty($this->cObj->data['conf'])) {
@@ -90,8 +88,7 @@  discard block
 block discarded – undo
90 88
      *
91 89
      * @return string Link to downloadable page
92 90
      */
93
-    protected function getPageLink()
94
-    {
91
+    protected function getPageLink() {
95 92
         $page1Link = '';
96 93
         $page2Link = '';
97 94
         $pageNumber = $this->piVars['page'];
@@ -147,8 +144,7 @@  discard block
 block discarded – undo
147 144
      *
148 145
      * @return string Link to downloadable work
149 146
      */
150
-    protected function getWorkLink()
151
-    {
147
+    protected function getWorkLink() {
152 148
         $workLink = '';
153 149
         $fileGrpsDownload = GeneralUtility::trimExplode(',', $this->conf['fileGrpDownload']);
154 150
         // Get work link.
Please login to merge, or discard this patch.
Classes/Plugin/AudioPlayer.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
  * @subpackage dlf
27 27
  * @access public
28 28
  */
29
-class AudioPlayer extends \Kitodo\Dlf\Common\AbstractPlugin
30
-{
29
+class AudioPlayer extends \Kitodo\Dlf\Common\AbstractPlugin {
31 30
     public $scriptRelPath = 'Classes/Plugin/AudioPlayer.php';
32 31
 
33 32
     /**
@@ -45,8 +44,7 @@  discard block
 block discarded – undo
45 44
      *
46 45
      * @return void
47 46
      */
48
-    protected function addPlayerJS()
49
-    {
47
+    protected function addPlayerJS() {
50 48
         // Inline CSS.
51 49
         $inlineCSS = '#tx-dlf-audio { width: 100px; height: 100px; }';
52 50
 
@@ -80,8 +78,7 @@  discard block
 block discarded – undo
80 78
      *
81 79
      * @return string The content that is displayed on the website
82 80
      */
83
-    public function main($content, $conf)
84
-    {
81
+    public function main($content, $conf) {
85 82
         $this->init($conf);
86 83
         // Load current document.
87 84
         $this->loadDocument();
Please login to merge, or discard this patch.
Classes/Plugin/PageView.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
  * @subpackage dlf
29 29
  * @access public
30 30
  */
31
-class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
32
-{
31
+class PageView extends \Kitodo\Dlf\Common\AbstractPlugin {
33 32
     public $scriptRelPath = 'Classes/Plugin/PageView.php';
34 33
 
35 34
     /**
@@ -71,8 +70,7 @@  discard block
 block discarded – undo
71 70
      *
72 71
      * @return void
73 72
      */
74
-    protected function addViewerJS()
75
-    {
73
+    protected function addViewerJS() {
76 74
         // Viewer configuration.
77 75
         $viewerConfiguration = '
78 76
             $(document).ready(function() {
@@ -100,8 +98,7 @@  discard block
 block discarded – undo
100 98
      *
101 99
      * @return array Marker array
102 100
      */
103
-    protected function addInteraction()
104
-    {
101
+    protected function addInteraction() {
105 102
         $markerArray = [];
106 103
         if ($this->piVars['id']) {
107 104
             if ($this->conf['crop']) {
@@ -127,8 +124,7 @@  discard block
 block discarded – undo
127 124
      *
128 125
      * @return array Marker array
129 126
      */
130
-    protected function addBasketForm()
131
-    {
127
+    protected function addBasketForm() {
132 128
         $markerArray = [];
133 129
         // Add basket button
134 130
         if ($this->conf['basketButton'] && $this->conf['targetBasket'] && $this->piVars['id']) {
@@ -176,8 +172,7 @@  discard block
 block discarded – undo
176 172
      *
177 173
      * @return array URL and MIME type of image file
178 174
      */
179
-    protected function getImage($page)
180
-    {
175
+    protected function getImage($page) {
181 176
         $image = [];
182 177
         // Get @USE value of METS fileGrp.
183 178
         $fileGrpsImages = GeneralUtility::trimExplode(',', $this->conf['fileGrpImages']);
@@ -213,8 +208,7 @@  discard block
 block discarded – undo
213 208
      *
214 209
      * @return array URL and MIME type of fulltext file
215 210
      */
216
-    protected function getFulltext($page)
217
-    {
211
+    protected function getFulltext($page) {
218 212
         $fulltext = [];
219 213
         // Get fulltext link.
220 214
         $fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->conf['fileGrpFulltext']);
@@ -250,8 +244,7 @@  discard block
 block discarded – undo
250 244
      * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as
251 245
      *               some information about the canvas.
252 246
      */
253
-    protected function getAnnotationContainers($page)
254
-    {
247
+    protected function getAnnotationContainers($page) {
255 248
         if ($this->doc instanceof IiifManifest) {
256 249
             $canvasId = $this->doc->physicalStructure[$page];
257 250
             $iiif = $this->doc->getIiif();
@@ -308,8 +301,7 @@  discard block
 block discarded – undo
308 301
      *
309 302
      * @return string The content that is displayed on the website
310 303
      */
311
-    public function main($content, $conf)
312
-    {
304
+    public function main($content, $conf) {
313 305
         $this->init($conf);
314 306
         // Load current document.
315 307
         $this->loadDocument();
Please login to merge, or discard this patch.
Classes/Common/AbstractModule.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
  * @access public
25 25
  * @abstract
26 26
  */
27
-abstract class AbstractModule extends \TYPO3\CMS\Backend\Module\BaseScriptClass
28
-{
27
+abstract class AbstractModule extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
29 28
     public $extKey = 'dlf';
30 29
     public $prefixId = 'tx_dlf';
31 30
 
@@ -97,8 +96,7 @@  discard block
 block discarded – undo
97 96
      *
98 97
      * @return string
99 98
      */
100
-    protected function printContent()
101
-    {
99
+    protected function printContent() {
102 100
         $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
103 101
         $this->doc->setModuleTemplate('EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl');
104 102
         $this->doc->backPath = $GLOBALS['BACK_PATH'];
@@ -129,8 +127,7 @@  discard block
 block discarded – undo
129 127
      *
130 128
      * @return void
131 129
      */
132
-    public function __construct()
133
-    {
130
+    public function __construct() {
134 131
         $GLOBALS['LANG']->includeLLFile('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml');
135 132
         // Read extension configuration.
136 133
         if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extKey])) {
Please login to merge, or discard this patch.
Classes/Hooks/DataHandler.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
  * @subpackage dlf
32 32
  * @access public
33 33
  */
34
-class DataHandler implements LoggerAwareInterface
35
-{
34
+class DataHandler implements LoggerAwareInterface {
36 35
     use LoggerAwareTrait;
37 36
 
38 37
     /**
@@ -47,8 +46,7 @@  discard block
 block discarded – undo
47 46
      *
48 47
      * @return void
49 48
      */
50
-    public function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray)
51
-    {
49
+    public function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray) {
52 50
         if ($status == 'new') {
53 51
             switch ($table) {
54 52
                     // Field post-processing for table "tx_dlf_documents".
@@ -179,8 +177,7 @@  discard block
 block discarded – undo
179 177
      *
180 178
      * @return void
181 179
      */
182
-    public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray)
183
-    {
180
+    public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray) {
184 181
         if ($status == 'update') {
185 182
             switch ($table) {
186 183
                     // After database operations for table "tx_dlf_documents".
@@ -260,8 +257,7 @@  discard block
 block discarded – undo
260 257
      *
261 258
      * @return void
262 259
      */
263
-    public function processCmdmap_postProcess($command, $table, $id)
264
-    {
260
+    public function processCmdmap_postProcess($command, $table, $id) {
265 261
         if (
266 262
             in_array($command, ['move', 'delete', 'undelete'])
267 263
             && $table == 'tx_dlf_documents'
Please login to merge, or discard this patch.
Classes/Plugin/Search.php 1 patch
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
  * @subpackage dlf
32 32
  * @access public
33 33
  */
34
-class Search extends \Kitodo\Dlf\Common\AbstractPlugin
35
-{
34
+class Search extends \Kitodo\Dlf\Common\AbstractPlugin {
36 35
     public $scriptRelPath = 'Classes/Plugin/Search.php';
37 36
 
38 37
     /**
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      *
43 42
      * @return void
44 43
      */
45
-    protected function addAutocompleteJS()
46
-    {
44
+    protected function addAutocompleteJS() {
47 45
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
48 46
             ->getQueryBuilderForTable('tx_dlf_documents');
49 47
 
@@ -74,8 +72,7 @@  discard block
 block discarded – undo
74 72
      *
75 73
      * @return string HTML input fields with current document's UID and parent ID
76 74
      */
77
-    protected function addCurrentCollection()
78
-    {
75
+    protected function addCurrentCollection() {
79 76
         // Load current collection.
80 77
         $list = GeneralUtility::makeInstance(DocumentList::class);
81 78
         if (
@@ -107,8 +104,7 @@  discard block
 block discarded – undo
107 104
      *
108 105
      * @return string HTML input fields with current document's UID
109 106
      */
110
-    protected function addCurrentDocument()
111
-    {
107
+    protected function addCurrentDocument() {
112 108
         // Load current list object.
113 109
         $list = GeneralUtility::makeInstance(DocumentList::class);
114 110
         // Load current document.
@@ -147,8 +143,7 @@  discard block
 block discarded – undo
147 143
      *
148 144
      * @return string HTML input fields with encrypted core name and hash
149 145
      */
150
-    protected function addEncryptedCoreName()
151
-    {
146
+    protected function addEncryptedCoreName() {
152 147
         // Get core name.
153 148
         $name = Helper::getIndexNameFromUid($this->conf['solrcore'], 'tx_dlf_solrcores');
154 149
         // Encrypt core name.
@@ -170,8 +165,7 @@  discard block
 block discarded – undo
170 165
      *
171 166
      * @return string The extended search form or an empty string
172 167
      */
173
-    protected function addExtendedSearch()
174
-    {
168
+    protected function addExtendedSearch() {
175 169
         $extendedSearch = '';
176 170
         // Quit without doing anything if no fields for extended search are selected.
177 171
         if (
@@ -209,8 +203,7 @@  discard block
 block discarded – undo
209 203
      *
210 204
      * @return string HTML output of facets menu
211 205
      */
212
-    protected function addFacetsMenu()
213
-    {
206
+    protected function addFacetsMenu() {
214 207
         // Check for typoscript configuration to prevent fatal error.
215 208
         if (empty($this->conf['facetsConf.'])) {
216 209
             $this->logger->warning('Incomplete plugin configuration');
@@ -244,8 +237,7 @@  discard block
 block discarded – undo
244 237
      *
245 238
      * @return string HTML output of fulltext switch
246 239
      */
247
-    protected function addFulltextSwitch($isFulltextSearch = 0)
248
-    {
240
+    protected function addFulltextSwitch($isFulltextSearch = 0) {
249 241
         $output = '';
250 242
         // Check for plugin configuration.
251 243
         if (!empty($this->conf['fulltext'])) {
@@ -264,8 +256,7 @@  discard block
 block discarded – undo
264 256
      *
265 257
      * @return string HTML output of logical page field
266 258
      */
267
-    protected function addLogicalPage()
268
-    {
259
+    protected function addLogicalPage() {
269 260
         $output = '';
270 261
         // Check for plugin configuration.
271 262
         if (!empty($this->conf['showLogicalPageField'])) {
@@ -288,8 +279,7 @@  discard block
 block discarded – undo
288 279
      *
289 280
      * @return array The array for the facet's menu entry
290 281
      */
291
-    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state)
292
-    {
282
+    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) {
293 283
         $entryArray = [];
294 284
         // Translate value.
295 285
         if ($field == 'owner_faceting') {
@@ -345,8 +335,7 @@  discard block
 block discarded – undo
345 335
      *
346 336
      * @return string The content that is displayed on the website
347 337
      */
348
-    public function main($content, $conf)
349
-    {
338
+    public function main($content, $conf) {
350 339
         $this->init($conf);
351 340
         // Disable caching for this plugin.
352 341
         $this->setCache(false);
@@ -553,8 +542,7 @@  discard block
 block discarded – undo
553 542
      *
554 543
      * @return array HMENU array
555 544
      */
556
-    public function makeFacetsMenuArray($content, $conf)
557
-    {
545
+    public function makeFacetsMenuArray($content, $conf) {
558 546
         $this->init($conf);
559 547
         $menuArray = [];
560 548
         // Set default value for facet search.
Please login to merge, or discard this patch.
Classes/Hooks/UserFunc.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
  * @subpackage dlf
31 31
  * @access public
32 32
  */
33
-class UserFunc implements LoggerAwareInterface
34
-{
33
+class UserFunc implements LoggerAwareInterface {
35 34
     use LoggerAwareTrait;
36 35
 
37 36
     /**
@@ -53,8 +52,7 @@  discard block
 block discarded – undo
53 52
      *
54 53
      * @return string HTML <img> tag for thumbnail
55 54
      */
56
-    public function displayThumbnail(&$params)
57
-    {
55
+    public function displayThumbnail(&$params) {
58 56
         // Simulate TCA field type "passthrough".
59 57
         $output = '<input type="hidden" name="' . $params['itemFormElName'] . '" value="' . $params['itemFormElValue'] . '" />';
60 58
         if (!empty($params['itemFormElValue'])) {
Please login to merge, or discard this patch.
Classes/Hooks/ConfigurationForm.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
  * @subpackage dlf
29 29
  * @access public
30 30
  */
31
-class ConfigurationForm
32
-{
31
+class ConfigurationForm {
33 32
     /**
34 33
      * This holds the current configuration
35 34
      *
@@ -45,8 +44,7 @@  discard block
 block discarded – undo
45 44
      *
46 45
      * @return string Message informing the user of success or failure
47 46
      */
48
-    public function checkSolrConnection()
49
-    {
47
+    public function checkSolrConnection() {
50 48
         $solr = Solr::getInstance();
51 49
         if ($solr->ready) {
52 50
             Helper::addMessage(
@@ -71,8 +69,7 @@  discard block
 block discarded – undo
71 69
      *
72 70
      * @return string Message informing the user of success or failure
73 71
      */
74
-    public function checkMetadataFormats()
75
-    {
72
+    public function checkMetadataFormats() {
76 73
         // We need to do some bootstrapping manually as of TYPO3 9.
77 74
         // Load table configuration array into $GLOBALS['TCA'].
78 75
         ExtensionManagementUtility::loadBaseTca(false);
@@ -201,8 +198,7 @@  discard block
 block discarded – undo
201 198
      *
202 199
      * @return void
203 200
      */
204
-    public function __construct()
205
-    {
201
+    public function __construct() {
206 202
         // Load localization file.
207 203
         $GLOBALS['LANG']->includeLLFile('EXT:dlf/Resources/Private/Language/FlashMessages.xml');
208 204
         // Get current configuration.
Please login to merge, or discard this patch.
Classes/Common/AbstractPlugin.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  * @access public
30 30
  * @abstract
31 31
  */
32
-abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin implements LoggerAwareInterface
33
-{
32
+abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin implements LoggerAwareInterface {
34 33
     use LoggerAwareTrait;
35 34
 
36 35
     public $extKey = 'dlf';
@@ -73,8 +72,7 @@  discard block
 block discarded – undo
73 72
      *
74 73
      * @return void
75 74
      */
76
-    protected function getTemplate($part = '###TEMPLATE###')
77
-    {
75
+    protected function getTemplate($part = '###TEMPLATE###') {
78 76
         $this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
79 77
         if (!empty($this->conf['templateFile'])) {
80 78
             // Load template file from configuration.
@@ -98,8 +96,7 @@  discard block
 block discarded – undo
98 96
      *
99 97
      * @return void
100 98
      */
101
-    protected function init(array $conf)
102
-    {
99
+    protected function init(array $conf) {
103 100
         // Read FlexForm configuration.
104 101
         $flexFormConf = [];
105 102
         $this->cObj->readFlexformIntoConf($this->cObj->data['pi_flexform'], $flexFormConf);
@@ -137,8 +134,7 @@  discard block
 block discarded – undo
137 134
      *
138 135
      * @return void
139 136
      */
140
-    protected function loadDocument()
141
-    {
137
+    protected function loadDocument() {
142 138
         // Check for required variable.
143 139
         if (
144 140
             !empty($this->piVars['id'])
@@ -209,8 +205,7 @@  discard block
 block discarded – undo
209 205
      *
210 206
      * @return array The resulting typoscript array
211 207
      */
212
-    protected function parseTS($string = '')
213
-    {
208
+    protected function parseTS($string = '') {
214 209
         $parser = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::class);
215 210
         $parser->parse($string);
216 211
         return $parser->setup;
@@ -229,8 +224,7 @@  discard block
 block discarded – undo
229 224
      *
230 225
      * @return string The input string wrapped in <a> tags
231 226
      */
232
-    public function pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0)
233
-    {
227
+    public function pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0) {
234 228
         $conf = [];
235 229
         if (!$cache) {
236 230
             $conf['no_cache'] = true;
@@ -253,8 +247,7 @@  discard block
 block discarded – undo
253 247
      *
254 248
      * @return string HTML content wrapped, ready to return to the parent object.
255 249
      */
256
-    public function pi_wrapInBaseClass($content)
257
-    {
250
+    public function pi_wrapInBaseClass($content) {
258 251
         if (!$this->frontendController->config['config']['disableWrapInBaseClass']) {
259 252
             // Use class name instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins.
260 253
             $content = '<div class="tx-dlf-' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '">' . $content . '</div>';
@@ -274,8 +267,7 @@  discard block
 block discarded – undo
274 267
      *
275 268
      * @return void
276 269
      */
277
-    protected function setCache($cache = true)
278
-    {
270
+    protected function setCache($cache = true) {
279 271
         if ($cache) {
280 272
             // Set cObject type to "USER" (default).
281 273
             $this->pi_USER_INT_obj = false;
Please login to merge, or discard this patch.