@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $yem = $this->getYem(); |
127 | 127 | $statements = explode(';', $this->getCleanedUpSql($sqlStatements, $this->getReplacements())); |
128 | 128 | $statements = array_filter($statements, |
129 | - function ($statement) { |
|
129 | + function($statement) { |
|
130 | 130 | return '' !== trim($statement); |
131 | 131 | }); |
132 | 132 | $progress = null; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $progress->finish(); |
159 | 159 | $output->writeln(''); |
160 | 160 | } |
161 | - $mess = '<comment>' . $sql . '</comment>>'; |
|
161 | + $mess = '<comment>'.$sql.'</comment>>'; |
|
162 | 162 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, strip_tags($mess)); |
163 | 163 | $output->writeln($mess); |
164 | 164 | $mess = sprintf('Sql failed in %1$s on statement %2$s with (%3$s) %4$s', |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $base = 'Yapeal.Sql.'; |
206 | 206 | foreach (['class', 'database', 'hostName', 'password', 'platform', 'tablePrefix', 'userName'] as $option) { |
207 | 207 | if (array_key_exists($option, $options) && null !== $options[$option]) { |
208 | - $dic[$base . $option] = $options[$option]; |
|
208 | + $dic[$base.$option] = $options[$option]; |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 | return $this; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->setDic($dic); |
80 | 80 | $this->platform = $dic['Yapeal.Sql.platform']; |
81 | - $this->queriesDir = $dic['Yapeal.Sql.dir'] . 'queries/'; |
|
81 | + $this->queriesDir = $dic['Yapeal.Sql.dir'].'queries/'; |
|
82 | 82 | } |
83 | 83 | /** |
84 | 84 | * @param string $name |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function __call(string $name, array $arguments = []) |
94 | 94 | { |
95 | - $methodName = $name . ucfirst($this->platform); |
|
95 | + $methodName = $name.ucfirst($this->platform); |
|
96 | 96 | if (method_exists($this, $methodName)) { |
97 | 97 | $sql = call_user_func_array([$this, $methodName], $arguments); |
98 | 98 | if (false !== $sql) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | return $this->processSql($fileName, $sql, $arguments); |
113 | 113 | } |
114 | - $mess = 'Unknown method ' . $name; |
|
114 | + $mess = 'Unknown method '.$name; |
|
115 | 115 | throw new \BadMethodCallException($mess); |
116 | 116 | } |
117 | 117 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $replacements = $this->getReplacements(); |
128 | 128 | $replacements['{tableName}'] = $tableName; |
129 | 129 | $replacements['{columnNames}'] = implode('","', $columnNameList); |
130 | - $rowPrototype = '(' . implode(',', array_fill(0, count($columnNameList), '?')) . ')'; |
|
130 | + $rowPrototype = '('.implode(',', array_fill(0, count($columnNameList), '?')).')'; |
|
131 | 131 | $replacements['{rowset}'] = implode(',', array_fill(0, $rowCount, $rowPrototype)); |
132 | 132 | $updates = []; |
133 | 133 | foreach ($columnNameList as $column) { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param string $name |
86 | 86 | * @param array $arguments |
87 | 87 | * |
88 | - * @return mixed |
|
88 | + * @return string |
|
89 | 89 | * @throws \InvalidArgumentException |
90 | 90 | * @throws \DomainException |
91 | 91 | * @throws \BadMethodCallException |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $regEx = '%(?<all>\{(?<name>Yapeal(?:\.\w+)+)\})%'; |
92 | 92 | do { |
93 | 93 | $settings = preg_replace_callback($regEx, |
94 | - function ($match) use ($settings, $dic) { |
|
94 | + function($match) use ($settings, $dic) { |
|
95 | 95 | if (array_key_exists($match['name'], $settings)) { |
96 | 96 | return $settings[$match['name']]; |
97 | 97 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if (PREG_NO_ERROR !== $lastError) { |
112 | 112 | $constants = array_flip(get_defined_constants(true)['pcre']); |
113 | 113 | $lastError = $constants[$lastError]; |
114 | - $mess = 'Received preg error ' . $lastError; |
|
114 | + $mess = 'Received preg error '.$lastError; |
|
115 | 115 | throw new \DomainException($mess); |
116 | 116 | } |
117 | 117 | } while ($count > 0); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $dic = $this->getDic(); |
165 | 165 | /** @noinspection PhpParamsInspection */ |
166 | 166 | if (array_key_exists('Yapeal.vendorParentDir', $dic)) { |
167 | - $appConfigFile = $dic['Yapeal.vendorParentDir'] . 'config/yapeal.yaml'; |
|
167 | + $appConfigFile = $dic['Yapeal.vendorParentDir'].'config/yapeal.yaml'; |
|
168 | 168 | $this->configFile = is_readable($appConfigFile) && is_file($appConfigFile); |
169 | 169 | } |
170 | 170 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $this->schema = false; |
198 | 198 | } |
199 | 199 | $result = array_values($result->fetchAll(\PDO::FETCH_COLUMN)); |
200 | - $schemaName = $dic['Yapeal.Sql.Platforms.' . $dic['Yapeal.Sql.platform'] . '.schema']; |
|
200 | + $schemaName = $dic['Yapeal.Sql.Platforms.'.$dic['Yapeal.Sql.platform'].'.schema']; |
|
201 | 201 | if (!in_array($schemaName, $result, false)) { |
202 | 202 | $this->schema = false; |
203 | 203 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | private function yamlMenu(InputInterface $input, OutputInterface $output) |
264 | 264 | { |
265 | 265 | if ($this->hasConfigFile()) { |
266 | - $ycf = new YamlConfigFile($this->getDic()['Yapeal.vendorParentDir'] . 'config'); |
|
266 | + $ycf = new YamlConfigFile($this->getDic()['Yapeal.vendorParentDir'].'config'); |
|
267 | 267 | $ycf->read(); |
268 | 268 | $this->yamlFile = $ycf->getSettings(); |
269 | 269 | } |
@@ -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 () use($dic) { |
|
100 | + $dic['Yapeal.Config.Yaml'] = $dic->factory(function() use($dic) { |
|
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 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $lines = explode("\n", $sql); |
72 | 72 | // Filter out non-sql lines like comments and blank lines. |
73 | 73 | $lines = array_filter($lines, |
74 | - function ($line) { |
|
74 | + function($line) { |
|
75 | 75 | $line = trim($line); |
76 | 76 | $nonSql = '' === $line |
77 | 77 | || 0 === strpos($line, '--') |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | protected function getSqlSubs(ContainerInterface $dic) |
92 | 92 | { |
93 | 93 | $keys = $dic->keys(); |
94 | - $platform = '.' . $dic['Yapeal.Sql.platform']; |
|
94 | + $platform = '.'.$dic['Yapeal.Sql.platform']; |
|
95 | 95 | /** |
96 | 96 | * @var array $filteredKeys |
97 | 97 | */ |
98 | 98 | $filteredKeys = array_filter($keys, |
99 | - function ($key) use ($platform) { |
|
99 | + function($key) use ($platform) { |
|
100 | 100 | if (0 !== strpos($key, 'Yapeal.Sql.')) { |
101 | 101 | return false; |
102 | 102 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | }); |
108 | 108 | $replacements = []; |
109 | 109 | foreach ($filteredKeys as $key) { |
110 | - $subName = '{' . substr($key, strrpos($key, '.') + 1) . '}'; |
|
110 | + $subName = '{'.substr($key, strrpos($key, '.') + 1).'}'; |
|
111 | 111 | $replacements[$subName] = $dic[$key]; |
112 | 112 | } |
113 | 113 | return $replacements; |