@@ -62,16 +62,16 @@ |
||
62 | 62 | CURLOPT_HTTPHEADER, |
63 | 63 | array( |
64 | 64 | 'Content-Type: application/json', |
65 | - 'Content-Length: ' . strlen($data) |
|
65 | + 'Content-Length: '.strlen($data) |
|
66 | 66 | ) |
67 | 67 | ); |
68 | 68 | $return = curl_exec($ch); |
69 | 69 | $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
70 | 70 | |
71 | - if ($code >= 500) { |
|
71 | + if ($code>=500) { |
|
72 | 72 | throw new UnavailableException('The API could not be reached.'); |
73 | 73 | } |
74 | - if ($code >= 400) { |
|
74 | + if ($code>=400) { |
|
75 | 75 | throw new UnavailableException('There has been an error reaching the API.'); |
76 | 76 | } |
77 | 77 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function readFile($filePath) |
23 | 23 | { |
24 | - if(!file_exists($filePath)) { |
|
24 | + if (!file_exists($filePath)) { |
|
25 | 25 | throw new Exception("File not found!"); |
26 | 26 | } |
27 | 27 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function getIdentifier($key) |
35 | 35 | { |
36 | - $id = sha1(self::CACHE_ID_PREFIX . $key); |
|
36 | + $id = sha1(self::CACHE_ID_PREFIX.$key); |
|
37 | 37 | return $id; |
38 | 38 | } |
39 | 39 | } |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace HDNET\OnpageIntegration\Exception; |
4 | 4 | |
5 | -class ApiErrorException extends \Exception{ |
|
5 | +class ApiErrorException extends \Exception { |
|
6 | 6 | |
7 | 7 | } |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace HDNET\OnpageIntegration\Exception; |
4 | 4 | |
5 | -class UnavailableException extends \Exception{ |
|
5 | +class UnavailableException extends \Exception { |
|
6 | 6 | |
7 | 7 | } |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace HDNET\OnpageIntegration\Exception; |
4 | 4 | |
5 | -class UnknownApiCallException extends \Exception{ |
|
5 | +class UnknownApiCallException extends \Exception { |
|
6 | 6 | |
7 | 7 | } |
@@ -40,17 +40,17 @@ |
||
40 | 40 | /** |
41 | 41 | * @return array |
42 | 42 | */ |
43 | - public function getAllConfigurationData(){ |
|
43 | + public function getAllConfigurationData() { |
|
44 | 44 | return $this->getApiCallsArray(); |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @return array |
49 | 49 | */ |
50 | - protected function getApiCallsArray(){ |
|
50 | + protected function getApiCallsArray() { |
|
51 | 51 | $this->fileService = GeneralUtility::makeInstance(FileService::class); |
52 | - $apiCallData = $this->fileService->readFile( |
|
53 | - PATH_site . 'typo3conf/ext/onpage_integration/Configuration/ApiCalls.json' |
|
52 | + $apiCallData = $this->fileService->readFile( |
|
53 | + PATH_site.'typo3conf/ext/onpage_integration/Configuration/ApiCalls.json' |
|
54 | 54 | ); |
55 | 55 | |
56 | 56 | return json_decode($apiCallData, true); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function SeoAction($call) |
40 | 40 | { |
41 | - $apiCallString = 'zoom_' . $call . '_table'; |
|
41 | + $apiCallString = 'zoom_'.$call.'_table'; |
|
42 | 42 | |
43 | 43 | $table = $this->loader->load($apiCallString); |
44 | 44 | $this->view->assignMultiple([ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function ContentAction($call) |
54 | 54 | { |
55 | - $apiCallString = 'zoom_' . $call . '_table'; |
|
55 | + $apiCallString = 'zoom_'.$call.'_table'; |
|
56 | 56 | |
57 | 57 | $table = $this->loader->load($apiCallString); |
58 | 58 | $this->view->assignMultiple([ |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function TechnicalAction($call) |
68 | 68 | { |
69 | - $apiCallString = 'zoom_' . $call . '_table'; |
|
69 | + $apiCallString = 'zoom_'.$call.'_table'; |
|
70 | 70 | |
71 | 71 | $table = $this->loader->load($apiCallString); |
72 | 72 | $this->view->assignMultiple([ |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | * @param string $elementName |
39 | 39 | * @return array |
40 | 40 | */ |
41 | - public function findElement(array $array, $elementName){ |
|
42 | - foreach ($array as $key => $element){ |
|
43 | - if ($key !== $elementName){ |
|
44 | - if (!is_array($element)){ |
|
41 | + public function findElement(array $array, $elementName) { |
|
42 | + foreach ($array as $key => $element) { |
|
43 | + if ($key !== $elementName) { |
|
44 | + if (!is_array($element)) { |
|
45 | 45 | return []; |
46 | 46 | } |
47 | 47 | $result = $this->findElement($element, $elementName); |
48 | - if ($result){ |
|
48 | + if ($result) { |
|
49 | 49 | return $result; |
50 | 50 | } |
51 | - }else{ |
|
51 | + } else { |
|
52 | 52 | return $element; |
53 | 53 | } |
54 | 54 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | foreach ($array as $key => $value) { |
85 | 85 | if ($key !== $searchKey) { |
86 | - if (!is_array($value)){ |
|
86 | + if (!is_array($value)) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | $keyChain[] = $key; |