Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c38f963

Browse files
committed
Fix CS
1 parent c201990 commit c38f963

12 files changed

Lines changed: 18 additions & 19 deletions

File tree

extra/intl-extra/src/IntlExtension.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function getFunctions()
157157

158158
public function getCountryName(?string $country, string $locale = null): string
159159
{
160-
if ($country === null) {
160+
if (null === $country) {
161161
return '';
162162
}
163163

@@ -170,7 +170,7 @@ public function getCountryName(?string $country, string $locale = null): string
170170

171171
public function getCurrencyName(?string $currency, string $locale = null): string
172172
{
173-
if ($currency === null) {
173+
if (null === $currency) {
174174
return '';
175175
}
176176

@@ -183,7 +183,7 @@ public function getCurrencyName(?string $currency, string $locale = null): strin
183183

184184
public function getCurrencySymbol(?string $currency, string $locale = null): string
185185
{
186-
if ($currency === null) {
186+
if (null === $currency) {
187187
return '';
188188
}
189189

@@ -196,7 +196,7 @@ public function getCurrencySymbol(?string $currency, string $locale = null): str
196196

197197
public function getLanguageName(?string $language, string $locale = null): string
198198
{
199-
if ($language === null) {
199+
if (null === $language) {
200200
return '';
201201
}
202202

@@ -209,7 +209,7 @@ public function getLanguageName(?string $language, string $locale = null): strin
209209

210210
public function getLocaleName(?string $data, string $locale = null): string
211211
{
212-
if ($data === null) {
212+
if (null === $data) {
213213
return '';
214214
}
215215

@@ -222,7 +222,7 @@ public function getLocaleName(?string $data, string $locale = null): string
222222

223223
public function getTimezoneName(?string $timezone, string $locale = null): string
224224
{
225-
if ($timezone === null) {
225+
if (null === $timezone) {
226226
return '';
227227
}
228228

src/Extension/CoreExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ function twig_spaceless($content)
997997

998998
function twig_convert_encoding($string, $to, $from)
999999
{
1000-
if (!function_exists('iconv')) {
1000+
if (!\function_exists('iconv')) {
10011001
throw new RuntimeError('Unable to convert encoding: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.');
10021002
}
10031003

src/Node/ModuleNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ModuleNode extends Node
3232
{
3333
public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source)
3434
{
35-
if (__CLASS__ !== \get_class($this)) {
35+
if (__CLASS__ !== static::class) {
3636
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
3737
}
3838

src/Node/Node.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(array $nodes = [], array $attributes = [], int $line
4040
{
4141
foreach ($nodes as $name => $node) {
4242
if (!$node instanceof self) {
43-
throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, \get_class($this)));
43+
throw new \InvalidArgumentException(sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, static::class));
4444
}
4545
}
4646
$this->nodes = $nodes;
@@ -142,7 +142,7 @@ public function hasNode($name)
142142
public function getNode($name)
143143
{
144144
if (!isset($this->nodes[$name])) {
145-
throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, \get_class($this)));
145+
throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, static::class));
146146
}
147147

148148
return $this->nodes[$name];

src/Profiler/Profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Profile implements \IteratorAggregate, \Serializable
3232

3333
public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main')
3434
{
35-
if (__CLASS__ !== \get_class($this)) {
35+
if (__CLASS__ !== static::class) {
3636
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
3737
}
3838

src/TwigFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TwigFilter
3939
*/
4040
public function __construct(string $name, $callable = null, array $options = [])
4141
{
42-
if (__CLASS__ !== \get_class($this)) {
42+
if (__CLASS__ !== static::class) {
4343
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
4444
}
4545

src/TwigFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TwigFunction
3939
*/
4040
public function __construct(string $name, $callable = null, array $options = [])
4141
{
42-
if (__CLASS__ !== \get_class($this)) {
42+
if (__CLASS__ !== static::class) {
4343
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
4444
}
4545

src/TwigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TwigTest
3838
*/
3939
public function __construct(string $name, $callable = null, array $options = [])
4040
{
41-
if (__CLASS__ !== \get_class($this)) {
41+
if (__CLASS__ !== static::class) {
4242
@trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED);
4343
}
4444

tests/Cache/FilesystemTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function testGetTimestampMissingFile()
168168
public function testGenerateKey($expected, $input)
169169
{
170170
$cache = new FilesystemCache($input);
171-
$this->assertRegExp($expected, $cache->generateKey('_test_', \get_class($this)));
171+
$this->assertRegExp($expected, $cache->generateKey('_test_', static::class));
172172
}
173173

174174
public function provideDirectories()

tests/ErrorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ public function getErroredTemplates()
206206

207207
public function testTwigLeakOutputInDebugMode()
208208
{
209-
$output = exec(sprintf('%s %s debug', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
209+
$output = exec(sprintf('%s %s debug', PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
210210

211211
$this->assertSame('Hello OOPS', $output);
212212
}
213213

214214
public function testDoesNotTwigLeakOutput()
215215
{
216-
$output = exec(sprintf('%s %s', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
216+
$output = exec(sprintf('%s %s', PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
217217

218218
$this->assertSame('', $output);
219219
}

0 commit comments

Comments
 (0)