| @@ -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)); | 
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 | $fields = func_get_args(); | 
| 79 | 79 | $elements = array(); | 
| 80 | 80 |          if ($fields || (isset($this->elements[0]) && is_array($this->elements[0]))) { | 
| 81 | -            $this->each(function ($element) use (&$elements, $fields) { | |
| 81 | +            $this->each(function($element) use (&$elements, $fields) { | |
| 82 | 82 |                  if ($element instanceof ReadModelInterface) { | 
| 83 | 83 | $element = $element->serialize(); | 
| 84 | 84 | } | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | $elements = parent::toArray($resortIndex); | 
| 111 | 111 | |
| 112 | 112 |          if (null !== $this->classMapper) { | 
| 113 | -            return array_map(function (SerializableInterface $element) { | |
| 113 | +            return array_map(function(SerializableInterface $element) { | |
| 114 | 114 | return $element->serialize(); | 
| 115 | 115 | }, (array) $elements); | 
| 116 | 116 | } | 
| @@ -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]); | 
| @@ -37,7 +37,7 @@ | ||
| 37 | 37 | */ | 
| 38 | 38 | public function comparison($field, $comparison, $value) | 
| 39 | 39 |      { | 
| 40 | - return $this->quote.$field.$this->quote . ' ' . $comparison . ' ' . $this->normalizeValue($value); | |
| 40 | + return $this->quote . $field . $this->quote . ' ' . $comparison . ' ' . $this->normalizeValue($value); | |
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | 43 | /** | 
| @@ -307,6 +307,6 @@ | ||
| 307 | 307 | */ | 
| 308 | 308 | protected function quote($field) | 
| 309 | 309 |      { | 
| 310 | - return $this->quote.$field.$this->quote; | |
| 310 | + return $this->quote . $field . $this->quote; | |
| 311 | 311 | } | 
| 312 | 312 | } | 
| @@ -80,7 +80,7 @@ discard block | ||
| 80 | 80 | * @param ParserInterface $parser | 
| 81 | 81 | * @param string $quote | 
| 82 | 82 | */ | 
| 83 | - public function __construct(Pdo &$conn, $table, $class, $parser, $quote) | |
| 83 | + public function __construct(Pdo & $conn, $table, $class, $parser, $quote) | |
| 84 | 84 |      { | 
| 85 | 85 | $this->conn = $conn; | 
| 86 | 86 | $this->table = $table; | 
| @@ -220,7 +220,7 @@ discard block | ||
| 220 | 220 |      { | 
| 221 | 221 | $joiner = ' ' . CompositeExpressionInterface::LOGICAL_AND . ' '; | 
| 222 | 222 | |
| 223 | -        return implode($joiner, array_map(function ($item) { | |
| 223 | +        return implode($joiner, array_map(function($item) { | |
| 224 | 224 | return (string) $item; | 
| 225 | 225 | }, $this->conditions)); | 
| 226 | 226 | } | 
| @@ -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); | 
| @@ -265,6 +265,6 @@ discard block | ||
| 265 | 265 | */ | 
| 266 | 266 | private function getMethodName($name) | 
| 267 | 267 |      { | 
| 268 | - return $this->prefixMethod.ucfirst($name); | |
| 268 | + return $this->prefixMethod . ucfirst($name); | |
| 269 | 269 | } | 
| 270 | 270 | } | 
| @@ -107,7 +107,7 @@ | ||
| 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 | } |