@@ -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] |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected static function concatenate($strings, $delimiter = ' ') |
44 | 44 | { |
45 | - $strings = array_filter($strings, function ($value) { |
|
45 | + $strings = array_filter($strings, function($value) { |
|
46 | 46 | return !empty($value); |
47 | 47 | }); |
48 | 48 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $type = $storageQuery->type; |
77 | 77 | |
78 | - $method = 'translate' . ucfirst($type); |
|
78 | + $method = 'translate'.ucfirst($type); |
|
79 | 79 | |
80 | 80 | if (!method_exists($this, $method)) { |
81 | 81 | throw new InvalidArgumentException("Could not translate query of unknown type '$type'"); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | protected function translateTranslatable($query) |
245 | 245 | { |
246 | 246 | if (!$this->translatable($query)) { |
247 | - throw new InvalidArgumentException("Cannot translate query of type '" . get_class($query) . "'"); |
|
247 | + throw new InvalidArgumentException("Cannot translate query of type '".get_class($query)."'"); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | if ($query instanceof Storage\Query\Builder) { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | protected function prepareJoinType($type) |
437 | 437 | { |
438 | 438 | if (in_array($type, array('left', 'right'))) { |
439 | - return strtoupper($type) . ' JOIN'; |
|
439 | + return strtoupper($type).' JOIN'; |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | return 'JOIN'; |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | } |
568 | 568 | |
569 | 569 | if (is_array($value)) { |
570 | - $value = "(" . implode(", ", $value) . ")"; |
|
570 | + $value = "(".implode(", ", $value).")"; |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | return "$column $operator $value"; |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | |
588 | 588 | foreach ($filter as $column => $value) { |
589 | 589 | if (strtolower($column) == 'or') { |
590 | - $conditions[] = '(' . $this->prepareWhere($value, 'OR', true) . ')'; |
|
590 | + $conditions[] = '('.$this->prepareWhere($value, 'OR', true).')'; |
|
591 | 591 | } else { |
592 | 592 | $conditions[] = $this->prepareFilterCondition($column, $value); |
593 | 593 | } |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | } |
667 | 667 | } |
668 | 668 | |
669 | - return count($conditions) ? 'ORDER BY ' . implode(', ', $conditions) : null; |
|
669 | + return count($conditions) ? 'ORDER BY '.implode(', ', $conditions) : null; |
|
670 | 670 | } |
671 | 671 | |
672 | 672 | /** |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | */ |
687 | 687 | protected function prepareGroupBy(array $groupings) |
688 | 688 | { |
689 | - return count($groupings) ? 'GROUP BY ' . implode(', ', $this->identifier($groupings)) : null; |
|
689 | + return count($groupings) ? 'GROUP BY '.implode(', ', $this->identifier($groupings)) : null; |
|
690 | 690 | } |
691 | 691 | |
692 | 692 | /** |
@@ -751,8 +751,8 @@ discard block |
||
751 | 751 | $columns = $this->identifier(array_keys($data)); |
752 | 752 | $values = $this->value(array_values($data)); |
753 | 753 | |
754 | - $columns = '(' . implode(', ', $columns) . ')'; |
|
755 | - $values = '(' . implode(', ', $values) . ')'; |
|
754 | + $columns = '('.implode(', ', $columns).')'; |
|
755 | + $values = '('.implode(', ', $values).')'; |
|
756 | 756 | |
757 | 757 | return static::concatenate(array('INSERT INTO', $table, $columns, 'VALUES', $values)); |
758 | 758 | } |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | |
773 | 773 | if (!empty($columns)) { |
774 | 774 | $columns = $this->identifier($columns); |
775 | - $columns = "(" . implode(", ", $columns) . ")"; |
|
775 | + $columns = "(".implode(", ", $columns).")"; |
|
776 | 776 | } |
777 | 777 | |
778 | 778 | $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( |