@@ -30,7 +30,8 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function getCategories(array $config, $tceForms = null, string $sitecode = 'default') : array |
32 | 32 | { |
33 | - try { |
|
33 | + try |
|
34 | + { |
|
34 | 35 | if (!isset($config['flexParentDatabaseRow']['pid'])) { |
35 | 36 | throw new \Exception('No PID found in "flexParentDatabaseRow" array key: ' . print_r($config, true)); |
36 | 37 | } |
@@ -53,7 +54,9 @@ discard block |
||
53 | 54 | |
54 | 55 | |
55 | 56 | $config['items'] = array_merge($config['items'], $this->getCategoryList($item, $item->getName())); |
56 | - } catch(\Exception $e) { |
|
57 | + } |
|
58 | + catch(\Exception $e) |
|
59 | + { |
|
57 | 60 | error_log($e->getMessage() . PHP_EOL . $e->getTraceAsString()); |
58 | 61 | } |
59 | 62 |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getTypes(array $config, $tceForms = null, string $sitecode = 'default') : array |
31 | 31 | { |
32 | - try { |
|
32 | + try |
|
33 | + { |
|
33 | 34 | if (!isset($config['flexParentDatabaseRow']['pid'])) { |
34 | 35 | throw new \Exception('No PID found in "flexParentDatabaseRow" or "row" array key: ' . print_r($config, true)); |
35 | 36 | } |
@@ -53,7 +54,9 @@ discard block |
||
53 | 54 | foreach ($items as $item) { |
54 | 55 | $config['items'][] = [$item->getName(), $item->getCode()]; |
55 | 56 | } |
56 | - } catch(\Exception $e) { |
|
57 | + } |
|
58 | + catch(\Exception $e) |
|
59 | + { |
|
57 | 60 | error_log($e->getMessage() . PHP_EOL . $e->getTraceAsString()); |
58 | 61 | } |
59 | 62 |
@@ -89,10 +89,13 @@ |
||
89 | 89 | { |
90 | 90 | $localeManager = \Aimeos\MShop::create($context, 'locale'); |
91 | 91 | |
92 | - try { |
|
92 | + try |
|
93 | + { |
|
93 | 94 | $localeItem = $localeManager->bootstrap($site, '', '', false, null, true); |
94 | 95 | $context->config()->apply($localeItem->getSiteItem()->getConfig()); |
95 | - } catch(\Aimeos\MShop\Exception $e) { |
|
96 | + } |
|
97 | + catch(\Aimeos\MShop\Exception $e) |
|
98 | + { |
|
96 | 99 | $localeItem = $localeManager->create(); |
97 | 100 | } |
98 | 101 |
@@ -80,7 +80,8 @@ |
||
80 | 80 | $cacheName = 'None'; |
81 | 81 | } |
82 | 82 | |
83 | - switch ($cacheName) { |
|
83 | + switch ($cacheName) |
|
84 | + { |
|
84 | 85 | case 'None': |
85 | 86 | $context->config()->set('client/html/basket/cache/enable', false); |
86 | 87 | $cache = \Aimeos\Base\Cache\Factory::create('None', [], null); |
@@ -36,9 +36,12 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) |
38 | 38 | { |
39 | - try { |
|
39 | + try |
|
40 | + { |
|
40 | 41 | return $this->getFields($taskInfo, $task, $parentObject); |
41 | - } catch(\Exception $e) { |
|
42 | + } |
|
43 | + catch(\Exception $e) |
|
44 | + { |
|
42 | 45 | $this->addMessage($e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR); |
43 | 46 | } |
44 | 47 | |
@@ -71,9 +74,12 @@ discard block |
||
71 | 74 | */ |
72 | 75 | public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) |
73 | 76 | { |
74 | - try { |
|
77 | + try |
|
78 | + { |
|
75 | 79 | return $this->validateFields($submittedData, $parentObject); |
76 | - } catch(\Exception $e) { |
|
80 | + } |
|
81 | + catch(\Exception $e) |
|
82 | + { |
|
77 | 83 | $this->addMessage($e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR); |
78 | 84 | } |
79 | 85 |
@@ -57,11 +57,14 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function detailAction() |
59 | 59 | { |
60 | - try { |
|
60 | + try |
|
61 | + { |
|
61 | 62 | $this->removeMetatags(); |
62 | 63 | $client = \Aimeos\Client\Html::create($this->context(), 'catalog/detail'); |
63 | 64 | return $this->getClientOutput($client); |
64 | - } catch(\Exception $e) { |
|
65 | + } |
|
66 | + catch(\Exception $e) |
|
67 | + { |
|
65 | 68 | $this->exception($e); |
66 | 69 | } |
67 | 70 | } |
@@ -194,10 +197,13 @@ discard block |
||
194 | 197 | */ |
195 | 198 | public function treeAction() |
196 | 199 | { |
197 | - try { |
|
200 | + try |
|
201 | + { |
|
198 | 202 | $client = \Aimeos\Client\Html::create($this->context(), 'catalog/tree'); |
199 | 203 | return $this->getClientOutput($client); |
200 | - } catch(\Exception $e) { |
|
204 | + } |
|
205 | + catch(\Exception $e) |
|
206 | + { |
|
201 | 207 | $this->exception($e); |
202 | 208 | } |
203 | 209 | } |
@@ -70,7 +70,8 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function executeUpdate() : bool |
72 | 72 | { |
73 | - try { |
|
73 | + try |
|
74 | + { |
|
74 | 75 | ob_start(); |
75 | 76 | $exectimeStart = microtime(true); |
76 | 77 | |
@@ -78,7 +79,9 @@ discard block |
||
78 | 79 | |
79 | 80 | $this->output->writeln(ob_get_clean()); |
80 | 81 | $this->output->writeln(sprintf('Setup process lasted %1$f sec', (microtime(true) - $exectimeStart))); |
81 | - } catch(\Throwable $t) { |
|
82 | + } |
|
83 | + catch(\Throwable $t) |
|
84 | + { |
|
82 | 85 | $this->output->writeln(ob_get_clean()); |
83 | 86 | $this->output->writeln($t->getMessage()); |
84 | 87 | $this->output->writeln($t->getTraceAsString()); |
@@ -100,7 +100,8 @@ discard block |
||
100 | 100 | */ |
101 | 101 | protected static function join(\Composer\Script\Event $event) |
102 | 102 | { |
103 | - try { |
|
103 | + try |
|
104 | + { |
|
104 | 105 | if (!$event->getIO()->hasAuthentication('github.com')) { |
105 | 106 | return; |
106 | 107 | } |
@@ -128,6 +129,9 @@ discard block |
||
128 | 129 | \Composer\Factory::createRemoteFilesystem($event->getIO(), $config) |
129 | 130 | ->getContents('github.com', 'https://api.github.com/graphql', false, $options); |
130 | 131 | } |
131 | - } catch(\Exception $e) {} |
|
132 | + } |
|
133 | + catch(\Exception $e) |
|
134 | + { |
|
135 | +} |
|
132 | 136 | } |
133 | 137 | } |
@@ -7,7 +7,8 @@ discard block |
||
7 | 7 | |
8 | 8 | $list = [['', '']]; |
9 | 9 | |
10 | - try { |
|
10 | + try |
|
11 | + { |
|
11 | 12 | $config = \Aimeos\Aimeos\Base::config(); |
12 | 13 | $context = \Aimeos\Aimeos\Base::context($config); |
13 | 14 | |
@@ -37,7 +38,8 @@ discard block |
||
37 | 38 | } |
38 | 39 | } |
39 | 40 | } |
40 | - catch(\Exception $e) { |
|
41 | + catch(\Exception $e) |
|
42 | + { |
|
41 | 43 | $log = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class); |
42 | 44 | $log->getLogger(__CLASS__)->warning('Unable to retrieve Aimeos sites: ' . $e->getMessage()); |
43 | 45 | } |