@@ -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 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function render($size) |
22 | 22 | { |
23 | - $emptyArray = []; |
|
23 | + $emptyArray = []; |
|
24 | 24 | $emptyArray = array_pad($emptyArray, $size, ''); |
25 | 25 | return $emptyArray; |
26 | 26 | } |
@@ -50,8 +50,8 @@ |
||
50 | 50 | protected function getApiCallsArray() |
51 | 51 | { |
52 | 52 | $this->fileService = GeneralUtility::makeInstance(FileService::class); |
53 | - $apiCallData = $this->fileService->readFile( |
|
54 | - PATH_site . 'typo3conf/ext/onpage_integration/Configuration/ApiCalls.json' |
|
53 | + $apiCallData = $this->fileService->readFile( |
|
54 | + PATH_site.'typo3conf/ext/onpage_integration/Configuration/ApiCalls.json' |
|
55 | 55 | ); |
56 | 56 | |
57 | 57 | return json_decode($apiCallData, true); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | /** |
16 | - * @param $section |
|
16 | + * @param string $section |
|
17 | 17 | * |
18 | 18 | * @return string |
19 | 19 | */ |
@@ -6,8 +6,6 @@ |
||
6 | 6 | |
7 | 7 | namespace HDNET\OnpageIntegration\ViewHelpers; |
8 | 8 | |
9 | -use TYPO3\CMS\Extbase\Utility\DebuggerUtility; |
|
10 | - |
|
11 | 9 | /** |
12 | 10 | * Class InArrayViewHelper |
13 | 11 | */ |
@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | $titleArray = explode('_', $title); |
27 | 27 | |
28 | - $UpperTitle = array_map(function ($value) { |
|
28 | + $UpperTitle = array_map(function($value) { |
|
29 | 29 | return ucfirst($value); |
30 | 30 | }, $titleArray); |
31 | 31 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | |
15 | 15 | /** |
16 | - * @param $section |
|
16 | + * @param string $section |
|
17 | 17 | * |
18 | 18 | * @return string |
19 | 19 | */ |
@@ -5,7 +5,6 @@ |
||
5 | 5 | namespace HDNET\OnpageIntegration\Utility; |
6 | 6 | |
7 | 7 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
8 | -use TYPO3\CMS\Extbase\Utility\DebuggerUtility; |
|
9 | 8 | |
10 | 9 | /** |
11 | 10 | * Class ArrayUtility |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | { |
25 | 25 | $loader = GeneralUtility::makeInstance(\HDNET\OnpageIntegration\Loader\ApiResultLoader::class); |
26 | 26 | |
27 | - for ($i = 0; $i < count($metaDataArray[0]); $i++) { |
|
27 | + for ($i = 0; $i<count($metaDataArray[0]); $i++) { |
|
28 | 28 | |
29 | - $graphDataArray = $loader->load('zoom_' . $section . '_' . $i . '_graph'); |
|
29 | + $graphDataArray = $loader->load('zoom_'.$section.'_'.$i.'_graph'); |
|
30 | 30 | $errorReportyKey = $metaDataArray[0][$i]['errors']; |
31 | 31 | |
32 | 32 | $metaDataArray[0][$i]['errors'] = self::errorReport($graphDataArray, $errorReportyKey); |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return int |
45 | 45 | */ |
46 | - protected static function errorReport($graphApiCallResult,$errorReportKey) { |
|
46 | + protected static function errorReport($graphApiCallResult, $errorReportKey) { |
|
47 | 47 | $totalErrors = 0; |
48 | 48 | |
49 | - foreach($graphApiCallResult as $element) { |
|
49 | + foreach ($graphApiCallResult as $element) { |
|
50 | 50 | |
51 | - if(in_array('sum', $errorReportKey)) { |
|
52 | - if(in_array($errorReportKey['hidden'], $element)) { |
|
51 | + if (in_array('sum', $errorReportKey)) { |
|
52 | + if (in_array($errorReportKey['hidden'], $element)) { |
|
53 | 53 | continue; |
54 | 54 | } |
55 | 55 | $totalErrors += $element['count']; |
56 | 56 | } |
57 | 57 | |
58 | - if(in_array($errorReportKey['show'], $element)) { |
|
58 | + if (in_array($errorReportKey['show'], $element)) { |
|
59 | 59 | $totalErrors += $element['count']; |
60 | 60 | } |
61 | 61 | } |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @return array |
73 | 73 | */ |
74 | - public static function showTable(array $tableApiCallResult,array $showTableKey) { |
|
74 | + public static function showTable(array $tableApiCallResult, array $showTableKey) { |
|
75 | 75 | $fittedTablesRecords = []; |
76 | - foreach($tableApiCallResult as $singleCallElement) { |
|
76 | + foreach ($tableApiCallResult as $singleCallElement) { |
|
77 | 77 | |
78 | - foreach($showTableKey as $key) { |
|
79 | - if(array_key_exists($key, $singleCallElement)) { |
|
78 | + foreach ($showTableKey as $key) { |
|
79 | + if (array_key_exists($key, $singleCallElement)) { |
|
80 | 80 | $singleRecordArray[$key] = $singleCallElement[$key]; |
81 | 81 | } |
82 | 82 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | foreach ($keys as $key) { |
80 | 80 | try { |
81 | 81 | $results[$key] = $this->getApiResult($key); |
82 | - }catch (ApiErrorException $e) { |
|
82 | + } catch (ApiErrorException $e) { |
|
83 | 83 | continue; |
84 | 84 | } |
85 | 85 |
@@ -79,7 +79,7 @@ |
||
79 | 79 | foreach ($keys as $key) { |
80 | 80 | try { |
81 | 81 | $results[$key] = $this->getApiResult($key); |
82 | - }catch (ApiErrorException $e) { |
|
82 | + } catch (ApiErrorException $e) { |
|
83 | 83 | continue; |
84 | 84 | } |
85 | 85 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $this->checkForCurl(); |
28 | 28 | |
29 | 29 | return $this->send($json); |
30 | - }catch (UnavailableException $e) { |
|
30 | + } catch (UnavailableException $e) { |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | } |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | CURLOPT_HTTPHEADER, |
67 | 67 | array( |
68 | 68 | 'Content-Type: application/json', |
69 | - 'Content-Length: ' . strlen($data) |
|
69 | + 'Content-Length: '.strlen($data) |
|
70 | 70 | ) |
71 | 71 | ); |
72 | 72 | $return = curl_exec($ch); |
73 | 73 | $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
74 | - if ($code >= 500) { |
|
74 | + if ($code>=500) { |
|
75 | 75 | throw new UnavailableException('The API could not be reached.'); |
76 | 76 | } |
77 | - if ($code >= 400) { |
|
77 | + if ($code>=400) { |
|
78 | 78 | throw new UnavailableException('There has been an error reaching the API.'); |
79 | 79 | } |
80 | 80 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $this->checkForCurl(); |
28 | 28 | |
29 | 29 | return $this->send($json); |
30 | - }catch (UnavailableException $e) { |
|
30 | + } catch (UnavailableException $e) { |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | } |