@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Psi\Component\Grid\View; |
| 6 | 6 | |
| 7 | -use Psi\Component\Grid\CellInterface; |
|
| 8 | 7 | use Psi\Component\Grid\ColumnFactory; |
| 9 | 8 | use Psi\Component\Grid\GridContext; |
| 10 | 9 | use Psi\Component\Grid\Metadata\GridMetadata; |
@@ -4,11 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Psi\Component\Grid\Column; |
| 6 | 6 | |
| 7 | -use Psi\Component\Grid\CellInterface; |
|
| 8 | 7 | use Psi\Component\Grid\ColumnInterface; |
| 9 | -use Psi\Component\Grid\GridContext; |
|
| 10 | 8 | use Psi\Component\Grid\View\Cell; |
| 11 | -use Psi\Component\Grid\View\Header; |
|
| 12 | 9 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 13 | 10 | use Symfony\Component\PropertyAccess\PropertyAccess; |
| 14 | 11 | use Symfony\Component\PropertyAccess\PropertyAccessorInterface; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Psi\Component\Grid\Column; |
| 6 | 6 | |
@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $options->setDefault('property', null); |
| 38 | 38 | $options->setAllowedTypes('property', ['string', 'null']); |
| 39 | - $options->setNormalizer('property', function (OptionsResolver $options, $value) { |
|
| 39 | + $options->setNormalizer('property', function(OptionsResolver $options, $value) { |
|
| 40 | 40 | if (null !== $value) { |
| 41 | 41 | return $value; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | return $options['column_name']; |
| 45 | 45 | }); |
| 46 | - $options->setNormalizer('sort_field', function (OptionsResolver $options, $value) { |
|
| 46 | + $options->setNormalizer('sort_field', function(OptionsResolver $options, $value) { |
|
| 47 | 47 | if (null !== $value) { |
| 48 | 48 | return $value; |
| 49 | 49 | } |
@@ -69,6 +69,9 @@ discard block |
||
| 69 | 69 | return $this; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + /** |
|
| 73 | + * @param string $alias |
|
| 74 | + */ |
|
| 72 | 75 | public function addAction(ActionInterface $action, $alias = null): self |
| 73 | 76 | { |
| 74 | 77 | $this->actions[$alias] = $action; |
@@ -76,6 +79,9 @@ discard block |
||
| 76 | 79 | return $this; |
| 77 | 80 | } |
| 78 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $alias |
|
| 84 | + */ |
|
| 79 | 85 | public function addFilter(FilterInterface $filter, $alias = null) |
| 80 | 86 | { |
| 81 | 87 | $this->filters[$alias] = $filter; |
@@ -83,6 +89,9 @@ discard block |
||
| 83 | 89 | return $this; |
| 84 | 90 | } |
| 85 | 91 | |
| 92 | + /** |
|
| 93 | + * @param string $alias |
|
| 94 | + */ |
|
| 86 | 95 | public function addColumn(ColumnInterface $column, $alias = null) |
| 87 | 96 | { |
| 88 | 97 | $this->columns[$alias] = $column; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Psi\Component\Grid; |
| 6 | 6 | |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | private function resolveLayers(ColumnInterface $column) |
| 61 | 61 | { |
| 62 | - $layers = [ $column ]; |
|
| 63 | - $seen = [ spl_object_hash($column) => true ]; |
|
| 62 | + $layers = [$column]; |
|
| 63 | + $seen = [spl_object_hash($column) => true]; |
|
| 64 | 64 | |
| 65 | 65 | while (null !== $parentType = $column->getParent()) { |
| 66 | 66 | $parent = $this->registry->get($parentType); |