@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | return ' '; |
125 | 125 | } |
126 | - return htmlspecialchars((string) $attributes['CONTENT']) . ' '; |
|
126 | + return htmlspecialchars((string) $attributes['CONTENT']).' '; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | private function getCoordinates(\SimpleXMLElement $attributes): string |
139 | 139 | { |
140 | - return (string) $attributes['HPOS'] . ' ' . (string) $attributes['VPOS'] . ' ' . (string) $attributes['WIDTH'] . ' ' . (string) $attributes['HEIGHT']; |
|
140 | + return (string) $attributes['HPOS'].' '.(string) $attributes['VPOS'].' '.(string) $attributes['WIDTH'].' '.(string) $attributes['HEIGHT']; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -147,8 +147,7 @@ |
||
147 | 147 | * |
148 | 148 | * @param \SimpleXMLElement &$xml: The XML to register the namespace for |
149 | 149 | */ |
150 | - private function registerAltoNamespace(\SimpleXMLElement &$xml) |
|
151 | - { |
|
150 | + private function registerAltoNamespace(\SimpleXMLElement &$xml) { |
|
152 | 151 | $namespace = $xml->getDocNamespaces(); |
153 | 152 | |
154 | 153 | if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, true)) { |
@@ -151,11 +151,11 @@ |
||
151 | 151 | { |
152 | 152 | $namespace = $xml->getDocNamespaces(); |
153 | 153 | |
154 | - if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, true)) { |
|
154 | + if (in_array('http://www.loc.gov/standards/alto/ns-v2#', $namespace, TRUE)) { |
|
155 | 155 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#'); |
156 | - } elseif (in_array('http://www.loc.gov/standards/alto/ns-v3#', $namespace, true)) { |
|
156 | + } elseif (in_array('http://www.loc.gov/standards/alto/ns-v3#', $namespace, TRUE)) { |
|
157 | 157 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v3#'); |
158 | - } elseif (in_array('http://www.loc.gov/standards/alto/ns-v4#', $namespace, true)) { |
|
158 | + } elseif (in_array('http://www.loc.gov/standards/alto/ns-v4#', $namespace, TRUE)) { |
|
159 | 159 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v4#'); |
160 | 160 | } |
161 | 161 | } |
@@ -24,8 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class Mods implements MetadataInterface |
|
28 | -{ |
|
27 | +class Mods implements MetadataInterface { |
|
29 | 28 | /** |
30 | 29 | * @access private |
31 | 30 | * @var \SimpleXMLElement The metadata XML |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if (!empty($name)) { |
125 | 125 | $this->metadata['author'][$i] = [ |
126 | 126 | 'name' => $name, |
127 | - 'url' => 'https://orcid.org/' . $orcidId |
|
127 | + 'url' => 'https://orcid.org/'.$orcidId |
|
128 | 128 | ]; |
129 | 129 | } else { |
130 | 130 | //fallback into display form |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | // Append "valueURI" to name using Unicode unit separator. |
183 | 183 | if (!empty($authors[$i]->getValueURI())) { |
184 | - $this->metadata['author'][$i] .= pack('C', 31) . $authors[$i]->getValueURI(); |
|
184 | + $this->metadata['author'][$i] .= pack('C', 31).$authors[$i]->getValueURI(); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if (!empty($name)) { |
245 | 245 | $this->metadata['holder'][$i] = [ |
246 | 246 | 'name' => $name, |
247 | - 'url' => 'http://viaf.org/viaf/' . $viafId |
|
247 | + 'url' => 'http://viaf.org/viaf/'.$viafId |
|
248 | 248 | ]; |
249 | 249 | } else { |
250 | 250 | //fallback into display form |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $this->getHolderFromXmlDisplayForm($holders, $i); |
268 | 268 | // Append "valueURI" to name using Unicode unit separator. |
269 | 269 | if (!empty($holders[$i]->getValueURI())) { |
270 | - $this->metadata['holder'][$i] .= pack('C', 31) . $holders[$i]->getValueURI(); |
|
270 | + $this->metadata['holder'][$i] .= pack('C', 31).$holders[$i]->getValueURI(); |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class TeiHeader implements MetadataInterface |
|
26 | -{ |
|
25 | +class TeiHeader implements MetadataInterface { |
|
27 | 26 | /** |
28 | 27 | * This extracts the essential TEIHDR metadata from XML |
29 | 28 | * |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * |
36 | 36 | * @return void |
37 | 37 | */ |
38 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = false): void |
|
38 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = FALSE): void |
|
39 | 39 | { |
40 | 40 | $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
41 | 41 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function __construct(string $viaf, RequestFactory $requestFactory) |
66 | 66 | { |
67 | 67 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
68 | - $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
|
68 | + $this->viafUrl = 'http://viaf.org/viaf/'.$viaf; |
|
69 | 69 | $this->requestFactory = $requestFactory; |
70 | 70 | } |
71 | 71 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | try { |
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
98 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
@@ -110,6 +110,6 @@ discard block |
||
110 | 110 | **/ |
111 | 111 | private function getApiEndpoint(): string |
112 | 112 | { |
113 | - return $this->viafUrl . '/' . $this->endpoint; |
|
113 | + return $this->viafUrl.'/'.$this->endpoint; |
|
114 | 114 | } |
115 | 115 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Client |
|
30 | -{ |
|
29 | +class Client { |
|
31 | 30 | /** |
32 | 31 | * @access protected |
33 | 32 | * @var Logger This holds the logger |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * |
63 | 62 | * @return void |
64 | 63 | **/ |
65 | - public function __construct(string $viaf, RequestFactory $requestFactory) |
|
66 | - { |
|
64 | + public function __construct(string $viaf, RequestFactory $requestFactory) { |
|
67 | 65 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
68 | 66 | $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
69 | 67 | $this->requestFactory = $requestFactory; |
@@ -89,8 +87,7 @@ discard block |
||
89 | 87 | * |
90 | 88 | * @return object|bool |
91 | 89 | **/ |
92 | - public function getData() |
|
93 | - { |
|
90 | + public function getData() { |
|
94 | 91 | $url = $this->getApiEndpoint(); |
95 | 92 | try { |
96 | 93 | $response = $this->requestFactory->request($url); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | 98 | $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
102 | 102 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Profile |
|
30 | -{ |
|
29 | +class Profile { |
|
31 | 30 | /** |
32 | 31 | * @access private |
33 | 32 | * @var Logger This holds the logger |
@@ -55,8 +54,7 @@ discard block |
||
55 | 54 | * |
56 | 55 | * @return void |
57 | 56 | **/ |
58 | - public function __construct(string $viaf) |
|
59 | - { |
|
57 | + public function __construct(string $viaf) { |
|
60 | 58 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
61 | 59 | $this->client = new Client($viaf, GeneralUtility::makeInstance(RequestFactory::class)); |
62 | 60 | } |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | * |
69 | 67 | * @return array|false |
70 | 68 | **/ |
71 | - public function getData() |
|
72 | - { |
|
69 | + public function getData() { |
|
73 | 70 | $this->getRaw(); |
74 | 71 | if ($this->raw !== false && !empty($this->raw)) { |
75 | 72 | $data = []; |
@@ -89,8 +86,7 @@ discard block |
||
89 | 86 | * |
90 | 87 | * @return string|false |
91 | 88 | **/ |
92 | - public function getAddress() |
|
93 | - { |
|
89 | + public function getAddress() { |
|
94 | 90 | $this->getRaw(); |
95 | 91 | if ($this->raw !== false && !empty($this->raw->asXML())) { |
96 | 92 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
@@ -107,8 +103,7 @@ discard block |
||
107 | 103 | * |
108 | 104 | * @return string|false |
109 | 105 | **/ |
110 | - public function getFullName() |
|
111 | - { |
|
106 | + public function getFullName() { |
|
112 | 107 | $this->getRaw(); |
113 | 108 | if ($this->raw !== false && !empty($this->raw->asXML())) { |
114 | 109 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @access private |
45 | 45 | * @var \SimpleXmlElement|false The raw VIAF profile or false if not found |
46 | 46 | **/ |
47 | - private $raw = false; |
|
47 | + private $raw = FALSE; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Constructs client instance |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | public function getData() |
72 | 72 | { |
73 | 73 | $this->getRaw(); |
74 | - if ($this->raw !== false && !empty($this->raw)) { |
|
74 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
75 | 75 | $data = []; |
76 | 76 | $data['address'] = $this->getAddress(); |
77 | 77 | $data['fullName'] = $this->getFullName(); |
78 | 78 | return $data; |
79 | 79 | } else { |
80 | 80 | $this->logger->warning('No data found for given VIAF URL'); |
81 | - return false; |
|
81 | + return FALSE; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | public function getAddress() |
93 | 93 | { |
94 | 94 | $this->getRaw(); |
95 | - if ($this->raw !== false && !empty($this->raw->asXML())) { |
|
95 | + if ($this->raw !== FALSE && !empty($this->raw->asXML())) { |
|
96 | 96 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
97 | 97 | } else { |
98 | 98 | $this->logger->warning('No address found for given VIAF URL'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | public function getFullName() |
111 | 111 | { |
112 | 112 | $this->getRaw(); |
113 | - if ($this->raw !== false && !empty($this->raw->asXML())) { |
|
113 | + if ($this->raw !== FALSE && !empty($this->raw->asXML())) { |
|
114 | 114 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
115 | 115 | $name = (string) $rawName[0]; |
116 | 116 | $name = trim(trim(trim($name), ','), '.'); |
117 | 117 | return $name; |
118 | 118 | } else { |
119 | 119 | $this->logger->warning('No name found for given VIAF URL'); |
120 | - return false; |
|
120 | + return FALSE; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | private function getRaw(): void |
132 | 132 | { |
133 | 133 | $data = $this->client->getData(); |
134 | - if ($data != false) { |
|
134 | + if ($data != FALSE) { |
|
135 | 135 | $this->raw = Helper::getXmlFileAsString($data); |
136 | - if ($this->raw != false && !empty($this->raw->asXML())) { |
|
136 | + if ($this->raw != FALSE && !empty($this->raw->asXML())) { |
|
137 | 137 | $this->raw->registerXPathNamespace('ns1', 'http://viaf.org/viaf/terms#'); |
138 | 138 | } |
139 | 139 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | try { |
112 | 112 | $response = $this->requestFactory->request($url); |
113 | 113 | } catch (\Exception $e) { |
114 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
114 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
115 | 115 | return false; |
116 | 116 | } |
117 | 117 | return $response->getBody()->getContents(); |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | **/ |
127 | 127 | private function getApiEndpoint(): string |
128 | 128 | { |
129 | - $url = 'https://' . $this->level . '.' . self::HOSTNAME; |
|
130 | - $url .= '/v' . self::VERSION . '/'; |
|
129 | + $url = 'https://'.$this->level.'.'.self::HOSTNAME; |
|
130 | + $url .= '/v'.self::VERSION.'/'; |
|
131 | 131 | $url .= $this->orcid; |
132 | - $url .= '/' . $this->endpoint; |
|
132 | + $url .= '/'.$this->endpoint; |
|
133 | 133 | return $url; |
134 | 134 | } |
135 | 135 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Client |
|
30 | -{ |
|
29 | +class Client { |
|
31 | 30 | /** |
32 | 31 | * @var string constant for API hostname |
33 | 32 | **/ |
@@ -78,8 +77,7 @@ discard block |
||
78 | 77 | * |
79 | 78 | * @return void |
80 | 79 | **/ |
81 | - public function __construct(string $orcid, RequestFactory $requestFactory) |
|
82 | - { |
|
80 | + public function __construct(string $orcid, RequestFactory $requestFactory) { |
|
83 | 81 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
84 | 82 | $this->orcid = $orcid; |
85 | 83 | $this->requestFactory = $requestFactory; |
@@ -105,8 +103,7 @@ discard block |
||
105 | 103 | * |
106 | 104 | * @return object|bool |
107 | 105 | **/ |
108 | - public function getData() |
|
109 | - { |
|
106 | + public function getData() { |
|
110 | 107 | $url = $this->getApiEndpoint(); |
111 | 108 | try { |
112 | 109 | $response = $this->requestFactory->request($url); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | 98 | $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
102 | 102 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class StdWrapViewHelper extends AbstractViewHelper |
|
27 | -{ |
|
26 | +class StdWrapViewHelper extends AbstractViewHelper { |
|
28 | 27 | /** |
29 | 28 | * @access protected |
30 | 29 | * @var bool |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @access protected |
30 | 30 | * @var bool |
31 | 31 | */ |
32 | - protected $escapeOutput = false; |
|
32 | + protected $escapeOutput = FALSE; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Initializes arguments. |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | public function initializeArguments(): void |
42 | 42 | { |
43 | 43 | parent::initializeArguments(); |
44 | - $this->registerArgument('wrap', 'string', 'The wrap information', true); |
|
45 | - $this->registerArgument('data', 'array', 'Data for the content object', false); |
|
44 | + $this->registerArgument('wrap', 'string', 'The wrap information', TRUE); |
|
45 | + $this->registerArgument('data', 'array', 'Data for the content object', FALSE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -39,8 +39,7 @@ |
||
39 | 39 | * |
40 | 40 | * @access public |
41 | 41 | */ |
42 | -class MetadataWrapVariableViewHelper extends AbstractViewHelper |
|
43 | -{ |
|
42 | +class MetadataWrapVariableViewHelper extends AbstractViewHelper { |
|
44 | 43 | /** |
45 | 44 | * @access public |
46 | 45 | * |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function initializeArguments(): void |
50 | 50 | { |
51 | - $this->registerArgument('name', 'string', 'Name of variable to create', true); |
|
51 | + $this->registerArgument('name', 'string', 'Name of variable to create', TRUE); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class JsFooterViewHelper extends AbstractViewHelper |
|
29 | -{ |
|
28 | +class JsFooterViewHelper extends AbstractViewHelper { |
|
30 | 29 | /** |
31 | 30 | * Initialize arguments. |
32 | 31 | * |
@@ -35,7 +35,7 @@ |
||
35 | 35 | public function initializeArguments(): void |
36 | 36 | { |
37 | 37 | parent::initializeArguments(); |
38 | - $this->registerArgument('inlineCode', 'string', 'Inline JavaScript', true); |
|
38 | + $this->registerArgument('inlineCode', 'string', 'Inline JavaScript', TRUE); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |