@@ -55,7 +55,7 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | - * @param string|array $path |
|
58 | + * @param string $path |
|
59 | 59 | * @param string|array $exclude |
60 | 60 | * |
61 | 61 | * @return array |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected function getSchemaPath() |
110 | 110 | { |
111 | - return __DIR__ . '/../../../../../fixtures/schemas'; |
|
111 | + return __DIR__.'/../../../../../fixtures/schemas'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -116,6 +116,6 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function getSqlOutputPath() |
118 | 118 | { |
119 | - return __DIR__ . '/../../../../../fixtures/sql'; |
|
119 | + return __DIR__.'/../../../../../fixtures/sql'; |
|
120 | 120 | } |
121 | 121 | } |
@@ -45,8 +45,7 @@ |
||
45 | 45 | if (null == $name) { |
46 | 46 | if (null != $input) { |
47 | 47 | $name = $input->getOption('connection', 'default'); |
48 | - } |
|
49 | - else { |
|
48 | + } else { |
|
50 | 49 | $name = 'default'; |
51 | 50 | } |
52 | 51 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @param string $name The connection name |
50 | 50 | * @param string $mode The connection mode, a Rocket class constant |
51 | 51 | * |
52 | - * @return ConnectionInterface|\PDO |
|
52 | + * @return \PDO |
|
53 | 53 | * |
54 | 54 | * @throws Connection\Exception\ConnectionNotFoundException |
55 | 55 | */ |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @var array |
39 | 39 | */ |
40 | - protected static $cons = []; |
|
40 | + protected static $cons = []; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var array |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | foreach ($parts as $part) { |
112 | 112 | if (!array_key_exists($part, $config)) { |
113 | - throw new ConfigurationKeyNotFoundException('No configuration found for the key "' . $key . '"'); |
|
113 | + throw new ConfigurationKeyNotFoundException('No configuration found for the key "'.$key.'"'); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $config = $config[$part]; |
@@ -137,16 +137,16 @@ discard block |
||
137 | 137 | $className = $namespaceParts[$size - 1]; |
138 | 138 | |
139 | 139 | unset($namespaceParts[$size - 1]); |
140 | - $tableMapNamespace = join('\\', $namespaceParts) . '\\TableMap\\' . $className . 'TableMap'; |
|
140 | + $tableMapNamespace = join('\\', $namespaceParts).'\\TableMap\\'.$className.'TableMap'; |
|
141 | 141 | |
142 | 142 | if (!class_exists($tableMapNamespace)) { |
143 | - throw new \InvalidArgumentException('The table map class "' . $tableMapNamespace . '" does not exist'); |
|
143 | + throw new \InvalidArgumentException('The table map class "'.$tableMapNamespace.'" does not exist'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | $tableMap = new $tableMapNamespace(); |
147 | 147 | if (!$tableMap instanceof TableMapInterface) { |
148 | 148 | throw new \InvalidArgumentException( |
149 | - 'The "' . $tableMapNamespace . '" table map must implement ' |
|
149 | + 'The "'.$tableMapNamespace.'" table map must implement ' |
|
150 | 150 | . '"\Rocket\Model\TableMap\TableMapInterface"' |
151 | 151 | ); |
152 | 152 | } |
@@ -24,6 +24,6 @@ |
||
24 | 24 | */ |
25 | 25 | public function __construct($key, $statusCode = 0) |
26 | 26 | { |
27 | - parent::__construct('The rocket configuration key "' . $key . '" is not found', $statusCode); |
|
27 | + parent::__construct('The rocket configuration key "'.$key.'" is not found', $statusCode); |
|
28 | 28 | } |
29 | 29 | } |
@@ -46,14 +46,14 @@ |
||
46 | 46 | { |
47 | 47 | if (null != $path) { |
48 | 48 | if (!is_file($path)) { |
49 | - throw new ConfigurationFileNotFoundException('The rocket configuration file is not found in the selected folder "' . $path . '"'); |
|
49 | + throw new ConfigurationFileNotFoundException('The rocket configuration file is not found in the selected folder "'.$path.'"'); |
|
50 | 50 | } |
51 | 51 | } else { |
52 | 52 | $rootDir = getcwd(); |
53 | 53 | $finder = new Finder(); |
54 | 54 | $dirs = [ |
55 | - $rootDir . '/config', |
|
56 | - $rootDir . '/configs' |
|
55 | + $rootDir.'/config', |
|
56 | + $rootDir.'/configs' |
|
57 | 57 | ]; |
58 | 58 | |
59 | 59 | $availableDirs = [$rootDir]; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function __construct($alias, $modelNamespace) |
77 | 77 | { |
78 | 78 | if (null == $alias) { |
79 | - throw new \LogicException('The "' . get_called_class() . '" alias can be null'); |
|
79 | + throw new \LogicException('The "'.get_called_class().'" alias can be null'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $this->alias = $alias; |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | if (!$hasRelation || $hasRelation && null !== $from && $this->alias !== $from) { |
220 | 220 | if (null == $from) { |
221 | 221 | throw new RelationNotFoundException( |
222 | - 'Unknown relation with "' . $relation . '" for model "' . $this->modelNamespace . '"' |
|
222 | + 'Unknown relation with "'.$relation.'" for model "'.$this->modelNamespace.'"' |
|
223 | 223 | ); |
224 | 224 | } |
225 | 225 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $params = explode('.', $relation); |
255 | 255 | if (!isset($this->joins[$params[0]])) { |
256 | 256 | throw new RelationAliasNotFoundException( |
257 | - 'Unknown alias for relation "' . $params[0] . '" for model "' . $this->modelNamespace . '"' |
|
257 | + 'Unknown alias for relation "'.$params[0].'" for model "'.$this->modelNamespace.'"' |
|
258 | 258 | ); |
259 | 259 | } |
260 | 260 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | /** @var TableMapInterface $relationTableMap */ |
295 | 295 | $relationTableMap = Rocket::getTableMap($this->joins[$with['alias']]['relation']['namespace']); |
296 | 296 | foreach ($relationTableMap->getColumns() as $column) { |
297 | - $query .= ', ' . $with['alias'] . '.' . $column['name'] . ' AS "' . $with['alias'] . '.' . $column['name'] . '"'; |
|
297 | + $query .= ', '.$with['alias'].'.'.$column['name'].' AS "'.$with['alias'].'.'.$column['name'].'"'; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | unset($relationTableMap); |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | // AND foo = :param_1 |
351 | 351 | $query .= sprintf(' %s %s :param_%d', $clauseParams['operator'], trim(substr($clauseParams['clause'], 0, -1)), $i); |
352 | 352 | } else { |
353 | - $query .= ' ' . $clauseParams['operator'] . ' ' . $clauseParams['clause']; |
|
353 | + $query .= ' '.$clauseParams['operator'].' '.$clauseParams['clause']; |
|
354 | 354 | } |
355 | 355 | } |
356 | 356 | } |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | { |
366 | 366 | $query = ''; |
367 | 367 | if (null != $this->limit) { |
368 | - $query .= ' LIMIT ' . $this->limit; |
|
368 | + $query .= ' LIMIT '.$this->limit; |
|
369 | 369 | |
370 | 370 | if (null != $this->offset) { |
371 | - $query .= ',' . $this->offset; |
|
371 | + $query .= ','.$this->offset; |
|
372 | 372 | } |
373 | 373 | } |
374 | 374 | |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | if (0 < sizeof($this->clauses)) { |
406 | 406 | foreach ($this->clauses as $i => $clauseParams) { |
407 | 407 | if (is_string($clauseParams['value'])) { |
408 | - $query = str_replace(':param_' . $i, "'" . $clauseParams['value'] . "'", $query); |
|
408 | + $query = str_replace(':param_'.$i, "'".$clauseParams['value']."'", $query); |
|
409 | 409 | } else { |
410 | - $query = str_replace(':param_' . $i, $clauseParams['value'], $query); |
|
410 | + $query = str_replace(':param_'.$i, $clauseParams['value'], $query); |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 | } |
@@ -164,8 +164,8 @@ |
||
164 | 164 | // @codeCoverageIgnoreStart |
165 | 165 | // Should never append, because Rocket does not allow to SELECT a relation before his parent table |
166 | 166 | throw new \LogicException( |
167 | - 'The parent object for the relation "' . $relationPhpName . '"' |
|
168 | - . ' (from: "' . $relationFrom . '") does not exist' |
|
167 | + 'The parent object for the relation "'.$relationPhpName.'"' |
|
168 | + . ' (from: "'.$relationFrom.'") does not exist' |
|
169 | 169 | ); |
170 | 170 | // @codeCoverageIgnoreEnd |
171 | 171 | } |
@@ -234,8 +234,7 @@ |
||
234 | 234 | if (false !== strpos($columnName, '.')) { |
235 | 235 | $params = explode('.', $columnName); |
236 | 236 | $data[$params[0]][$params[1]] = $value; |
237 | - } |
|
238 | - else { |
|
237 | + } else { |
|
239 | 238 | $data[$this->alias][$columnName] = $value; |
240 | 239 | } |
241 | 240 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public function addRelation($classNamespace, $phpName, $type, $local, $foreign) |
123 | 123 | { |
124 | 124 | if (isset($this->relations[$phpName])) { |
125 | - throw new RelationAlreadyExistsException('The relation between ' . str_replace(['TableMap\\', 'TableMap'], '', get_called_class()) . ' and "' . $classNamespace . '" already exists'); |
|
125 | + throw new RelationAlreadyExistsException('The relation between '.str_replace(['TableMap\\', 'TableMap'], '', get_called_class()).' and "'.$classNamespace.'" already exists'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $this->relations[$phpName] = [ |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | public function getRelation($name) |
260 | 260 | { |
261 | 261 | if (!isset($this->relations[$name])) { |
262 | - throw new \InvalidArgumentException('The relation with name "' . $name . '" is not found for table "' . $this->getTableName() . '"'); |
|
262 | + throw new \InvalidArgumentException('The relation with name "'.$name.'" is not found for table "'.$this->getTableName().'"'); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | return $this->relations[$name]; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | public function getColumn($name) |
274 | 274 | { |
275 | 275 | if (!isset($this->columns[$name])) { |
276 | - throw new \InvalidArgumentException('The column with name "' . $name . '" is not found for table "' . $this->getTableName() . '"'); |
|
276 | + throw new \InvalidArgumentException('The column with name "'.$name.'" is not found for table "'.$this->getTableName().'"'); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | return $this->columns[$name]; |
@@ -330,6 +330,6 @@ discard block |
||
330 | 330 | case 'enum': return self::COLUMN_TYPE_ENUM; |
331 | 331 | } |
332 | 332 | |
333 | - throw new \InvalidArgumentException('Invalid column type for value "' . $stringType . '"'); |
|
333 | + throw new \InvalidArgumentException('Invalid column type for value "'.$stringType.'"'); |
|
334 | 334 | } |
335 | 335 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | /** @var SplFileInfo $file */ |
46 | 46 | foreach ($finder as $file) { |
47 | - $reflectionClass = new \ReflectionClass('\\Rocket\\ORM\\Command\\' . $file->getBasename('.php')); |
|
47 | + $reflectionClass = new \ReflectionClass('\\Rocket\\ORM\\Command\\'.$file->getBasename('.php')); |
|
48 | 48 | if (!$reflectionClass->isSubclassOf('\\Symfony\\Component\\Console\\Command\\Command') || $reflectionClass->isAbstract()) { |
49 | 49 | continue; |
50 | 50 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function isDatabaseCreated($databaseName) |
53 | 53 | { |
54 | - $stmt = $this->query("SHOW DATABASES LIKE '" . $databaseName . "'"); |
|
54 | + $stmt = $this->query("SHOW DATABASES LIKE '".$databaseName."'"); |
|
55 | 55 | $stmt->execute(); |
56 | 56 | |
57 | 57 | return 0 < $stmt->rowCount(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function createDatabase($databaseName) |
66 | 66 | { |
67 | - $stmt = $this->prepare('CREATE DATABASE IF NOT EXISTS ' . $databaseName); |
|
67 | + $stmt = $this->prepare('CREATE DATABASE IF NOT EXISTS '.$databaseName); |
|
68 | 68 | |
69 | 69 | return $stmt->execute(); |
70 | 70 | } |