| @@ -108,7 +108,7 @@ | ||
| 108 | 108 | */ | 
| 109 | 109 | protected function getClosureHandler($handler, $class) | 
| 110 | 110 |      { | 
| 111 | -        return function (MessageInterface $message) use ($handler, $class) { | |
| 111 | +        return function(MessageInterface $message) use ($handler, $class) { | |
| 112 | 112 | $class = ltrim(get_class($message), '\\'); | 
| 113 | 113 |              if (!isset($this->messages[$class])) { | 
| 114 | 114 |                  throw new LogicException(sprintf('Message "%s" does not have handler.', $class)); | 
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | */ | 
| 24 | 24 | public function __construct(\PDOException $e) | 
| 25 | 25 |      { | 
| 26 | -        if(strstr($e->getMessage(), 'SQLSTATE[')) { | |
| 26 | +        if (strstr($e->getMessage(), 'SQLSTATE[')) { | |
| 27 | 27 |              preg_match('/SQLSTATE\[(\w+)\] \[(\w+)\] (.*)/', $e->getMessage(), $matches); | 
| 28 | 28 |              if (count($matches)) { | 
| 29 | 29 | $this->code = ($matches[1] == 'HT000' ? $matches[2] : $matches[1]); | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | public function sum($fields) | 
| 68 | 68 |      { | 
| 69 | 69 | $total = 0; | 
| 70 | -        $this->walk($fields, function () use (&$total) { | |
| 70 | +        $this->walk($fields, function() use (&$total) { | |
| 71 | 71 | $total += array_sum(func_get_args()); | 
| 72 | 72 | }); | 
| 73 | 73 | |
| @@ -96,7 +96,7 @@ discard block | ||
| 96 | 96 | public function max($fields) | 
| 97 | 97 |      { | 
| 98 | 98 | $max = 0; | 
| 99 | -        $this->walk($fields, function () use (&$max) { | |
| 99 | +        $this->walk($fields, function() use (&$max) { | |
| 100 | 100 | $cur = max(func_get_args()); | 
| 101 | 101 |              if ($cur > $max) { | 
| 102 | 102 | $max = $cur; | 
| @@ -116,7 +116,7 @@ discard block | ||
| 116 | 116 | public function min($fields) | 
| 117 | 117 |      { | 
| 118 | 118 | $min = null; | 
| 119 | -        $this->walk($fields, function () use (&$min) { | |
| 119 | +        $this->walk($fields, function() use (&$min) { | |
| 120 | 120 | $cur = min(func_get_args()); | 
| 121 | 121 |              if (null === $min) { | 
| 122 | 122 | $min = $cur; | 
| @@ -145,7 +145,7 @@ discard block | ||
| 145 | 145 | |
| 146 | 146 | $num = 0; | 
| 147 | 147 | |
| 148 | -        $this->walk($fields, function () use (&$num) { | |
| 148 | +        $this->walk($fields, function() use (&$num) { | |
| 149 | 149 | $num += count(array_filter(func_get_args())); | 
| 150 | 150 | }); | 
| 151 | 151 | |
| @@ -213,7 +213,7 @@ discard block | ||
| 213 | 213 | $this->viewModel->setForceSingle(); | 
| 214 | 214 |          $fields = explode(',', trim($fields)); | 
| 215 | 215 | |
| 216 | -        return array_walk($this->data, function (array $record) use ($fields, $callback) { | |
| 216 | +        return array_walk($this->data, function(array $record) use ($fields, $callback) { | |
| 217 | 217 | $args = $this->getArguments($fields, $record); | 
| 218 | 218 | |
| 219 | 219 | return call_user_func_array($callback, $args); | 
| @@ -107,7 +107,7 @@ discard block | ||
| 107 | 107 |          } elseif (is_array($record)) { | 
| 108 | 108 | $built = $this->serialize($record, $record); | 
| 109 | 109 |          } else { | 
| 110 | -            $built = array_map(function ($readModel) use ($record) { | |
| 110 | +            $built = array_map(function($readModel) use ($record) { | |
| 111 | 111 |                  if ($readModel instanceof ReadModelInterface) { | 
| 112 | 112 | $readModel = $readModel->serialize(); | 
| 113 | 113 | } | 
| @@ -296,7 +296,7 @@ discard block | ||
| 296 | 296 | */ | 
| 297 | 297 | private function computeViewModelValue($results, array $record, $field) | 
| 298 | 298 |      { | 
| 299 | - $method = $this->prefixMethod . ucfirst($field); | |
| 299 | + $method = $this->prefixMethod.ucfirst($field); | |
| 300 | 300 |          if (method_exists($this, $method)) { | 
| 301 | 301 | return call_user_func_array( | 
| 302 | 302 | array($this, $method), | 
| @@ -376,7 +376,7 @@ discard block | ||
| 376 | 376 |      { | 
| 377 | 377 |          if (!$data instanceof ReadModelInterface && !$data instanceof Collection && !is_array($data)) { | 
| 378 | 378 | throw new InvalidArgumentException(sprintf( | 
| 379 | - 'Acceptable data type is \Borobudur\Cqrs\ReadModel\ReadModelInterface, ' . | |
| 379 | + 'Acceptable data type is \Borobudur\Cqrs\ReadModel\ReadModelInterface, '. | |
| 380 | 380 | '\Borobudur\Cqrs\Collection, Borobudur\Cqrs\ViewModel\ViewModel or nested array, but got "%s".', | 
| 381 | 381 | gettype($data) | 
| 382 | 382 | )); | 
| @@ -100,12 +100,12 @@ discard block | ||
| 100 | 100 | $fields = func_get_args(); | 
| 101 | 101 | $elements = array(); | 
| 102 | 102 |          if ($fields || (isset($this->elements[0]) && is_array($this->elements[0]))) { | 
| 103 | -            $this->each(function ($element) use (&$elements, $fields) { | |
| 103 | +            $this->each(function($element) use (&$elements, $fields) { | |
| 104 | 104 |                  if (is_object($element)) { | 
| 105 | 105 |                      if ($fields) { | 
| 106 | 106 |                          foreach ($fields as $field) { | 
| 107 | - $methodGet = 'get' . ucfirst($field); | |
| 108 | - $methodIs = 'is' . ucfirst($field); | |
| 107 | + $methodGet = 'get'.ucfirst($field); | |
| 108 | + $methodIs = 'is'.ucfirst($field); | |
| 109 | 109 | |
| 110 | 110 |                              if (method_exists($element, $methodGet)) { | 
| 111 | 111 |                                  $elements[] = $element->{$methodGet}(); | 
| @@ -147,7 +147,7 @@ discard block | ||
| 147 | 147 | $elements = parent::toArray($resortIndex); | 
| 148 | 148 | |
| 149 | 149 |          if (null !== $this->classMapper) { | 
| 150 | -            return array_map(function (SerializableInterface $element) { | |
| 150 | +            return array_map(function(SerializableInterface $element) { | |
| 151 | 151 | return $element->serialize(); | 
| 152 | 152 | }, (array) $elements); | 
| 153 | 153 | } | 
| @@ -165,7 +165,7 @@ discard block | ||
| 165 | 165 | private function assertValidClassMapper($classMapper) | 
| 166 | 166 |      { | 
| 167 | 167 |          if (null !== $classMapper) { | 
| 168 | - $classMapper = '\\' . ltrim($classMapper, '\\'); | |
| 168 | + $classMapper = '\\'.ltrim($classMapper, '\\'); | |
| 169 | 169 |              if (!class_exists($classMapper)) { | 
| 170 | 170 |                  throw new InvalidArgumentException(sprintf('Class "%s" is undefined.', $classMapper)); | 
| 171 | 171 | } | 
| @@ -81,7 +81,7 @@ | ||
| 81 | 81 | */ | 
| 82 | 82 | public function process() | 
| 83 | 83 |      { | 
| 84 | -        return sprintf('(%s)', implode(' ' . $this->logic . ' ', $this->parts)); | |
| 84 | +        return sprintf('(%s)', implode(' '.$this->logic.' ', $this->parts)); | |
| 85 | 85 | } | 
| 86 | 86 | |
| 87 | 87 | /** | 
| @@ -167,7 +167,7 @@ | ||
| 167 | 167 | */ | 
| 168 | 168 | protected function createParser() | 
| 169 | 169 |      { | 
| 170 | -        switch(strtolower($this->engine)) { | |
| 170 | +        switch (strtolower($this->engine)) { | |
| 171 | 171 | case 'pgsql': | 
| 172 | 172 | return new PostgresParser(); | 
| 173 | 173 | } | 
| @@ -15,7 +15,7 @@ | ||
| 15 | 15 |      { | 
| 16 | 16 | return sprintf( | 
| 17 | 17 | '%s %s %s', | 
| 18 | - $this->transformField($comparison, $this->quote . $field . $this->quote), | |
| 18 | + $this->transformField($comparison, $this->quote.$field.$this->quote), | |
| 19 | 19 | $this->transformComparison($comparison, $value), | 
| 20 | 20 | $this->normalizeValue($value) | 
| 21 | 21 | ); | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 | public function beginTransaction() | 
| 52 | 52 |      { | 
| 53 | 53 | $this->execute( | 
| 54 | -            function (TransactionalInterface $handler) { | |
| 54 | +            function(TransactionalInterface $handler) { | |
| 55 | 55 | $handler->beginTransaction(); | 
| 56 | 56 | } | 
| 57 | 57 | ); | 
| @@ -63,7 +63,7 @@ discard block | ||
| 63 | 63 | public function rollback() | 
| 64 | 64 |      { | 
| 65 | 65 | $this->execute( | 
| 66 | -            function (TransactionalInterface $handler) { | |
| 66 | +            function(TransactionalInterface $handler) { | |
| 67 | 67 | $handler->rollback(); | 
| 68 | 68 | } | 
| 69 | 69 | ); | 
| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | public function commit() | 
| 76 | 76 |      { | 
| 77 | 77 | $this->execute( | 
| 78 | -            function (TransactionalInterface $handler) { | |
| 78 | +            function(TransactionalInterface $handler) { | |
| 79 | 79 | $handler->commit(); | 
| 80 | 80 | } | 
| 81 | 81 | ); |