@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function register(Container $container) |
| 16 | 16 | { |
| 17 | 17 | $container->register(array( |
| 18 | - 'Darya\Routing\Router' => function ($container) { |
|
| 18 | + 'Darya\Routing\Router' => function($container) { |
|
| 19 | 19 | $config = $container->config; |
| 20 | 20 | |
| 21 | 21 | $routes = $config['routes'] ?: array( |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | public function register(Container $container) |
| 25 | 25 | { |
| 26 | 26 | $container->register(array( |
| 27 | - 'Darya\Foundation\Configuration' => function (Application $application) { |
|
| 27 | + 'Darya\Foundation\Configuration' => function(Application $application) { |
|
| 28 | 28 | $basePath = $application->basePath(); |
| 29 | 29 | |
| 30 | 30 | // Load the application's configuration |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | ini_set('display_errors', 1); |
| 34 | 34 | |
| 35 | - $listener = function ($result) { |
|
| 35 | + $listener = function($result) { |
|
| 36 | 36 | Chrome::log(array($result->query->string, json_encode($result->query->parameters))); |
| 37 | 37 | |
| 38 | 38 | if ($result->error) { |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | /** |
| 484 | 484 | * Prepare table joins. |
| 485 | 485 | * |
| 486 | - * @param array $joins |
|
| 486 | + * @param Join[] $joins |
|
| 487 | 487 | * @return string |
| 488 | 488 | */ |
| 489 | 489 | protected function prepareJoins(array $joins) { |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | * translateRead(). |
| 640 | 640 | * |
| 641 | 641 | * @param string $table |
| 642 | - * @param array|string $columns |
|
| 642 | + * @param string $columns |
|
| 643 | 643 | * @param string $joins [optional] |
| 644 | 644 | * @param string $where [optional] |
| 645 | 645 | * @param string $order [optional] |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected static function concatenate($strings, $delimiter = ' ') |
| 47 | 47 | { |
| 48 | - $strings = array_filter($strings, function ($value) { |
|
| 48 | + $strings = array_filter($strings, function($value) { |
|
| 49 | 49 | return !empty($value); |
| 50 | 50 | }); |
| 51 | 51 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $type = $storageQuery->type; |
| 80 | 80 | |
| 81 | - $method = 'translate' . ucfirst($type); |
|
| 81 | + $method = 'translate'.ucfirst($type); |
|
| 82 | 82 | |
| 83 | 83 | if (!method_exists($this, $method)) { |
| 84 | 84 | throw new InvalidArgumentException("Could not translate query of unknown type '$type'"); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | protected function translateTranslatable($query) |
| 249 | 249 | { |
| 250 | 250 | if (!$this->translatable($query)) { |
| 251 | - throw new InvalidArgumentException("Cannot translate query of type '" . get_class($query) . "'"); |
|
| 251 | + throw new InvalidArgumentException("Cannot translate query of type '".get_class($query)."'"); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | if ($query instanceof Storage\Query\Builder) { |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | return $this->translate($query); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - throw new InvalidArgumentException("Cannot translate query of type '" . get_class($query) . "'"); |
|
| 262 | + throw new InvalidArgumentException("Cannot translate query of type '".get_class($query)."'"); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | protected function prepareJoinType($type) |
| 443 | 443 | { |
| 444 | 444 | if (in_array($type, array('left', 'right'))) { |
| 445 | - return strtoupper($type) . ' JOIN'; |
|
| 445 | + return strtoupper($type).' JOIN'; |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | return 'JOIN'; |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | if (is_array($value)) { |
| 576 | - $value = "(" . implode(", ", $value) . ")"; |
|
| 576 | + $value = "(".implode(", ", $value).")"; |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | return "$column $operator $value"; |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | |
| 594 | 594 | foreach ($filter as $column => $value) { |
| 595 | 595 | if (strtolower($column) == 'or') { |
| 596 | - $conditions[] = '(' . $this->prepareWhere($value, 'OR', true) . ')'; |
|
| 596 | + $conditions[] = '('.$this->prepareWhere($value, 'OR', true).')'; |
|
| 597 | 597 | } else { |
| 598 | 598 | $conditions[] = $this->prepareFilterCondition($column, $value); |
| 599 | 599 | } |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | } |
| 673 | 673 | } |
| 674 | 674 | |
| 675 | - return count($conditions) ? 'ORDER BY ' . implode(', ', $conditions) : null; |
|
| 675 | + return count($conditions) ? 'ORDER BY '.implode(', ', $conditions) : null; |
|
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | /** |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | */ |
| 693 | 693 | protected function prepareGroupBy(array $groupings) |
| 694 | 694 | { |
| 695 | - return count($groupings) ? 'GROUP BY ' . implode(', ', $this->identifier($groupings)) : null; |
|
| 695 | + return count($groupings) ? 'GROUP BY '.implode(', ', $this->identifier($groupings)) : null; |
|
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | /** |
@@ -757,8 +757,8 @@ discard block |
||
| 757 | 757 | $columns = $this->identifier(array_keys($data)); |
| 758 | 758 | $values = $this->value(array_values($data)); |
| 759 | 759 | |
| 760 | - $columns = '(' . implode(', ', $columns) . ')'; |
|
| 761 | - $values = '(' . implode(', ', $values) . ')'; |
|
| 760 | + $columns = '('.implode(', ', $columns).')'; |
|
| 761 | + $values = '('.implode(', ', $values).')'; |
|
| 762 | 762 | |
| 763 | 763 | return static::concatenate(array('INSERT INTO', $table, $columns, 'VALUES', $values)); |
| 764 | 764 | } |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | |
| 779 | 779 | if (!empty($columns)) { |
| 780 | 780 | $columns = $this->identifier($columns); |
| 781 | - $columns = "(" . implode(", ", $columns) . ")"; |
|
| 781 | + $columns = "(".implode(", ", $columns).")"; |
|
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | $subquery = (string) $this->translate($subquery); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * Instantiate a new join. |
| 54 | 54 | * |
| 55 | 55 | * @param string $type |
| 56 | - * @param string $to |
|
| 56 | + * @param string $resource |
|
| 57 | 57 | */ |
| 58 | 58 | public function __construct($type, $resource) |
| 59 | 59 | { |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // Composer's autoloader |
| 3 | -if (is_file(__DIR__ . '/../../autoload.php')) { |
|
| 4 | - include __DIR__ . '/../../autoload.php'; |
|
| 3 | +if (is_file(__DIR__.'/../../autoload.php')) { |
|
| 4 | + include __DIR__.'/../../autoload.php'; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | // Darya's autoloader |
| 8 | -include __DIR__ . '/src/Darya/Foundation/Autoloader.php'; |
|
| 8 | +include __DIR__.'/src/Darya/Foundation/Autoloader.php'; |
|
| 9 | 9 | |
| 10 | 10 | use Darya\Foundation\Autoloader; |
| 11 | 11 | |
| 12 | 12 | // Base path wherever it's included from, absolute path to the framework |
| 13 | 13 | $autoloader = new Autoloader(realpath('./'), array( |
| 14 | - 'Darya' => realpath(__DIR__ . '/src') |
|
| 14 | + 'Darya' => realpath(__DIR__.'/src') |
|
| 15 | 15 | )); |
| 16 | 16 | |
| 17 | 17 | $autoloader->register(); |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | $data['server']['request_method'] = strtoupper($method); |
| 175 | 175 | |
| 176 | 176 | if ($components['query']) { |
| 177 | - $data['server']['request_uri'] .= '?' . $components['query']; |
|
| 177 | + $data['server']['request_uri'] .= '?'.$components['query']; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | $request = new Request( |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | public function closure(array $filter, $or = false) { |
| 121 | 121 | $filterer = $this; |
| 122 | 122 | |
| 123 | - return function ($row) use ($filterer, $filter, $or) { |
|
| 123 | + return function($row) use ($filterer, $filter, $or) { |
|
| 124 | 124 | return $filterer->matches($row, $filter, $or); |
| 125 | 125 | }; |
| 126 | 126 | } |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | protected function like($actual, $value) { |
| 456 | 456 | $value = preg_quote($value, '/'); |
| 457 | 457 | |
| 458 | - $pattern = '/' . preg_replace(array('/([^\\\])?_/', '/([^\\\])?%/'), array('$1.', '$1.*'), $value) . '/i'; |
|
| 458 | + $pattern = '/'.preg_replace(array('/([^\\\])?_/', '/([^\\\])?%/'), array('$1.', '$1.*'), $value).'/i'; |
|
| 459 | 459 | |
| 460 | 460 | return preg_match($pattern, $actual); |
| 461 | 461 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $host = $this->details['host']; |
| 28 | 28 | |
| 29 | 29 | if ($this->details['port']) { |
| 30 | - $host .= ', ' . $this->details['port']; |
|
| 30 | + $host .= ', '.$this->details['port']; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $this->connection = sqlsrv_connect($this->details['host'], array( |