@@ -17,7 +17,7 @@ |
||
17 | 17 | public function __construct(array $config) |
18 | 18 | { |
19 | 19 | foreach ($config as $key => $value) { |
20 | - $setter = 'set' . ucfirst($key); |
|
20 | + $setter = 'set'.ucfirst($key); |
|
21 | 21 | if (method_exists($this, $setter)) { |
22 | 22 | $this->$setter($value); |
23 | 23 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | $this->container = $container; |
47 | 47 | foreach ($this->container as $key => $value) { |
48 | - $setter = 'set' . ucfirst($key); |
|
48 | + $setter = 'set'.ucfirst($key); |
|
49 | 49 | if (method_exists($this, $setter)) { |
50 | 50 | $this->$setter($value); |
51 | 51 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | public function addColumn(string $columnClass, array $config = []): DataGridBuilderInterface |
44 | 44 | { |
45 | 45 | if (!is_subclass_of($columnClass, AbstractColumn::class)) { |
46 | - throw new InvalidArgumentException('Expected subclass of' . AbstractColumn::class); |
|
46 | + throw new InvalidArgumentException('Expected subclass of'.AbstractColumn::class); |
|
47 | 47 | } |
48 | 48 | $this->columns[] = new $columnClass($this->container, array_merge(['template' => $this->options['template']], $config)); |
49 | 49 | return $this; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | protected function setConfigurationOptions($options) |
104 | 104 | { |
105 | 105 | foreach ($options as $key => $value) { |
106 | - $setter = 'set' . ucfirst($key); |
|
106 | + $setter = 'set'.ucfirst($key); |
|
107 | 107 | if (method_exists($this, $setter)) { |
108 | 108 | $this->$setter($value); |
109 | 109 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $this->filtersCriteria |
141 | 141 | ->orderBy($this->sort) |
142 | 142 | ->setMaxResults($this->hasPagination() ? $this->limit : null) |
143 | - ->setFirstResult($this->hasPagination() ? ($this->page - 1) * $this->limit : null); |
|
143 | + ->setFirstResult($this->hasPagination() ? ($this->page-1) * $this->limit : null); |
|
144 | 144 | return $this->repository->matching($this->filtersCriteria); |
145 | 145 | } |
146 | 146 | |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | if ($this->page < 5) { |
254 | 254 | return array_merge(range(1, 6), [null, $this->maxPage]); |
255 | 255 | } |
256 | - if ($this->page > $this->maxPage - 4) { |
|
257 | - return array_merge([1, null], range($this->maxPage - 5, $this->maxPage)); |
|
256 | + if ($this->page > $this->maxPage-4) { |
|
257 | + return array_merge([1, null], range($this->maxPage-5, $this->maxPage)); |
|
258 | 258 | } |
259 | - return array_merge([1, null], range($this->page - 2, $this->page + 2), [null, $this->maxPage]); |
|
259 | + return array_merge([1, null], range($this->page-2, $this->page+2), [null, $this->maxPage]); |
|
260 | 260 | } |
261 | 261 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | public function getCellContent($entity) |
41 | 41 | { |
42 | - return preg_replace_callback('/\{(\w+)\}/', function ($matches) use ($entity) { |
|
42 | + return preg_replace_callback('/\{(\w+)\}/', function($matches) use ($entity) { |
|
43 | 43 | if ($this->isButtonVisible($matches[1])) { |
44 | 44 | if (array_key_exists($matches[1], $this->buttons) && is_callable($this->buttons[$matches[1]])) { |
45 | 45 | return call_user_func_array($this->buttons[$matches[1]], [ |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | if (is_callable($this->urlGenerator)) { |
73 | 73 | return call_user_func_array($this->urlGenerator, [$entity, $action, $this->container['router']]); |
74 | 74 | } elseif (method_exists($entity, 'getId')) { |
75 | - return $this->container['router']->generate($this->pathPrefix . $action, ['id' => $entity->getId()]); |
|
75 | + return $this->container['router']->generate($this->pathPrefix.$action, ['id' => $entity->getId()]); |
|
76 | 76 | } else { |
77 | - throw new Exception('Could not generate url for action: ' . $action); |
|
77 | + throw new Exception('Could not generate url for action: '.$action); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 |