Skip to content

Commit 57958dc

Browse files
Leny BERNARDStyleCIBot
Leny BERNARD
authored andcommitted
Applied fixes from StyleCI
1 parent a8b17a3 commit 57958dc

6 files changed

+73
-68
lines changed

Command/ButtonSizeMigratorCommand.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?php
2+
23
namespace Victoire\Widget\ButtonBundle\Command;
34

4-
use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
55
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
66
use Symfony\Component\Console\Input\InputInterface;
77
use Symfony\Component\Console\Output\OutputInterface;
8-
use Victoire\Bundle\CoreBundle\Entity\Link;
98

109
class ButtonSizeMigratorCommand extends ContainerAwareCommand
1110
{
1211
/**
13-
* {@inheritDoc}
12+
* {@inheritdoc}
1413
*/
1514
public function configure()
1615
{
@@ -22,7 +21,8 @@ public function configure()
2221
}
2322

2423
/**
25-
* Read declared business entities and BusinessEntityPatternPages to generate their urls
24+
* Read declared business entities and BusinessEntityPatternPages to generate their urls.
25+
*
2626
* @param InputInterface $input
2727
* @param OutputInterface $output
2828
*
@@ -42,9 +42,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
4242
$progress->advance();
4343
if ($button->getSize() == 'large') {
4444
$button->setSize('lg');
45-
} else if ($button->getSize() == 'tiny') {
45+
} elseif ($button->getSize() == 'tiny') {
4646
$button->setSize('sm');
47-
} else if ($button->getSize() == 'normal') {
47+
} elseif ($button->getSize() == 'normal') {
4848
$button->setSize('md');
4949
}
5050

DependencyInjection/Configuration.php

+2-2
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-
* Get the configuration
16+
* Get the configuration.
1717
*
1818
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder
1919
*/

DependencyInjection/VictoireWidgetButtonExtension.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
namespace Victoire\Widget\ButtonBundle\DependencyInjection;
44

5-
use Symfony\Component\DependencyInjection\ContainerBuilder;
65
use Symfony\Component\Config\FileLocator;
7-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
6+
use Symfony\Component\DependencyInjection\ContainerBuilder;
87
use Symfony\Component\DependencyInjection\Loader;
8+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
99

1010
/**
11-
* This is the class that loads and manages your bundle configuration
11+
* This is the class that loads and manages your bundle configuration.
1212
*
1313
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
1414
*/
1515
class VictoireWidgetButtonExtension extends Extension
1616
{
1717
/**
18-
* Load extension
18+
* Load extension.
1919
*
20-
* @param array $configs
20+
* @param array $configs
2121
* @param ContainerBuilder $container
2222
*/
2323
public function load(array $configs, ContainerBuilder $container)

Entity/WidgetButton.php

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
2+
23
namespace Victoire\Widget\ButtonBundle\Entity;
34

45
use Doctrine\ORM\Mapping as ORM;
56
use Victoire\Bundle\WidgetBundle\Entity\Widget;
67

78
/**
8-
* WidgetButton
9+
* WidgetButton.
910
*
1011
* @ORM\Table("vic_widget_button")
1112
* @ORM\Entity
@@ -65,7 +66,7 @@ class WidgetButton extends Widget
6566
protected $icon;
6667

6768
/**
68-
* Set title
69+
* Set title.
6970
*
7071
* @param string $title
7172
*
@@ -79,7 +80,7 @@ public function setTitle($title)
7980
}
8081

8182
/**
82-
* Get title
83+
* Get title.
8384
*
8485
* @return string
8586
*/
@@ -89,7 +90,7 @@ public function getTitle()
8990
}
9091

9192
/**
92-
* Set hoverTitle
93+
* Set hoverTitle.
9394
*
9495
* @param string $hoverTitle
9596
*
@@ -103,7 +104,7 @@ public function setHoverTitle($hoverTitle)
103104
}
104105

105106
/**
106-
* Get hoverTitle
107+
* Get hoverTitle.
107108
*
108109
* @return string
109110
*/
@@ -113,7 +114,7 @@ public function getHoverTitle()
113114
}
114115

115116
/**
116-
* Set style
117+
* Set style.
117118
*
118119
* @param string $style
119120
*
@@ -127,7 +128,7 @@ public function setStyle($style)
127128
}
128129

129130
/**
130-
* Get style
131+
* Get style.
131132
*
132133
* @return string
133134
*/
@@ -137,7 +138,7 @@ public function getStyle()
137138
}
138139

139140
/**
140-
* Set size
141+
* Set size.
141142
*
142143
* @param string $size
143144
*
@@ -151,7 +152,7 @@ public function setSize($size)
151152
}
152153

153154
/**
154-
* Get size
155+
* Get size.
155156
*
156157
* @return string
157158
*/
@@ -161,7 +162,7 @@ public function getSize()
161162
}
162163

