Skip to content

Commit 55abba4

Browse files
author
Hüseyin Mert
authored
Merge branch 'master' into master
2 parents b46e835 + 4605318 commit 55abba4

86 files changed

Lines changed: 1247 additions & 1087 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- 5.4
54
- 5.5
65
- 5.6
76
- 7.0

APYDataGridBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
namespace APY\DataGridBundle;
1414

15+
use APY\DataGridBundle\DependencyInjection\Compiler\GridExtensionPass;
1516
use APY\DataGridBundle\DependencyInjection\Compiler\GridPass;
16-
use Symfony\Component\HttpKernel\Bundle\Bundle;
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
18-
use APY\DataGridBundle\DependencyInjection\Compiler\GridExtensionPass;
18+
use Symfony\Component\HttpKernel\Bundle\Bundle;
1919

2020
class APYDataGridBundle extends Bundle
2121
{

DependencyInjection/APYDataGridExtension.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
namespace APY\DataGridBundle\DependencyInjection;
1414

15-
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
16-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
15+
use Symfony\Component\Config\FileLocator;
1716
use Symfony\Component\DependencyInjection\ContainerBuilder;
1817
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
19-
use Symfony\Component\Config\FileLocator;
18+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
19+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2020

2121
class APYDataGridExtension extends Extension
2222
{
@@ -25,11 +25,11 @@ public function load(array $configs, ContainerBuilder $container)
2525
$configuration = new Configuration();
2626
$config = $this->processConfiguration($configuration, $configs);
2727

28-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
28+
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
2929
$loader->load('services.xml');
3030
$loader->load('columns.xml');
3131

32-
$ymlLoader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
32+
$ymlLoader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
3333
$ymlLoader->load('grid.yml');
3434

3535
$container->setParameter('apy_data_grid.limits', $config['limits']);

DependencyInjection/Compiler/GridExtensionPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
namespace APY\DataGridBundle\DependencyInjection\Compiler;
1414

15-
use Symfony\Component\DependencyInjection\Reference;
16-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1715
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16+
use Symfony\Component\DependencyInjection\ContainerBuilder;
17+
use Symfony\Component\DependencyInjection\Reference;
1818

1919
class GridExtensionPass implements CompilerPassInterface
2020
{
@@ -31,10 +31,10 @@ public function process(ContainerBuilder $container)
3131
// afterward. If not, the globals from the extensions will never
3232
// be registered.
3333
$calls = $definition->getMethodCalls();
34-
$definition->setMethodCalls(array());
34+
$definition->setMethodCalls([]);
3535

3636
foreach ($container->findTaggedServiceIds('grid.column.extension') as $id => $attributes) {
37-
$definition->addMethodCall('addColumnExtension', array(new Reference($id)));
37+
$definition->addMethodCall('addColumnExtension', [new Reference($id)]);
3838
}
3939

4040
$definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls));

DependencyInjection/Compiler/GridPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
2+
23
namespace APY\DataGridBundle\DependencyInjection\Compiler;
34

45
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
56
use Symfony\Component\DependencyInjection\ContainerBuilder;
67
use Symfony\Component\DependencyInjection\Reference;
78

89
/**
9-
* Class GridPass
10+
* Class GridPass.
1011
*
11-
* @package APY\DataGridBundle\DependencyInjection\Compiler
1212
* @author Quentin Ferrer
1313
*/
1414
class GridPass implements CompilerPassInterface

DependencyInjection/Compiler/TranslationPass.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
2+
23
namespace APY\DataGridBundle\DependencyInjection\Compiler;
34

45
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
56
use Symfony\Component\DependencyInjection\ContainerBuilder;
67
use Symfony\Component\DependencyInjection\Definition;
78

89
/**
9-
* Class TranslationPass
10+
* Class TranslationPass.
1011
*
1112
* @author Quentin FERRER
1213
*/

DependencyInjection/Configuration.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
use Symfony\Component\Config\Definition\ConfigurationInterface;
77

88
/**
9-
* This is the class that validates and merges configuration from your app/config files
9+
* This is the class that validates and merges configuration from your app/config files.
1010
*
1111
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
1212
*/
1313
class Configuration implements ConfigurationInterface
1414
{
1515
/**
16-
* {@inheritDoc}
16+
* {@inheritdoc}
1717
*/
1818
public function getConfigTreeBuilder()
1919
{
@@ -25,10 +25,10 @@ public function getConfigTreeBuilder()
2525
->arrayNode('limits')
2626
->performNoDeepMerging()
2727
->beforeNormalization()
28-
->ifTrue(function($v) { return !is_array($v); })
29-
->then(function($v) { return array($v); })
28+
->ifTrue(function ($v) { return !is_array($v); })
29+
->then(function ($v) { return [$v]; })
3030
->end()
31-
->defaultValue(array(20 => '20', 50 => '50', 100 => '100'))
31+
->defaultValue([20 => '20', 50 => '50', 100 => '100'])
3232
->prototype('scalar')->end()
3333
->end()
3434
->booleanNode('persistence')->defaultFalse()->end()
@@ -44,15 +44,14 @@ public function getConfigTreeBuilder()
4444
->booleanNode('enable')->defaultFalse()->end()
4545
->scalarNode('view_class')->defaultValue('Pagerfanta\View\DefaultView')->end()
4646
->arrayNode('options')
47-
->defaultValue(array('prev_message' => '«', 'next_message' => '»'))
47+
->defaultValue(['prev_message' => '«', 'next_message' => '»'])
4848
->useAttributeAsKey('options')
4949
->prototype('scalar')->end()
5050
->end()
5151
->end()
5252
->end()
53-
->end()
53+
->end();
5454

55-
;
5655
return $treeBuilder;
5756
}
5857
}

Grid/AbstractType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
2+
23
namespace APY\DataGridBundle\Grid;
34

45
use Symfony\Component\OptionsResolver\OptionsResolver;
56

67
/**
7-
* Class AbstractType
8+
* Class AbstractType.
89
*
9-
* @package APY\DataGridBundle
1010
* @author Quentin Ferrer
1111
*/
1212
abstract class AbstractType implements GridTypeInterface
1313
{
1414
/**
1515
* {@inheritdoc}
1616
*/
17-
public function buildGrid(GridBuilder $builder, array $options = array())
17+
public function buildGrid(GridBuilder $builder, array $options = [])
1818
{
1919
}
2020

Grid/Action/DeleteMassAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
class DeleteMassAction extends MassAction
1616
{
1717
/**
18-
* Default DeleteMassAction constructor
18+
* Default DeleteMassAction constructor.
1919
*
20-
* @param boolean $confirm Show confirm message if true
20+
* @param bool $confirm Show confirm message if true
2121
*/
2222
public function __construct($confirm = false)
2323
{

Grid/Action/MassAction.php

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,31 @@ class MassAction implements MassActionInterface
1717
protected $title;
1818
protected $callback;
1919
protected $confirm;
20-
protected $parameters = array();
20+
protected $confirmMessage;
21+
protected $parameters = [];
2122
protected $role;
2223

2324
/**
24-
* Default MassAction constructor
25+
* Default MassAction constructor.
2526
*
26-
* @param string $title Title of the mass action
27-
* @param string $callback Callback of the mass action
28-
* @param boolean $confirm Show confirm message if true
29-
* @param array $parameters Additional parameters
30-
* @param string $role Security role
27+
* @param string $title Title of the mass action
28+
* @param string $callback Callback of the mass action
29+
* @param bool $confirm Show confirm message if true
30+
* @param array $parameters Additional parameters
31+
* @param string $role Security role
3132
*/
32-
public function __construct($title, $callback = null, $confirm = false, $parameters = array(), $role = null)
33+
public function __construct($title, $callback = null, $confirm = false, $parameters = [], $role = null)
3334
{
3435
$this->title = $title;
3536
$this->callback = $callback;
3637
$this->confirm = $confirm;
37-
$this->confirmMessage = 'Do you want to '.strtolower($title).' the selected rows?';
38+
$this->confirmMessage = 'Do you want to ' . strtolower($title) . ' the selected rows?';
3839
$this->parameters = $parameters;
3940
$this->role = $role;
4041
}
4142

4243
/**
43-
* Set action title
44+
* Set action title.
4445
*
4546
* @param $title
4647
*
@@ -54,7 +55,7 @@ public function setTitle($title)
5455
}
5556

5657
/**
57-
* get action title
58+
* get action title.
5859
*
5960
* @return string
6061
*/
@@ -64,7 +65,7 @@ public function getTitle()
6465
}
6566

6667
/**
67-
* Set action callback
68+
* Set action callback.
6869
*
6970
* @param $callback
7071
*
@@ -78,7 +79,7 @@ public function setCallback($callback)
7879
}
7980

8081
/**
81-
* get action callback
82+
* get action callback.
8283
*
8384
* @return string
8485
*/
@@ -88,7 +89,7 @@ public function getCallback()
8889
}
8990

9091
/**
91-
* Set action confirm
92+
* Set action confirm.
9293
*
9394
* @param $confirm
9495
*
@@ -102,17 +103,17 @@ public function setConfirm($confirm)
102103
}
103104

104105
/**
105-
* Get action confirm
106+
* Get action confirm.
106107
*
107-
* @return boolean
108+
* @return bool
108109
*/
109110
public function getConfirm()
110111
{
111112
return $this->confirm;
112113
}
113114

114115
/**
115-
* Set action confirmMessage
116+
* Set action confirmMessage.
116117
*
117118
* @param string $confirmMessage
118119
*
@@ -126,7 +127,7 @@ public function setConfirmMessage($confirmMessage)
126127
}
127128

128129
/**
129-
* get action confirmMessage
130+
* get action confirmMessage.
130131
*
131132
* @return string
132133
*/
@@ -136,9 +137,10 @@ public function getConfirmMessage()
136137
}
137138

138139
/**
139-
* Set action/controller parameters
140+
* Set action/controller parameters.
140141
*
141142
* @param array $parameters
143+
*
142144
* @return $this
143145
*/
144146
public function setParameters(array $parameters)
@@ -149,7 +151,7 @@ public function setParameters(array $parameters)
149151
}
150152

151153
/**
152-
* Get action/controller parameters
154+
* Get action/controller parameters.
153155
*
154156
* @return array
155157
*/
@@ -159,7 +161,7 @@ public function getParameters()
159161
}
160162

161163
/**
162-
* set role
164+
* set role.
163165
*
164166
* @param mixed $role
165167
*
@@ -173,7 +175,7 @@ public function setRole($role)
173175
}
174176

175177
/**
176-
* Get role
178+
* Get role.
177179
*
178180
* @return mixed
179181
*/

0 commit comments

Comments
 (0)