@@ -24,7 +24,7 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | return collect(explode(static::TYPE_SEPARATE, (string) $value)) |
| 27 | - ->map(static function ($value) { |
|
| 27 | + ->map(static function($value) { |
|
| 28 | 28 | return (int) $value; |
| 29 | 29 | }) |
| 30 | 30 | ->toArray(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return $this |
| 62 | 62 | ->getChildren() |
| 63 | 63 | ->reduce( |
| 64 | - static function (int $count, self $node) { |
|
| 64 | + static function(int $count, self $node) { |
|
| 65 | 65 | return $count + $node->countDescendants(); |
| 66 | 66 | }, |
| 67 | 67 | $this |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | $this |
| 93 | 93 | ->getChildren() |
| 94 | - ->each(static function (self $node) use ($callback) { |
|
| 94 | + ->each(static function(self $node) use ($callback) { |
|
| 95 | 95 | $node->each($callback); |
| 96 | 96 | }); |
| 97 | 97 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | public function toCollection(): LTreeCollection |
| 100 | 100 | { |
| 101 | 101 | $collection = new LTreeCollection(); |
| 102 | - $this->each(static function (self $item) use ($collection) { |
|
| 102 | + $this->each(static function(self $item) use ($collection) { |
|
| 103 | 103 | $collection->add($item->model); |
| 104 | 104 | }); |
| 105 | 105 | return $collection; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if (!is_callable($options)) { |
| 128 | 128 | $callback = $this->optionsToCallback($options); |
| 129 | 129 | } |
| 130 | - $children->each(static function ($child) use ($callback) { |
|
| 130 | + $children->each(static function($child) use ($callback) { |
|
| 131 | 131 | /** @var LTreeNode $child */ |
| 132 | 132 | $child->sortTree($callback); |
| 133 | 133 | }); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | private function optionsToCallback(array $options): callable |
| 152 | 152 | { |
| 153 | - return function ($a, $b) use ($options) { |
|
| 153 | + return function($a, $b) use ($options) { |
|
| 154 | 154 | foreach ($options as $property => $sort) { |
| 155 | 155 | if (!in_array(strtolower($sort), ['asc', 'desc'], true)) { |
| 156 | 156 | throw new InvalidArgumentException("Order '${sort}'' must be asc or desc"); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | $this->query->join( |
| 64 | 64 | sprintf('%s as %s', $table, $alias), |
| 65 | - function (JoinClause $query) use ($alias, $table, $related) { |
|
| 65 | + function(JoinClause $query) use ($alias, $table, $related) { |
|
| 66 | 66 | $query->whereRaw(sprintf('%1$s.%2$s @> %3$s.%2$s', $alias, $related->getLtreePathColumn(), $table)); |
| 67 | 67 | } |
| 68 | 68 | ); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function ltree() |
| 14 | 14 | { |
| 15 | - return function (string $column): Fluent { |
|
| 15 | + return function(string $column): Fluent { |
|
| 16 | 16 | return $this->addColumn(LTreeType::TYPE_NAME, $column); |
| 17 | 17 | }; |
| 18 | 18 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | protected function typeLtree() |
| 13 | 13 | { |
| 14 | - return function (): string { |
|
| 14 | + return function(): string { |
|
| 15 | 15 | return LTreeType::TYPE_NAME; |
| 16 | 16 | }; |
| 17 | 17 | } |