@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * Used to add item to arguments list. |
| 47 | 47 | * |
| 48 | 48 | * @param string $name |
| 49 | - * @param mixed $value |
|
| 49 | + * @param string $value |
|
| 50 | 50 | * |
| 51 | 51 | * @throws InvalidArgumentException |
| 52 | 52 | * @return self Fluent interface. |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * |
| 83 | 83 | * @param string $name |
| 84 | 84 | * |
| 85 | - * @return null|string |
|
| 85 | + * @return string |
|
| 86 | 86 | * @throws DomainException |
| 87 | 87 | */ |
| 88 | 88 | public function getEveApiArgument($name) |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return $this; |
| 58 | 58 | } |
| 59 | 59 | if (!is_string($name)) { |
| 60 | - $mess = 'Name MUST be string but given ' . gettype($name); |
|
| 60 | + $mess = 'Name MUST be string but given '.gettype($name); |
|
| 61 | 61 | throw new InvalidArgumentException($mess); |
| 62 | 62 | } |
| 63 | 63 | $this->eveApiArguments[$name] = (string)$value; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $name = (string)$name; |
| 91 | 91 | if (!array_key_exists($name, $this->eveApiArguments)) { |
| 92 | - $mess = 'Unknown argument ' . $name; |
|
| 92 | + $mess = 'Unknown argument '.$name; |
|
| 93 | 93 | throw new DomainException($mess); |
| 94 | 94 | } |
| 95 | 95 | return $this->eveApiArguments[$name]; |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function getHash() |
| 153 | 153 | { |
| 154 | - $hash = $this->getEveApiName() . $this->getEveApiSectionName(); |
|
| 154 | + $hash = $this->getEveApiName().$this->getEveApiSectionName(); |
|
| 155 | 155 | foreach ($this->getEveApiArguments() as $key => $value) { |
| 156 | 156 | if ('mask' === $key) { |
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | - $hash .= $key . $value; |
|
| 159 | + $hash .= $key.$value; |
|
| 160 | 160 | } |
| 161 | 161 | return hash('md5', $hash); |
| 162 | 162 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | public function setEveApiName($value) |
| 227 | 227 | { |
| 228 | 228 | if (!is_string($value)) { |
| 229 | - $mess = 'Name MUST be string but was given ' . gettype($value); |
|
| 229 | + $mess = 'Name MUST be string but was given '.gettype($value); |
|
| 230 | 230 | throw new InvalidArgumentException($mess); |
| 231 | 231 | } |
| 232 | 232 | $this->eveApiName = $value; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | public function setEveApiSectionName($value) |
| 244 | 244 | { |
| 245 | 245 | if (!is_string($value)) { |
| 246 | - $mess = 'Section name MUST be string but was given ' . gettype($value); |
|
| 246 | + $mess = 'Section name MUST be string but was given '.gettype($value); |
|
| 247 | 247 | throw new InvalidArgumentException($mess); |
| 248 | 248 | } |
| 249 | 249 | $this->eveApiSectionName = $value; |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | $xml = ''; |
| 264 | 264 | } |
| 265 | 265 | if (!is_string($xml)) { |
| 266 | - $mess = 'Xml MUST be string but was given ' . gettype($xml); |
|
| 266 | + $mess = 'Xml MUST be string but was given '.gettype($xml); |
|
| 267 | 267 | throw new InvalidArgumentException($mess); |
| 268 | 268 | } |
| 269 | 269 | $this->eveApiXml = $xml; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | trait CommonFileHandlingTrait |
| 43 | 43 | { |
| 44 | 44 | /** |
| 45 | - * @param $fileName |
|
| 45 | + * @param string $fileName |
|
| 46 | 46 | * @param MediatorInterface $yem |
| 47 | 47 | * @param string $mode |
| 48 | 48 | * |
@@ -135,17 +135,17 @@ discard block |
||
| 135 | 135 | protected function isWritablePath($path, MediatorInterface $yem) |
| 136 | 136 | { |
| 137 | 137 | if (!is_readable($path)) { |
| 138 | - $mess = 'Cache path is NOT readable or does NOT exist, was given ' . $path; |
|
| 138 | + $mess = 'Cache path is NOT readable or does NOT exist, was given '.$path; |
|
| 139 | 139 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::NOTICE, $mess); |
| 140 | 140 | return false; |
| 141 | 141 | } |
| 142 | 142 | if (!is_dir($path)) { |
| 143 | - $mess = 'Cache path is NOT a directory, was given ' . $path; |
|
| 143 | + $mess = 'Cache path is NOT a directory, was given '.$path; |
|
| 144 | 144 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::NOTICE, $mess); |
| 145 | 145 | return false; |
| 146 | 146 | } |
| 147 | 147 | if (!is_writable($path)) { |
| 148 | - $mess = 'Cache path is NOT writable, was given ' . $path; |
|
| 148 | + $mess = 'Cache path is NOT writable, was given '.$path; |
|
| 149 | 149 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::NOTICE, $mess); |
| 150 | 150 | return false; |
| 151 | 151 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | protected function safeFileRead($fileName, MediatorInterface $yem) |
| 215 | 215 | { |
| 216 | 216 | if (!is_readable($fileName) || !is_file($fileName)) { |
| 217 | - $mess = 'Could NOT find accessible file, was given ' . $fileName; |
|
| 217 | + $mess = 'Could NOT find accessible file, was given '.$fileName; |
|
| 218 | 218 | $yem->triggerLogEvent('Yapeal.Log.log', Logger::INFO, $mess); |
| 219 | 219 | return false; |
| 220 | 220 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | protected function createEveApiMessage($messagePrefix, EveApiReadWriteInterface $data) |
| 51 | 51 | { |
| 52 | - $mess = $messagePrefix . ' Eve API %1$s/%2$s'; |
|
| 52 | + $mess = $messagePrefix.' Eve API %1$s/%2$s'; |
|
| 53 | 53 | $subs = [lcfirst($data->getEveApiSectionName()), $data->getEveApiName()]; |
| 54 | 54 | if ($data->hasEveApiArgument('keyID')) { |
| 55 | 55 | $mess .= ' for keyID = %3$s'; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function __construct($dir = __DIR__) |
| 59 | 59 | { |
| 60 | - $this->setRelativeBaseDir($dir . '/'); |
|
| 60 | + $this->setRelativeBaseDir($dir.'/'); |
|
| 61 | 61 | } |
| 62 | 62 | /** |
| 63 | 63 | * @param EveApiEventInterface $event |
@@ -117,15 +117,15 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | $arguments = $data->getEveApiArguments(); |
| 119 | 119 | if (!empty($arguments['vCode'])) { |
| 120 | - $arguments['vCode'] = substr($arguments['vCode'], 0, 8) . '...'; |
|
| 120 | + $arguments['vCode'] = substr($arguments['vCode'], 0, 8).'...'; |
|
| 121 | 121 | } |
| 122 | 122 | unset($arguments['mask']); |
| 123 | 123 | $json = json_encode($arguments); |
| 124 | 124 | $xml = str_replace( |
| 125 | 125 | ["encoding='UTF-8'?>\r\n<eveapi", "encoding='UTF-8'?>\n<eveapi"], |
| 126 | 126 | [ |
| 127 | - "encoding='UTF-8'?>\r\n<?yapeal.parameters.json " . $json . "?>\r\n<eveapi", |
|
| 128 | - "encoding='UTF-8'?>\n<?yapeal.parameters.json " . $json . "?>\n<eveapi" |
|
| 127 | + "encoding='UTF-8'?>\r\n<?yapeal.parameters.json ".$json."?>\r\n<eveapi", |
|
| 128 | + "encoding='UTF-8'?>\n<?yapeal.parameters.json ".$json."?>\n<eveapi" |
|
| 129 | 129 | ], |
| 130 | 130 | $xml |
| 131 | 131 | ); |
@@ -103,10 +103,10 @@ |
||
| 103 | 103 | public function setCachePath($value = null) |
| 104 | 104 | { |
| 105 | 105 | if ($value === null) { |
| 106 | - $value = dirname(dirname(__DIR__)) . '/cache/'; |
|
| 106 | + $value = dirname(dirname(__DIR__)).'/cache/'; |
|
| 107 | 107 | } |
| 108 | 108 | if (!is_string($value)) { |
| 109 | - $mess = 'Cache path MUST be string, but was given ' . gettype($value); |
|
| 109 | + $mess = 'Cache path MUST be string, but was given '.gettype($value); |
|
| 110 | 110 | throw new InvalidArgumentException($mess); |
| 111 | 111 | } |
| 112 | 112 | if ('' === $this->cachePath) { |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | public function setCachePath($value = null) |
| 107 | 107 | { |
| 108 | 108 | if ($value === null) { |
| 109 | - $value = dirname(dirname(__DIR__)) . '/cache/'; |
|
| 109 | + $value = dirname(dirname(__DIR__)).'/cache/'; |
|
| 110 | 110 | } |
| 111 | 111 | if (!is_string($value)) { |
| 112 | - $mess = 'Cache path MUST be string, but given ' . gettype($value); |
|
| 112 | + $mess = 'Cache path MUST be string, but given '.gettype($value); |
|
| 113 | 113 | throw new InvalidArgumentException($mess); |
| 114 | 114 | } |
| 115 | 115 | $this->cachePath = $this->getFpn() |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | $now = time(); |
| 158 | 158 | /** @noinspection PhpUndefinedFieldInspection */ |
| 159 | - $current = strtotime($simple->currentTime[0] . '+00:00'); |
|
| 159 | + $current = strtotime($simple->currentTime[0].'+00:00'); |
|
| 160 | 160 | /** @noinspection PhpUndefinedFieldInspection */ |
| 161 | - $until = strtotime($simple->cachedUntil[0] . '+00:00'); |
|
| 161 | + $until = strtotime($simple->cachedUntil[0].'+00:00'); |
|
| 162 | 162 | // At minimum use cached XML for 5 minutes (300 secs). |
| 163 | 163 | if (($now - $current) <= 300) { |
| 164 | 164 | return false; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | public function setCwd($value) |
| 66 | 66 | { |
| 67 | 67 | if (!is_string($value)) { |
| 68 | - $mess = 'Cwd MUST be string but given ' . gettype($value); |
|
| 68 | + $mess = 'Cwd MUST be string but given '.gettype($value); |
|
| 69 | 69 | throw new InvalidArgumentException($mess); |
| 70 | 70 | } |
| 71 | 71 | $this->cwd = $value; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $output->writeln($name); |
| 80 | 80 | $csq = $this->getCsq(); |
| 81 | 81 | $this->executeSqlStatements( |
| 82 | - $csq->getDropAddOrModifyColumnProcedure() . PHP_EOL . $csq->getCreateAddOrModifyColumnProcedure(), |
|
| 82 | + $csq->getDropAddOrModifyColumnProcedure().PHP_EOL.$csq->getCreateAddOrModifyColumnProcedure(), |
|
| 83 | 83 | $name, |
| 84 | 84 | $output |
| 85 | 85 | ); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | protected function getUpdateFileList(OutputInterface $output) |
| 170 | 170 | { |
| 171 | 171 | $fileNames = []; |
| 172 | - $path = $this->getDic()['Yapeal.Sql.dir'] . 'updates/'; |
|
| 172 | + $path = $this->getDic()['Yapeal.Sql.dir'].'updates/'; |
|
| 173 | 173 | if (!is_readable($path) || !is_dir($path)) { |
| 174 | 174 | $mess = sprintf( |
| 175 | 175 | '<info>Could NOT access update directory %1$s</info>', |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | $stmt->execute([$updateVersion]); |
| 258 | 258 | $pdo->commit(); |
| 259 | 259 | } catch (PDOException $exc) { |
| 260 | - $mess = $sql . PHP_EOL; |
|
| 261 | - $mess .= sprintf('Database error message was %s', $exc->getMessage()) . PHP_EOL; |
|
| 260 | + $mess = $sql.PHP_EOL; |
|
| 261 | + $mess .= sprintf('Database error message was %s', $exc->getMessage()).PHP_EOL; |
|
| 262 | 262 | $mess .= sprintf( |
| 263 | 263 | 'Database "version" update failed for %1$s', |
| 264 | 264 | $updateVersion |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | try { |
| 181 | 181 | $pdo->exec($sql); |
| 182 | 182 | } catch (PDOException $exc) { |
| 183 | - $mess = $sql . PHP_EOL; |
|
| 183 | + $mess = $sql.PHP_EOL; |
|
| 184 | 184 | $mess .= sprintf( |
| 185 | 185 | 'Sql failed in %1$s on statement %2$s with (%3$s) %4$s', |
| 186 | 186 | $fileName, |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $base = 'Yapeal.Sql.'; |
| 207 | 207 | foreach (['class', 'database', 'hostName', 'password', 'platform', 'tablePrefix', 'userName'] as $option) { |
| 208 | 208 | if (!empty($options[$option])) { |
| 209 | - $this->getDic()[$base . $option] = $options[$option]; |
|
| 209 | + $this->getDic()[$base.$option] = $options[$option]; |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | if (!empty($options['configFile'])) { |