@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | public function setCachePath(string $value = null): self |
109 | 109 | { |
110 | 110 | if (null === $value) { |
111 | - $value = dirname(__DIR__, 2) . '/cache/'; |
|
111 | + $value = dirname(__DIR__, 2).'/cache/'; |
|
112 | 112 | } |
113 | 113 | if (!is_string($value)) { |
114 | - $mess = 'Cache path MUST be string, but was given ' . gettype($value); |
|
114 | + $mess = 'Cache path MUST be string, but was given '.gettype($value); |
|
115 | 115 | throw new \InvalidArgumentException($mess); |
116 | 116 | } |
117 | 117 | $this->cachePath = $this->getFpn() |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | } |
180 | 180 | $eveFormat = 'Y-m-d H:i:sP'; |
181 | 181 | $now = new \DateTimeImmutable('now', new \DateTimeZone('UTC')); |
182 | - $current = \DateTimeImmutable::createFromFormat($eveFormat, $current . '+00:00'); |
|
183 | - $until = \DateTimeImmutable::createFromFormat($eveFormat, $until . '+00:00'); |
|
182 | + $current = \DateTimeImmutable::createFromFormat($eveFormat, $current.'+00:00'); |
|
183 | + $until = \DateTimeImmutable::createFromFormat($eveFormat, $until.'+00:00'); |
|
184 | 184 | // At minimum use cached XML for 5 minutes. |
185 | 185 | if ($now <= $current->add(new \DateInterval('PT5M'))) { |
186 | 186 | return false; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @var WiringInterface $class |
66 | 66 | */ |
67 | 67 | foreach ($names as $name) { |
68 | - $setting = $base . strtolower($name); |
|
68 | + $setting = $base.strtolower($name); |
|
69 | 69 | if (!empty($dic[$setting]) |
70 | 70 | && is_subclass_of($dic[$setting], '\Yapeal\Configuration\WiringInterface', true) |
71 | 71 | ) { |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | $class->wire($dic); |
74 | 74 | continue; |
75 | 75 | } |
76 | - $methodName = 'wire' . $name; |
|
76 | + $methodName = 'wire'.$name; |
|
77 | 77 | if (method_exists($this, $methodName)) { |
78 | 78 | $this->$methodName(); |
79 | 79 | } else { |
80 | - $mess = 'Could NOT find class or method for ' . $name; |
|
80 | + $mess = 'Could NOT find class or method for '.$name; |
|
81 | 81 | throw new \LogicException($mess); |
82 | 82 | } |
83 | 83 | } |
@@ -92,23 +92,23 @@ discard block |
||
92 | 92 | protected function wireConfig() |
93 | 93 | { |
94 | 94 | $dic = $this->getDic(); |
95 | - $path = str_replace('\\', '/', dirname(dirname(__DIR__))) . '/'; |
|
95 | + $path = str_replace('\\', '/', dirname(dirname(__DIR__))).'/'; |
|
96 | 96 | // These two paths are critical to Yapeal-ng working and can't be overridden here. |
97 | 97 | $dic['Yapeal.baseDir'] = $path; |
98 | - $dic['Yapeal.libDir'] = $path . 'lib/'; |
|
98 | + $dic['Yapeal.libDir'] = $path.'lib/'; |
|
99 | 99 | if (empty($dic['Yapeal.Config.Yaml'])) { |
100 | - $dic['Yapeal.Config.Yaml'] = $dic->factory(function () { |
|
100 | + $dic['Yapeal.Config.Yaml'] = $dic->factory(function() { |
|
101 | 101 | return new YamlConfigFile(); |
102 | 102 | }); |
103 | 103 | } |
104 | 104 | $configFiles = [ |
105 | - __DIR__ . '/yapeal_defaults.yaml', |
|
106 | - $path . 'config/yapeal.yaml' |
|
105 | + __DIR__.'/yapeal_defaults.yaml', |
|
106 | + $path.'config/yapeal.yaml' |
|
107 | 107 | ]; |
108 | 108 | $vendorPos = strpos($path, 'vendor/'); |
109 | 109 | if (false !== $vendorPos) { |
110 | 110 | $dic['Yapeal.vendorParentDir'] = substr($path, 0, $vendorPos); |
111 | - $configFiles[] = $dic['Yapeal.vendorParentDir'] . 'config/yapeal.yaml'; |
|
111 | + $configFiles[] = $dic['Yapeal.vendorParentDir'].'config/yapeal.yaml'; |
|
112 | 112 | } |
113 | 113 | $settings = []; |
114 | 114 | // Process each file in turn so any substitutions are done in a more |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $depth = 0; |
88 | 88 | $maxDepth = 10; |
89 | 89 | $regEx = '%(?<all>\{(?<name>Yapeal(?:\.\w+)+)\})%'; |
90 | - $callback = function ($match) use ($settings, $dic) { |
|
90 | + $callback = function($match) use ($settings, $dic) { |
|
91 | 91 | $name = $match['name']; |
92 | 92 | return $settings[$name] ?? $dic[$name] ?? $match['all']; |
93 | 93 | }; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if (PREG_NO_ERROR !== $lastError) { |
102 | 102 | $constants = array_flip(get_defined_constants(true)['pcre']); |
103 | 103 | $lastError = $constants[$lastError]; |
104 | - $mess = 'Received preg error ' . $lastError; |
|
104 | + $mess = 'Received preg error '.$lastError; |
|
105 | 105 | throw new \DomainException($mess); |
106 | 106 | } |
107 | 107 | } while ($count > 0); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | if (PREG_NO_ERROR !== $lastError) { |
199 | 199 | $constants = array_flip(get_defined_constants(true)['pcre']); |
200 | 200 | $lastError = $constants[$lastError]; |
201 | - $mess = 'Received preg error ' . $lastError; |
|
201 | + $mess = 'Received preg error '.$lastError; |
|
202 | 202 | throw new \DomainException($mess); |
203 | 203 | } |
204 | 204 | $this->getYem() |
@@ -210,12 +210,12 @@ discard block |
||
210 | 210 | } |
211 | 211 | $mess = ''; |
212 | 212 | foreach ($columns as $column) { |
213 | - $mess .= $column . ','; |
|
213 | + $mess .= $column.','; |
|
214 | 214 | if (256 <= strlen($mess)) { |
215 | 215 | break; |
216 | 216 | } |
217 | 217 | } |
218 | - $mess = substr($mess, 0, 256) . '...'; |
|
218 | + $mess = substr($mess, 0, 256).'...'; |
|
219 | 219 | $this->getYem() |
220 | 220 | ->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $mess); |
221 | 221 | $this->pdoStatement->execute($columns); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $yem = $this->getYem(); |
129 | 129 | $statements = explode(';', $this->getCleanedUpSql($sqlStatements, $this->getReplacements())); |
130 | 130 | $statements = array_filter($statements, |
131 | - function ($statement) { |
|
131 | + function($statement) { |
|
132 | 132 | return '' !== trim($statement); |
133 | 133 | }); |
134 | 134 | $progress = null; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $progress->finish(); |
161 | 161 | $output->writeln(''); |
162 | 162 | } |
163 | - $mess = '<comment>' . $sql . '</comment>'; |
|
163 | + $mess = '<comment>'.$sql.'</comment>'; |
|
164 | 164 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, strip_tags($mess)); |
165 | 165 | $output->writeln($mess); |
166 | 166 | $mess = sprintf('Sql failed in %1$s on statement %2$s with (%3$s) %4$s', |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $base = 'Yapeal.Sql.'; |
208 | 208 | foreach (['class', 'database', 'hostName', 'password', 'platform', 'tablePrefix', 'userName'] as $option) { |
209 | 209 | if (array_key_exists($option, $options) && null !== $options[$option]) { |
210 | - $dic[$base . $option] = $options[$option]; |
|
210 | + $dic[$base.$option] = $options[$option]; |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | return $this; |