@@ -23,10 +23,8 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class IndexTask extends BaseTask |
|
27 | -{ |
|
28 | - public function execute() |
|
29 | - { |
|
26 | +class IndexTask extends BaseTask { |
|
27 | + public function execute() { |
|
30 | 28 | $inputArray = []; |
31 | 29 | if ($this->dryRun) { |
32 | 30 | $inputArray['--dry-run'] = true; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | $inputArray = []; |
31 | 31 | if ($this->dryRun) { |
32 | - $inputArray['--dry-run'] = true; |
|
32 | + $inputArray['--dry-run'] = TRUE; |
|
33 | 33 | } |
34 | 34 | $inputArray['-d'] = $this->doc; |
35 | 35 | $inputArray['-p'] = $this->pid; |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class BaseTask extends AbstractTask |
|
27 | -{ |
|
26 | +class BaseTask extends AbstractTask { |
|
28 | 27 | |
29 | 28 | /** |
30 | 29 | * @access protected |
@@ -92,8 +91,7 @@ discard block |
||
92 | 91 | */ |
93 | 92 | protected string $set = ''; |
94 | 93 | |
95 | - public function execute() |
|
96 | - { |
|
94 | + public function execute() { |
|
97 | 95 | return true; |
98 | 96 | } |
99 | 97 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @access protected |
31 | 31 | * @var bool |
32 | 32 | */ |
33 | - protected bool $dryRun = false; |
|
33 | + protected bool $dryRun = FALSE; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @access protected |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @access protected |
73 | 73 | * @var bool |
74 | 74 | */ |
75 | - protected bool $all = false; |
|
75 | + protected bool $all = FALSE; |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * @access protected |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | public function execute() |
96 | 96 | { |
97 | - return true; |
|
97 | + return TRUE; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $message, |
319 | 319 | '', |
320 | 320 | $severity == FlashMessage::ERROR ? FlashMessage::ERROR : FlashMessage::OK, |
321 | - true, |
|
321 | + TRUE, |
|
322 | 322 | 'core.template.flashMessages' |
323 | 323 | ); |
324 | 324 | } |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | |
64 | 64 | // Select for collection(s) |
65 | 65 | $fieldName = 'coll'; |
66 | - $fieldId = 'task_' . $fieldName; |
|
66 | + $fieldId = 'task_'.$fieldName; |
|
67 | 67 | $options = $this->getCollOptions($taskInfo['coll'], $taskInfo['pid']); |
68 | 68 | ; |
69 | - $fieldHtml = '<select name="tx_scheduler[' . $fieldName . '][]" id="' . $fieldId . '" size="10" multiple="multiple">' . implode("\n", $options) . '</select>'; |
|
69 | + $fieldHtml = '<select name="tx_scheduler['.$fieldName.'][]" id="'.$fieldId.'" size="10" multiple="multiple">'.implode("\n", $options).'</select>'; |
|
70 | 70 | $additionalFields[$fieldId] = [ |
71 | 71 | 'code' => $fieldHtml, |
72 | 72 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.coll', |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | |
86 | 86 | // Checkbox for all |
87 | 87 | $fieldName = 'all'; |
88 | - $fieldId = 'task_' . $fieldName; |
|
89 | - $fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . |
|
90 | - ($taskInfo['all'] ? ' checked="checked"' : '') . '>'; |
|
88 | + $fieldId = 'task_'.$fieldName; |
|
89 | + $fieldHtml = '<input type="checkbox" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="1"'. |
|
90 | + ($taskInfo['all'] ? ' checked="checked"' : '').'>'; |
|
91 | 91 | $additionalFields[$fieldId] = [ |
92 | 92 | 'code' => $fieldHtml, |
93 | 93 | 'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.all', |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $options = []; |
112 | 112 | $collections = $this->getCollections($pid); |
113 | 113 | foreach ($collections as $label => $uid) { |
114 | - $options[] = '<option value="' . $uid . '" ' . (in_array($uid, $coll) ? 'selected' : '') . ' >' . $label . '</option>'; |
|
114 | + $options[] = '<option value="'.$uid.'" '.(in_array($uid, $coll) ? 'selected' : '').' >'.$label.'</option>'; |
|
115 | 115 | } |
116 | 116 | return $options; |
117 | 117 | } |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class ReindexAdditionalFieldProvider extends BaseAdditionalFieldProvider |
|
29 | -{ |
|
28 | +class ReindexAdditionalFieldProvider extends BaseAdditionalFieldProvider { |
|
30 | 29 | /** |
31 | 30 | * Gets additional fields to render in the form to add/edit a task |
32 | 31 | * |
@@ -35,8 +34,7 @@ discard block |
||
35 | 34 | * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module |
36 | 35 | * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) |
37 | 36 | */ |
38 | - public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) |
|
39 | - { |
|
37 | + public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { |
|
40 | 38 | $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); |
41 | 39 | |
42 | 40 | /** @var BaseTask $task */ |
@@ -48,12 +48,12 @@ |
||
48 | 48 | $taskInfo['owner'] = $task->getOwner(); |
49 | 49 | $taskInfo['all'] = $task->isAll(); |
50 | 50 | } else { |
51 | - $taskInfo['dryRun'] = false; |
|
51 | + $taskInfo['dryRun'] = FALSE; |
|
52 | 52 | $taskInfo['coll'] = []; |
53 | 53 | $taskInfo['pid'] = - 1; |
54 | 54 | $taskInfo['solr'] = - 1; |
55 | 55 | $taskInfo['owner'] = ''; |
56 | - $taskInfo['all'] = false; |
|
56 | + $taskInfo['all'] = FALSE; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $additionalFields = []; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | 'additionalFields' => \Kitodo\Dlf\Task\HarvestAdditionalFieldProvider::class, |
98 | 98 | ]; |
99 | 99 | // Register AJAX eID handlers. |
100 | -if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['general']['enableInternalProxy'] ?? false) { |
|
100 | +if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['general']['enableInternalProxy'] ?? FALSE) { |
|
101 | 101 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
102 | 102 | } |
103 | 103 | // Use Caching Framework for Solr queries |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | $_EXTKEY = 'dlf'; |
67 | 67 | // Register tools for toolbox plugin. |
68 | 68 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] = []; |
69 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_scoretool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.scoretool'; |
|
70 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltexttool'; |
|
71 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.annotationtool'; |
|
72 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltextdownloadtool'; |
|
73 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagedownloadtool'; |
|
74 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagemanipulationtool'; |
|
75 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.pdfdownloadtool'; |
|
76 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY) . '_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.searchindocumenttool'; |
|
69 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_scoretool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.scoretool'; |
|
70 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltexttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltexttool'; |
|
71 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_annotationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.annotationtool'; |
|
72 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_fulltextdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.fulltextdownloadtool'; |
|
73 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagedownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagedownloadtool'; |
|
74 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_imagemanipulationtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.imagemanipulationtool'; |
|
75 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_pdfdownloadtool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.pdfdownloadtool'; |
|
76 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'][\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getCN($_EXTKEY).'_searchindocumenttool'] = 'LLL:EXT:dlf/Resources/Private/Language/locallang_labels.xlf:tx_dlf_toolbox.searchindocumenttool'; |
|
77 | 77 | // Register hooks. |
78 | 78 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
79 | 79 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \Kitodo\Dlf\Hooks\DataHandler::class; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ]; |
100 | 100 | // Register AJAX eID handlers. |
101 | 101 | if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['dlf']['general']['enableInternalProxy'] ?? false) { |
102 | - $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class . '::main'; |
|
102 | + $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_pageview_proxy'] = \Kitodo\Dlf\Eid\PageViewProxy::class.'::main'; |
|
103 | 103 | } |
104 | 104 | // Use Caching Framework for Solr queries |
105 | 105 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_dlf_solr'] ??= []; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->view->assign('is3DViewer', $this->is3dViewer($this->requestData['model'])); |
37 | 37 | $embedded3DViewerUrl = $this->buildEmbedded3dViewerUrl($this->requestData['model']); |
38 | 38 | if (!empty($this->requestData['viewer'])) { |
39 | - $embedded3DViewerUrl .= '&viewer=' . $this->requestData['viewer']; |
|
39 | + $embedded3DViewerUrl .= '&viewer='.$this->requestData['viewer']; |
|
40 | 40 | } |
41 | 41 | $this->view->assign('embedded3DViewerUrl', $embedded3DViewerUrl); |
42 | 42 | return; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function buildEmbedded3dViewerUrl(string $model): string |
74 | 74 | { |
75 | - return self::MIDDLEWARE_DLF_EMBEDDED_3D_VIEWER_PREFIX . '&model=' . $model; |
|
75 | + return self::MIDDLEWARE_DLF_EMBEDDED_3D_VIEWER_PREFIX.'&model='.$model; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 |
@@ -19,8 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | * @access public |
21 | 21 | */ |
22 | -class View3DController extends AbstractController |
|
23 | -{ |
|
22 | +class View3DController extends AbstractController { |
|
24 | 23 | |
25 | 24 | const MIDDLEWARE_DLF_EMBEDDED_3D_VIEWER_PREFIX = '/?middleware=dlf/embedded3DViewer'; |
26 | 25 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $modelInfo = PathUtility::pathinfo($parameters['model']); |
70 | 70 | $modelFormat = $modelInfo["extension"]; |
71 | 71 | if (empty($modelFormat)) { |
72 | - return $this->warningResponse('Model path "' . $parameters['model'] . '" has no extension format', $request); |
|
72 | + return $this->warningResponse('Model path "'.$parameters['model'].'" has no extension format', $request); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if (empty($parameters['viewer'])) { |
@@ -88,30 +88,30 @@ discard block |
||
88 | 88 | $defaultStorage = $storageRepository->getDefaultStorage(); |
89 | 89 | |
90 | 90 | if (!$defaultStorage->hasFolder(self::VIEWER_FOLDER)) { |
91 | - return $this->errorResponse('Required folder "' . self::VIEWER_FOLDER . '" was not found in the default storage "' . $defaultStorage->getName() . '"', $request); |
|
91 | + return $this->errorResponse('Required folder "'.self::VIEWER_FOLDER.'" was not found in the default storage "'.$defaultStorage->getName().'"', $request); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $viewerModules = $defaultStorage->getFolder(self::VIEWER_FOLDER); |
95 | 95 | if (!$viewerModules->hasFolder($viewer)) { |
96 | - return $this->errorResponse('Viewer folder "' . $viewer . '" was not found under the folder "' . self::VIEWER_FOLDER . '"', $request); |
|
96 | + return $this->errorResponse('Viewer folder "'.$viewer.'" was not found under the folder "'.self::VIEWER_FOLDER.'"', $request); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $viewerFolder = $viewerModules->getSubfolder($viewer); |
100 | 100 | if (!$viewerFolder->hasFile(self::VIEWER_CONFIG_YML)) { |
101 | - return $this->errorResponse('Viewer folder "' . $viewer . '" does not contain a file named "' . self::VIEWER_CONFIG_YML . '"', $request); |
|
101 | + return $this->errorResponse('Viewer folder "'.$viewer.'" does not contain a file named "'.self::VIEWER_CONFIG_YML.'"', $request); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** @var YamlFileLoader $yamlFileLoader */ |
105 | 105 | $yamlFileLoader = GeneralUtility::makeInstance(YamlFileLoader::class); |
106 | - $viewerConfigPath = $defaultStorage->getName() . "/" . self::VIEWER_FOLDER . "/" . $viewer . "/"; |
|
107 | - $config = $yamlFileLoader->load($viewerConfigPath . self::VIEWER_CONFIG_YML)["viewer"]; |
|
106 | + $viewerConfigPath = $defaultStorage->getName()."/".self::VIEWER_FOLDER."/".$viewer."/"; |
|
107 | + $config = $yamlFileLoader->load($viewerConfigPath.self::VIEWER_CONFIG_YML)["viewer"]; |
|
108 | 108 | |
109 | 109 | if (!isset($config["supportedModelFormats"]) || empty($config["supportedModelFormats"])) { |
110 | - return $this->errorResponse('Required key "supportedModelFormats" does not exist in the file "' . self::VIEWER_CONFIG_YML . '" of viewer "' . $viewer . '" or has no value', $request); |
|
110 | + return $this->errorResponse('Required key "supportedModelFormats" does not exist in the file "'.self::VIEWER_CONFIG_YML.'" of viewer "'.$viewer.'" or has no value', $request); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | if (array_search(strtolower($modelFormat), array_map('strtolower', $config["supportedModelFormats"])) === false) { |
114 | - return $this->warningResponse('Viewer "' . $viewer . '" does not support the model format "' . $modelFormat . '"', $request); |
|
114 | + return $this->warningResponse('Viewer "'.$viewer.'" does not support the model format "'.$modelFormat.'"', $request); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | $html = $this->getViewerHtml($config, $viewerConfigPath, $viewerFolder, $parameters['model'], $modelInfo); |
@@ -34,8 +34,7 @@ |
||
34 | 34 | * @subpackage dlf |
35 | 35 | * @access public |
36 | 36 | */ |
37 | -class Embedded3DViewer implements MiddlewareInterface |
|
38 | -{ |
|
37 | +class Embedded3DViewer implements MiddlewareInterface { |
|
39 | 38 | use LoggerAwareTrait; |
40 | 39 | |
41 | 40 | const VIEWER_FOLDER = "dlf_3d_viewers"; |
@@ -110,7 +110,7 @@ |
||
110 | 110 | return $this->errorResponse('Required key "supportedModelFormats" does not exist in the file "' . self::VIEWER_CONFIG_YML . '" of viewer "' . $viewer . '" or has no value', $request); |
111 | 111 | } |
112 | 112 | |
113 | - if (array_search(strtolower($modelFormat), array_map('strtolower', $config["supportedModelFormats"])) === false) { |
|
113 | + if (array_search(strtolower($modelFormat), array_map('strtolower', $config["supportedModelFormats"])) === FALSE) { |
|
114 | 114 | return $this->warningResponse('Viewer "' . $viewer . '" does not support the model format "' . $modelFormat . '"', $request); |
115 | 115 | } |
116 | 116 |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | * LICENSE.txt file that was distributed with this source code. |
13 | 13 | */ |
14 | 14 | |
15 | -class AnnotationTarget |
|
16 | -{ |
|
15 | +class AnnotationTarget { |
|
17 | 16 | /** |
18 | 17 | * @var string |
19 | 18 | */ |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | */ |
40 | 39 | protected $rangeValue; |
41 | 40 | |
42 | - public function __construct($url) |
|
43 | - { |
|
41 | + public function __construct($url) { |
|
44 | 42 | $this->url = $url; |
45 | 43 | |
46 | 44 | $path = parse_url($url, PHP_URL_PATH); |
@@ -65,40 +63,35 @@ discard block |
||
65 | 63 | /** |
66 | 64 | * @return string |
67 | 65 | */ |
68 | - public function getObjectId() |
|
69 | - { |
|
66 | + public function getObjectId() { |
|
70 | 67 | return $this->objectId; |
71 | 68 | } |
72 | 69 | |
73 | 70 | /** |
74 | 71 | * @return string |
75 | 72 | */ |
76 | - public function getId() |
|
77 | - { |
|
73 | + public function getId() { |
|
78 | 74 | return $this->id; |
79 | 75 | } |
80 | 76 | |
81 | 77 | /** |
82 | 78 | * @return string |
83 | 79 | */ |
84 | - public function getRangeParameterName() |
|
85 | - { |
|
80 | + public function getRangeParameterName() { |
|
86 | 81 | return $this->rangeParameterName; |
87 | 82 | } |
88 | 83 | |
89 | 84 | /** |
90 | 85 | * @return string |
91 | 86 | */ |
92 | - public function getRangeValue() |
|
93 | - { |
|
87 | + public function getRangeValue() { |
|
94 | 88 | return $this->rangeValue; |
95 | 89 | } |
96 | 90 | |
97 | 91 | /** |
98 | 92 | * @return bool |
99 | 93 | */ |
100 | - public function isValid() |
|
101 | - { |
|
94 | + public function isValid() { |
|
102 | 95 | if (empty($this->getObjectId())) { |
103 | 96 | return false; |
104 | 97 | } |
@@ -113,8 +106,7 @@ discard block |
||
113 | 106 | /** |
114 | 107 | * @return bool |
115 | 108 | */ |
116 | - public function isValidRange() |
|
117 | - { |
|
109 | + public function isValidRange() { |
|
118 | 110 | if (empty($this->rangeParameterName) && empty($this->rangeValue)) { |
119 | 111 | return true; |
120 | 112 | } elseif ($this->isFacsimileRange()) { |
@@ -131,24 +123,21 @@ discard block |
||
131 | 123 | /** |
132 | 124 | * @return bool |
133 | 125 | */ |
134 | - public function isScoreRange() |
|
135 | - { |
|
126 | + public function isScoreRange() { |
|
136 | 127 | return $this->getRangeParameterName() === 'measureRanges'; |
137 | 128 | } |
138 | 129 | |
139 | 130 | /** |
140 | 131 | * @return bool |
141 | 132 | */ |
142 | - public function isAudioRange() |
|
143 | - { |
|
133 | + public function isAudioRange() { |
|
144 | 134 | return $this->getRangeParameterName() === 't'; |
145 | 135 | } |
146 | 136 | |
147 | 137 | /** |
148 | 138 | * @return bool |
149 | 139 | */ |
150 | - public function isFacsimileRange() |
|
151 | - { |
|
140 | + public function isFacsimileRange() { |
|
152 | 141 | return $this->getRangeParameterName() === 'xywh'; |
153 | 142 | } |
154 | 143 | } |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | public function isValid() |
101 | 101 | { |
102 | 102 | if (empty($this->getObjectId())) { |
103 | - return false; |
|
103 | + return FALSE; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | if (parse_url($this->getUrl(), PHP_URL_FRAGMENT)) { |
107 | 107 | return !empty($this->getId()) && $this->isValidRange(); |
108 | 108 | } |
109 | 109 | |
110 | - return true; |
|
110 | + return TRUE; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | public function isValidRange() |
117 | 117 | { |
118 | 118 | if (empty($this->rangeParameterName) && empty($this->rangeValue)) { |
119 | - return true; |
|
119 | + return TRUE; |
|
120 | 120 | } elseif ($this->isFacsimileRange()) { |
121 | 121 | return preg_match("/^(\d+)(,\d+){3}?$/", $this->rangeValue) === 1; |
122 | 122 | } elseif ($this->isAudioRange()) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return preg_match("/^((\d+|start|end|all|(\d+|start)(-(\d+|end)){0,1})+)(,(\d+|start|end|all|(\d+|start)(-(\d+|end)){0,1})+){0,}?$/", $this->rangeValue) === 1; |
126 | 126 | } |
127 | 127 | |
128 | - return false; |
|
128 | + return FALSE; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | * LICENSE.txt file that was distributed with this source code. |
13 | 13 | */ |
14 | 14 | |
15 | -class Annotation |
|
16 | -{ |
|
15 | +class Annotation { |
|
17 | 16 | /** |
18 | 17 | * The complete data of the annotation |
19 | 18 | * |
@@ -30,8 +29,7 @@ discard block |
||
30 | 29 | /** |
31 | 30 | * @param array $data |
32 | 31 | */ |
33 | - public function __construct($data) |
|
34 | - { |
|
32 | + public function __construct($data) { |
|
35 | 33 | $this->data = $data; |
36 | 34 | } |
37 | 35 | |
@@ -40,8 +38,7 @@ discard block |
||
40 | 38 | * |
41 | 39 | * @return array |
42 | 40 | */ |
43 | - public function getRawData() |
|
44 | - { |
|
41 | + public function getRawData() { |
|
45 | 42 | return $this->data; |
46 | 43 | } |
47 | 44 | |
@@ -50,8 +47,7 @@ discard block |
||
50 | 47 | * |
51 | 48 | * @return string |
52 | 49 | */ |
53 | - public function getId() |
|
54 | - { |
|
50 | + public function getId() { |
|
55 | 51 | return $this->data['id'] ?? ''; |
56 | 52 | } |
57 | 53 | |
@@ -60,8 +56,7 @@ discard block |
||
60 | 56 | * |
61 | 57 | * @return string |
62 | 58 | */ |
63 | - public function getTitle() |
|
64 | - { |
|
59 | + public function getTitle() { |
|
65 | 60 | return $this->data['title'] ?? ''; |
66 | 61 | } |
67 | 62 | |
@@ -70,8 +65,7 @@ discard block |
||
70 | 65 | * |
71 | 66 | * @return array |
72 | 67 | */ |
73 | - public function getBody() |
|
74 | - { |
|
68 | + public function getBody() { |
|
75 | 69 | $body = $this->data['body'] ?? ''; |
76 | 70 | |
77 | 71 | if (is_array($body)) { |
@@ -85,8 +79,7 @@ discard block |
||
85 | 79 | * Gets the name of the annotation creator |
86 | 80 | * @return string |
87 | 81 | */ |
88 | - public function getCreatorName() |
|
89 | - { |
|
82 | + public function getCreatorName() { |
|
90 | 83 | return $this->data['creator']['displayName'] ?? ''; |
91 | 84 | } |
92 | 85 | |
@@ -94,8 +87,7 @@ discard block |
||
94 | 87 | * Gets the creation date of the annotation |
95 | 88 | * @return string |
96 | 89 | */ |
97 | - public function getCreated() |
|
98 | - { |
|
90 | + public function getCreated() { |
|
99 | 91 | return $this->data['created'] ?? ''; |
100 | 92 | } |
101 | 93 | |
@@ -103,8 +95,7 @@ discard block |
||
103 | 95 | * Gets the modification date of the annotation |
104 | 96 | * @return string |
105 | 97 | */ |
106 | - public function getModified() |
|
107 | - { |
|
98 | + public function getModified() { |
|
108 | 99 | return $this->data['modified'] ?? ''; |
109 | 100 | } |
110 | 101 | |
@@ -113,8 +104,7 @@ discard block |
||
113 | 104 | * |
114 | 105 | * @return AnnotationTarget[] |
115 | 106 | */ |
116 | - public function getTargets() |
|
117 | - { |
|
107 | + public function getTargets() { |
|
118 | 108 | if (is_string($this->data['target'])) { |
119 | 109 | return [new AnnotationTarget($this->data['target'])]; |
120 | 110 | } |
@@ -133,8 +123,7 @@ discard block |
||
133 | 123 | * @param array $targetPages |
134 | 124 | * @return void |
135 | 125 | */ |
136 | - public function setTargetPages($targetPages) |
|
137 | - { |
|
126 | + public function setTargetPages($targetPages) { |
|
138 | 127 | $this->targetPages = $targetPages; |
139 | 128 | } |
140 | 129 | |
@@ -143,8 +132,7 @@ discard block |
||
143 | 132 | * |
144 | 133 | * @return array |
145 | 134 | */ |
146 | - public function getTargetPages() |
|
147 | - { |
|
135 | + public function getTargetPages() { |
|
148 | 136 | return $this->targetPages; |
149 | 137 | } |
150 | 138 | |
@@ -153,8 +141,7 @@ discard block |
||
153 | 141 | * |
154 | 142 | * @return array |
155 | 143 | */ |
156 | - public function getPageNumbers() |
|
157 | - { |
|
144 | + public function getPageNumbers() { |
|
158 | 145 | $pages = []; |
159 | 146 | if (is_array($this->targetPages)) { |
160 | 147 | foreach ($this->targetPages as $target) { |
@@ -170,8 +157,7 @@ discard block |
||
170 | 157 | * |
171 | 158 | * @return array |
172 | 159 | */ |
173 | - public function getPageTargets() |
|
174 | - { |
|
160 | + public function getPageTargets() { |
|
175 | 161 | $pageTargets = []; |
176 | 162 | if (is_array($this->targetPages)) { |
177 | 163 | foreach ($this->targetPages as $target) { |
@@ -189,8 +175,7 @@ discard block |
||
189 | 175 | * |
190 | 176 | * @return array |
191 | 177 | */ |
192 | - public function getPageAudioRanges() |
|
193 | - { |
|
178 | + public function getPageAudioRanges() { |
|
194 | 179 | $ranges = []; |
195 | 180 | if (is_array($this->getPageTargets())) { |
196 | 181 | foreach ($this->getPageTargets() as $pageNumber => $targets) { |
@@ -209,8 +194,7 @@ discard block |
||
209 | 194 | * |
210 | 195 | * @return array |
211 | 196 | */ |
212 | - public function getPageScoreRanges() |
|
213 | - { |
|
197 | + public function getPageScoreRanges() { |
|
214 | 198 | $ranges = []; |
215 | 199 | if (is_array($this->getPageTargets())) { |
216 | 200 | foreach ($this->getPageTargets() as $pageNumber => $targets) { |
@@ -229,8 +213,7 @@ discard block |
||
229 | 213 | * |
230 | 214 | * @return array |
231 | 215 | */ |
232 | - public function getPageFacsimileRanges() |
|
233 | - { |
|
216 | + public function getPageFacsimileRanges() { |
|
234 | 217 | $ranges = []; |
235 | 218 | if (is_array($this->getPageTargets())) { |
236 | 219 | foreach ($this->getPageTargets() as $pageNumber => $targets) { |
@@ -250,8 +233,7 @@ discard block |
||
250 | 233 | * |
251 | 234 | * @return bool |
252 | 235 | */ |
253 | - public function isVerovioRelevant() |
|
254 | - { |
|
236 | + public function isVerovioRelevant() { |
|
255 | 237 | foreach ($this->targetPages as $target) { |
256 | 238 | if (array_key_exists('verovioRelevant', $target) && $target['verovioRelevant']) { |
257 | 239 | return true; |
@@ -254,10 +254,10 @@ |
||
254 | 254 | { |
255 | 255 | foreach ($this->targetPages as $target) { |
256 | 256 | if (array_key_exists('verovioRelevant', $target) && $target['verovioRelevant']) { |
257 | - return true; |
|
257 | + return TRUE; |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | - return false; |
|
261 | + return FALSE; |
|
262 | 262 | } |
263 | 263 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @access public |
32 | 32 | */ |
33 | -class MetadataFormat extends AbstractEntity |
|
34 | -{ |
|
33 | +class MetadataFormat extends AbstractEntity { |
|
35 | 34 | /** |
36 | 35 | * @access protected |
37 | 36 | * @var int UID of the ``tx_dlf_metadata`` that is encoded by this metadata entry. |
@@ -76,14 +75,12 @@ discard block |
||
76 | 75 | /** |
77 | 76 | * constructor |
78 | 77 | */ |
79 | - public function __construct() |
|
80 | - { |
|
78 | + public function __construct() { |
|
81 | 79 | // Do not remove the next line: It would break the functionality |
82 | 80 | $this->initStorageObjects(); |
83 | 81 | } |
84 | 82 | |
85 | - protected function initStorageObjects() |
|
86 | - { |
|
83 | + protected function initStorageObjects() { |
|
87 | 84 | $this->subentries = new ObjectStorage(); |
88 | 85 | } |
89 | 86 | |
@@ -151,8 +148,7 @@ discard block |
||
151 | 148 | $this->xpathSorting = $xpathSorting; |
152 | 149 | } |
153 | 150 | |
154 | - public function getSubentries() |
|
155 | - { |
|
151 | + public function getSubentries() { |
|
156 | 152 | return $this->subentries; |
157 | 153 | } |
158 | 154 | |
@@ -168,8 +164,7 @@ discard block |
||
168 | 164 | * |
169 | 165 | * @return void |
170 | 166 | */ |
171 | - public function addSubentry(MetadataSubentry $subentry) |
|
172 | - { |
|
167 | + public function addSubentry(MetadataSubentry $subentry) { |
|
173 | 168 | $this->subentries->attach($subentry); |
174 | 169 | } |
175 | 170 | |
@@ -180,8 +175,7 @@ discard block |
||
180 | 175 | * |
181 | 176 | * @return void |
182 | 177 | */ |
183 | - public function removeSubentry(MetadataSubentry $subentryToRemove) |
|
184 | - { |
|
178 | + public function removeSubentry(MetadataSubentry $subentryToRemove) { |
|
185 | 179 | $this->subentries->detach($subentryToRemove); |
186 | 180 | } |
187 | 181 |