Skip to content

Commit 2fc9fcd

Browse files
SpacePossumnicolas-grekas
authored andcommitted
[CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction
1 parent 8121087 commit 2fc9fcd

6 files changed

+15
-15
lines changed

Command/DebugCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888

8989
$types = array('functions', 'filters', 'tests', 'globals');
9090

91-
if ($input->getOption('format') === 'json') {
91+
if ('json' === $input->getOption('format')) {
9292
$data = array();
9393
foreach ($types as $type) {
9494
foreach ($twig->{'get'.ucfirst($type)}() as $name => $entity) {
@@ -129,13 +129,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
129129

130130
private function getMetadata($type, $entity)
131131
{
132-
if ($type === 'globals') {
132+
if ('globals' === $type) {
133133
return $entity;
134134
}
135-
if ($type === 'tests') {
135+
if ('tests' === $type) {
136136
return;
137137
}
138-
if ($type === 'functions' || $type === 'filters') {
138+
if ('functions' === $type || 'filters' === $type) {
139139
$cb = $entity->getCallable();
140140
if (null === $cb) {
141141
return;
@@ -165,7 +165,7 @@ private function getMetadata($type, $entity)
165165
array_shift($args);
166166
}
167167

168-
if ($type === 'filters') {
168+
if ('filters' === $type) {
169169
// remove the value the filter is applied on
170170
array_shift($args);
171171
}
@@ -185,32 +185,32 @@ private function getMetadata($type, $entity)
185185

186186
private function getPrettyMetadata($type, $entity)
187187
{
188-
if ($type === 'tests') {
188+
if ('tests' === $type) {
189189
return '';
190190
}
191191

192192
try {
193193
$meta = $this->getMetadata($type, $entity);
194-
if ($meta === null) {
194+
if (null === $meta) {
195195
return '(unknown?)';
196196
}
197197
} catch (\UnexpectedValueException $e) {
198198
return ' <error>'.$e->getMessage().'</error>';
199199
}
200200

201-
if ($type === 'globals') {
201+
if ('globals' === $type) {
202202
if (is_object($meta)) {
203203
return ' = object('.get_class($meta).')';
204204
}
205205

206206
return ' = '.substr(@json_encode($meta), 0, 50);
207207
}
208208

209-
if ($type === 'functions') {
209+
if ('functions' === $type) {
210210
return '('.implode(', ', $meta).')';
211211
}
212212

213-
if ($type === 'filters') {
213+
if ('filters' === $type) {
214214
return $meta ? '('.implode(', ', $meta).')' : '';
215215
}
216216
}

Extension/StopwatchExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getTokenParsers()
4848
* Some stuff which will be recorded on the timeline
4949
* {% endstopwatch %}
5050
*/
51-
new StopwatchTokenParser($this->stopwatch !== null && $this->enabled),
51+
new StopwatchTokenParser(null !== $this->stopwatch && $this->enabled),
5252
);
5353
}
5454

Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function renderEnctype(FormView $view)
7575

7676
protected function renderLabel(FormView $view, $label = null, array $vars = array())
7777
{
78-
if ($label !== null) {
78+
if (null !== $label) {
7979
$vars += array('label' => $label);
8080
}
8181

Tests/Extension/FormExtensionBootstrap3LayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function renderEnctype(FormView $view)
7575

7676
protected function renderLabel(FormView $view, $label = null, array $vars = array())
7777
{
78-
if ($label !== null) {
78+
if (null !== $label) {
7979
$vars += array('label' => $label);
8080
}
8181

Tests/Extension/FormExtensionDivLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function renderEnctype(FormView $view)
158158

159159
protected function renderLabel(FormView $view, $label = null, array $vars = array())
160160
{
161-
if ($label !== null) {
161+
if (null !== $label) {
162162
$vars += array('label' => $label);
163163
}
164164

Tests/Extension/FormExtensionTableLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function renderEnctype(FormView $view)
7676

7777
protected function renderLabel(FormView $view, $label = null, array $vars = array())
7878
{
79-
if ($label !== null) {
79+
if (null !== $label) {
8080
$vars += array('label' => $label);
8181
}
8282

0 commit comments

Comments
 (0)