@@ -11,10 +11,10 @@ |
||
11 | 11 | { |
12 | 12 | parent::configureOptions($resolver); |
13 | 13 | $resolver->setRequired('LinkTextField'); |
14 | - $resolver->setDefault('AltTextField', function (Options $options) { |
|
14 | + $resolver->setDefault('AltTextField', function(Options $options) { |
|
15 | 15 | return $options['LinkTextField']; |
16 | 16 | }); |
17 | - $resolver->setDefault('UrlField', function (Options $options) { |
|
17 | + $resolver->setDefault('UrlField', function(Options $options) { |
|
18 | 18 | return $options['LinkTextField']; |
19 | 19 | }); |
20 | 20 | $resolver->setDefault('UrlCallback', function($value, $row) { |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | $builder = new ColumnBuilder(); |
12 | 12 | |
13 | - for ($i=0;$i<3;$i++) { |
|
13 | + for ($i = 0; $i<3; $i++) { |
|
14 | 14 | $builder->add("testcolumn".$i, new Column("test column ".$i)); |
15 | 15 | } |
16 | 16 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | //From https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Tests/bootstrap.php |
4 | -if (!($loader = @include __DIR__ . '/../vendor/autoload.php')) { |
|
4 | +if (!($loader = @include __DIR__.'/../vendor/autoload.php')) { |
|
5 | 5 | echo <<<EOT |
6 | 6 | You need to install the project dependencies using Composer: |
7 | 7 | $ wget http://getcomposer.org/composer.phar |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $value = $rawValue; |
32 | 32 | } |
33 | 33 | |
34 | - $colVal = $column->formatCell($value, $row, $context);//Column definition |
|
34 | + $colVal = $column->formatCell($value, $row, $context); //Column definition |
|
35 | 35 | $newRow[$colIdentifier] = $colVal; |
36 | 36 | } |
37 | 37 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @var array |
15 | 15 | */ |
16 | 16 | public static $clientSideColumnOptions = [ |
17 | - 'cellType','className','contentPadding', 'createdCell', 'data', 'defaultContent', 'name', 'orderable', |
|
17 | + 'cellType', 'className', 'contentPadding', 'createdCell', 'data', 'defaultContent', 'name', 'orderable', |
|
18 | 18 | 'orderData', 'orderDataType', 'render', 'searchable', 'title', 'type', 'visible', 'width' |
19 | 19 | ]; |
20 | 20 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | protected $formatValueCallback; |
35 | 35 | |
36 | - public function __construct($title='', $options=[]) |
|
36 | + public function __construct($title = '', $options = []) |
|
37 | 37 | { |
38 | 38 | $this->optionsResolver = new OptionsResolver(); |
39 | 39 | $this->configureOptions($this->optionsResolver); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | if (is_callable($this->formatValueCallback)) { |
96 | 96 | return call_user_func_array($this->formatValueCallback, [$value, $rowData, $context]); |
97 | - } else{ |
|
97 | + } else { |
|
98 | 98 | return $value; |
99 | 99 | } |
100 | 100 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * @param \Closure $callback |
111 | 111 | */ |
112 | - public function setFormatValueCallback(\Closure $callback=null) |
|
112 | + public function setFormatValueCallback(\Closure $callback = null) |
|
113 | 113 | { |
114 | 114 | $this->formatValueCallback = $callback; |
115 | 115 | return $this; |
@@ -12,9 +12,9 @@ |
||
12 | 12 | $jsonVars = []; |
13 | 13 | $jsonVars['recordsTotal'] = $table->getUnfilteredCount(); |
14 | 14 | $filterCount = $table->getFilteredCount(); |
15 | - $jsonVars['recordsFiltered'] = $filterCount!==false ? $filterCount : $jsonVars['recordsTotal']; |
|
15 | + $jsonVars['recordsFiltered'] = $filterCount !== false ? $filterCount : $jsonVars['recordsTotal']; |
|
16 | 16 | $jsonVars['data'] = array_map( |
17 | - function ($item) { |
|
17 | + function($item) { |
|
18 | 18 | $t = []; |
19 | 19 | foreach ($item as $k => $v) { |
20 | 20 | $t[] = $v; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | abstract class AbstractTable |
20 | 20 | { |
21 | - const VIEW_CONTEXT = 'view'; |
|
21 | + const VIEW_CONTEXT = 'view'; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * @var Router |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @param OptionsResolver $resolver |
145 | 145 | */ |
146 | - public function configureOptions(OptionsResolver $resolver){} |
|
146 | + public function configureOptions(OptionsResolver $resolver) {} |
|
147 | 147 | /** |
148 | 148 | * @return array |
149 | 149 | */ |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | { |
184 | 184 | $t = []; |
185 | 185 | foreach ($this->getDataIterator($context) as $item) { |
186 | - $formatted = $this->formatter->formatRow($item, $this, $context); |
|
186 | + $formatted = $this->formatter->formatRow($item, $this, $context); |
|
187 | 187 | $t[] = $formatted; |
188 | 188 | } |
189 | 189 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function getFilterForm() |
224 | 224 | { |
225 | - if (null===$this->filterForm) { |
|
225 | + if (null === $this->filterForm) { |
|
226 | 226 | $this->filterForm = $this->buildFilterForm( |
227 | 227 | $this->formFactory->createNamedBuilder($this->getTableId().'_filter') |
228 | 228 | ->add('dofilter', ButtonType::class) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function getColumns($context = self::VIEW_CONTEXT) |
256 | 256 | { |
257 | - if(!array_key_exists($context, $this->columns)) { |
|
257 | + if (!array_key_exists($context, $this->columns)) { |
|
258 | 258 | $this->initColumnsDefinitions($context); |
259 | 259 | } |
260 | 260 | return $this->columns[$context]; |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $this->buildColumns($builder, $context); |
270 | 270 | |
271 | 271 | $this->columns[$context] = $builder->getColumns(); |
272 | - $this->columnsInitialized[$context] = true; |
|
272 | + $this->columnsInitialized[$context] = true; |
|
273 | 273 | } |
274 | 274 | /** |
275 | 275 | * Sets the table identifier |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | trait UsesContainerTrait |
10 | 10 | { |
11 | - protected function compileContainer(ContainerBuilder $container, $loadExt=true) |
|
11 | + protected function compileContainer(ContainerBuilder $container, $loadExt = true) |
|
12 | 12 | { |
13 | 13 | if ($loadExt) { |
14 | 14 | $extension = new CrossKnowledgeDataTableExtension(); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function testFormatCellUsesCallback() |
21 | 21 | { |
22 | 22 | $column = new Column("test"); |
23 | - $column->setFormatValueCallback(function($val, $row){ |
|
23 | + $column->setFormatValueCallback(function($val, $row) { |
|
24 | 24 | return $val.'ok'; |
25 | 25 | }); |
26 | 26 |