Skip to content

Commit 2b317c1

Browse files
committed
minor symfony#21363 CS fixes (fabpot)
This PR was squashed before being merged into the 2.7 branch (closes symfony#21363). Discussion ---------- CS fixes | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 6830d9f fixed typo 5176f97 fixed CS
2 parents 77289b9 + 6830d9f commit 2b317c1

File tree

57 files changed

+148
-181
lines changed

Some content is hidden

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

57 files changed

+148
-181
lines changed

.php_cs.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ return PhpCsFixer\Config::create()
1212
->setRiskyAllowed(true)
1313
->setFinder(
1414
PhpCsFixer\Finder::create()
15-
->in(__DIR__)
15+
->in(__DIR__.'/src')
1616
->exclude(array(
1717
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
1818
'src/Symfony/Component/DependencyInjection/Tests/Fixtures',

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ public static function register($mode = false)
109109
return "\x1B[{$color}m{$str}\x1B[0m";
110110
};
111111
} else {
112-
$colorize = function ($str) {return $str;};
112+
$colorize = function ($str) { return $str; };
113113
}
114114
register_shutdown_function(function () use ($getMode, &$deprecations, $deprecationHandler, $colorize) {
115115
$mode = $getMode();
116116
$currErrorHandler = set_error_handler('var_dump');
117117
restore_error_handler();
118118

119119
if ('weak' === $mode) {
120-
$colorize = function ($str) {return $str;};
120+
$colorize = function ($str) { return $str; };
121121
}
122122
if ($currErrorHandler !== $deprecationHandler) {
123123
echo "\n", $colorize('THE ERROR HANDLER HAS CHANGED!', true), "\n";

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class FooTestCase
3131
public function testLegacyFoo()
3232
{
3333
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
34-
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
35-
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
34+
@trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
35+
@trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
3636
}
3737

3838
public function testNonLegacyBar()
3939
{
4040
@trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
41-
trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
41+
@trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
4242
}
4343
}
4444

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FooTestCase
2323
public function testLegacyFoo()
2424
{
2525
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
26-
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
26+
@trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
2727
}
2828
}
2929

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,29 +125,20 @@ public function __unset($name)
125125
unset($this->valueHolder5157dd96e88c0->$name);
126126
}
127127

128-
/**
129-
*
130-
*/
131128
public function __clone()
132129
{
133130
$this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__clone', array());
134131

135132
$this->valueHolder5157dd96e88c0 = clone $this->valueHolder5157dd96e88c0;
136133
}
137134

138-
/**
139-
*
140-
*/
141135
public function __sleep()
142136
{
143137
$this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__sleep', array());
144138

145139
return array('valueHolder5157dd96e88c0');
146140
}
147141

148-
/**
149-
*
150-
*/
151142
public function __wakeup()
152143
{
153144
}

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_with_hints.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,29 +120,20 @@ public function __unset($name)
120120
unset($this->valueHolder5157dd96e88c0->$name);
121121
}
122122

123-
/**
124-
*
125-
*/
126123
public function __clone()
127124
{
128125
$this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__clone', array());
129126

130127
$this->valueHolder5157dd96e88c0 = clone $this->valueHolder5157dd96e88c0;
131128
}
132129

133-
/**
134-
*
135-
*/
136130
public function __sleep()
137131
{
138132
$this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, '__sleep', array());
139133

140134
return array('valueHolder5157dd96e88c0');
141135
}
142136

143-
/**
144-
*
145-
*/
146137
public function __wakeup()
147138
{
148139
}
@@ -166,15 +157,15 @@ public function getProxyInitializer()
166157
/**
167158
* {@inheritdoc}
168159
*/
169-
public function initializeProxy() : bool
160+
public function initializeProxy(): bool
170161
{
171162
return $this->initializer5157dd96e8924 && $this->initializer5157dd96e8924->__invoke($this->valueHolder5157dd96e88c0, $this, 'initializeProxy', array());
172163
}
173164

174165
/**
175166
* {@inheritdoc}
176167
*/
177-
public function isProxyInitialized() : bool
168+
public function isProxyInitialized(): bool
178169
{
179170
return null !== $this->valueHolder5157dd96e88c0;
180171
}

src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testDumpTag($template, $debug, $expectedOutput, $expectedDumped)
3232

3333
$dumped = null;
3434
$exception = null;
35-
$prevDumper = VarDumper::setHandler(function ($var) use (&$dumped) {$dumped = $var;});
35+
$prevDumper = VarDumper::setHandler(function ($var) use (&$dumped) { $dumped = $var; });
3636

3737
try {
3838
$this->assertEquals($expectedOutput, $twig->render('template'));

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ public function getTransTests()
8787

8888
// transchoice
8989
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
90-
'There is no apples', array('count' => 0)),
90+
'There is no apples', array('count' => 0), ),
9191
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
92-
'There is 5 apples', array('count' => 5)),
92+
'There is 5 apples', array('count' => 5), ),
9393
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
94-
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
94+
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'), ),
9595
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
96-
'There is 5 apples (Symfony)', array('count' => 5)),
96+
'There is 5 apples (Symfony)', array('count' => 5), ),
9797
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
98-
'There is no apples', array('count' => 0)),
98+
'There is no apples', array('count' => 0), ),
9999
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
100-
'There is 5 apples'),
100+
'There is 5 apples', ),
101101

102102
// trans filter
103103
array('{{ "Hello"|trans }}', 'Hello'),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $view['form']->block($form, 'widget_attributes') ?>
1+
<?php echo $view['form']->block($form, 'widget_attributes');
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php if (!$label) { $label = isset($label_format)
1+
<?php if (!$label) {
2+
$label = isset($label_format)
23
? strtr($label_format, array('%name%' => $name, '%id%' => $id))
3-
: $view['form']->humanize($name); } ?>
4+
: $view['form']->humanize($name);
5+
} ?>
46
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></button>

0 commit comments

Comments
 (0)