163164
/**
164-
* Get isBlock
165+
* Get isBlock.
165166
*
166167
* @return string
167168
*/
@@ -171,7 +172,8 @@ public function getIsBlock()
171172
}
172173

173174
/**
174-
* Set isBlock
175+
* Set isBlock.
176+
*
175177
* @param string $isBlock
176178
*
177179
* @return $this
@@ -184,7 +186,7 @@ public function setIsBlock($isBlock)
184186
}
185187

186188
/**
187-
* Get isCallToAction
189+
* Get isCallToAction.
188190
*
189191
* @return string
190192
*/
@@ -194,7 +196,8 @@ public function getIsCallToAction()
194196
}
195197

196198
/**
197-
* Set isCallToAction
199+
* Set isCallToAction.
200+
*
198201
* @param string $isCallToAction
199202
*
200203
* @return $this
@@ -207,7 +210,7 @@ public function setIsCallToAction($isCallToAction)
207210
}
208211

209212
/**
210-
* Get icon
213+
* Get icon.
211214
*
212215
* @return string
213216
*/
@@ -217,7 +220,8 @@ public function getIcon()
217220
}
218221

219222
/**
220-
* Set icon
223+
* Set icon.
224+
*
221225
* @param string $icon
222226
*
223227
* @return $this

Form/WidgetButtonType.php

+25-25
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
use Victoire\Bundle\CoreBundle\Form\WidgetType;
88

99
/**
10-
* WidgetButton form type
10+
* WidgetButton form type.
1111
*/
1212
class WidgetButtonType extends WidgetType
1313
{
1414
/**
15-
* define form fields
15+
* define form fields.
1616
*
1717
* @param FormBuilderInterface $builder
1818
* @param array $options
@@ -23,64 +23,64 @@ public function buildForm(FormBuilderInterface $builder, array $options)
2323
{
2424
//if no entity is given, we generate the static form
2525
$builder
26-
->add('title', null, array(
26+
->add('title', null, [
2727
'label' => 'widget.button.form.label.title',
28-
))
29-
->add('hoverTitle', null, array(
28+
])
29+
->add('hoverTitle', null, [
3030
'label' => 'widget.button.form.label.hoverTitle',
31-
))
32-
->add('size', 'choice', array(
31+
])
32+
->add('size', 'choice', [
3333
'label' => 'widget.button.form.label.size',
34-
'choices' => array(
34+
'choices' => [
3535
'md' => 'widget.button.form.choice.size.normal',
3636
'sm' => 'widget.button.form.choice.size.tiny',
3737
'lg' => 'widget.button.form.choice.size.large',
38-
),
38+
],
3939
'required' => true,
40-
))
41-
->add('style', 'choice', array(
42-
'label' => 'widget.button.form.label.style',
43-
'choices' => array(
40+
])
41+
->add('style', 'choice', [
42+
'label' => 'widget.button.form.label.style',
43+
'choices' => [
4444
'default' => 'widget.button.form.choice.style.label.default',
4545
'primary' => 'widget.button.form.choice.style.label.primary',
4646
'success' => 'widget.button.form.choice.style.label.success',
4747
'info' => 'widget.button.form.choice.style.label.info',
4848
'warning' => 'widget.button.form.choice.style.label.warning',
4949
'danger' => 'widget.button.form.choice.style.label.danger',
5050
'link' => 'widget.button.form.choice.style.label.link',
51-
),
51+
],
5252
'required' => true,
53-
))
53+
])
5454
->add('link', 'victoire_link')
55-
->add('isBlock', null, array(
55+
->add('isBlock', null, [
5656
'label' => 'widget.button.form.label.isBlock',
57-
))
58-
->add('isCallToAction', null, array(
57+
])
58+
->add('isCallToAction', null, [
5959
'label' => 'widget.button.form.label.isBlock.isCallToAction',
60-
))
61-
->add('icon', 'font_awesome_picker')
62-
;
60+
])
61+
->add('icon', 'font_awesome_picker');
6362

6463
parent::buildForm($builder, $options);
6564
}
6665

6766
/**
68-
* bind form to WidgetButton entity
67+
* bind form to WidgetButton entity.
68+
*
6969
* @param OptionsResolverInterface $resolver
7070
*/
7171
public function setDefaultOptions(OptionsResolverInterface $resolver)
7272
{
7373
parent::setDefaultOptions($resolver);
7474

75-
$resolver->setDefaults(array(
75+
$resolver->setDefaults([
7676
'data_class' => 'Victoire\Widget\ButtonBundle\Entity\WidgetButton',
7777
'widget' => 'Button',
7878
'translation_domain' => 'victoire',
79-
));
79+
]);
8080
}
8181

8282
/**
83-
* get form name
83+
* get form name.
8484
*
8585
* @return string
8686
*/

0 commit comments

Comments
 (0)