Skip to content

Commit 106b348

Browse files
committed
fixed CS
1 parent 7a6ce5f commit 106b348

36 files changed

+75
-75
lines changed

.php_cs.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ return PhpCsFixer\Config::create()
1515
'ordered_imports' => true,
1616
'protected_to_private' => false,
1717
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
18-
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
18+
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
1919
// Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading
2020
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
2121
])

src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function createTestConfiguration()
5858
$config = new Configuration();
5959
$config->setEntityNamespaces(['SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures']);
6060
$config->setAutoGenerateProxyClasses(true);
61-
$config->setProxyDir(\sys_get_temp_dir());
61+
$config->setProxyDir(sys_get_temp_dir());
6262
$config->setProxyNamespace('SymfonyTests\Doctrine');
6363
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader()));
6464
$config->setQueryCacheImpl(new ArrayCache());

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private function formatWithIdentifiers(ObjectManager $em, ClassMetadata $class,
186186
return $this->formatValue($value, self::PRETTY_DATE);
187187
}
188188

189-
if (\method_exists($value, '__toString')) {
189+
if (method_exists($value, '__toString')) {
190190
return (string) $value;
191191
}
192192

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function getProxyFactoryCode(Definition $definition, $id, $factoryCode =
5858
$instantiation = 'return';
5959

6060
if ($definition->isShared()) {
61-
$instantiation .= sprintf(' $this->%s[%s] =', \method_exists(ContainerBuilder::class, 'addClassResource') || ($definition->isPublic() && !$definition->isPrivate()) ? 'services' : 'privates', var_export($id, true));
61+
$instantiation .= sprintf(' $this->%s[%s] =', method_exists(ContainerBuilder::class, 'addClassResource') || ($definition->isPublic() && !$definition->isPrivate()) ? 'services' : 'privates', var_export($id, true));
6262
}
6363

6464
if (null === $factoryCode) {
@@ -120,7 +120,7 @@ public function getProxyCode(Definition $definition)
120120
*/
121121
private static function getProxyManagerVersion()
122122
{
123-
if (!\class_exists(Version::class)) {
123+
if (!class_exists(Version::class)) {
124124
return '0.0.1';
125125
}
126126

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getPrivatePublicDefinitions()
103103
[
104104
(new Definition(__CLASS__))
105105
->setPublic(false),
106-
\method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates',
106+
method_exists(ContainerBuilder::class, 'addClassResource') ? 'services' : 'privates',
107107
],
108108
[
109109
(new Definition(__CLASS__))

src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testWithGlobals()
7070

7171
$display = $tester->getDisplay();
7272

73-
$this->assertContains(\json_encode($message), $display);
73+
$this->assertContains(json_encode($message), $display);
7474
}
7575

7676
public function testWithGlobalsJson()
@@ -81,7 +81,7 @@ public function testWithGlobalsJson()
8181
$tester->execute(['--format' => 'json'], ['decorated' => true]);
8282

8383
$display = $tester->getDisplay();
84-
$display = \json_decode($display, true);
84+
$display = json_decode($display, true);
8585

8686
$this->assertSame($globals, $display['globals']);
8787
}
@@ -91,11 +91,11 @@ public function testWithFilter()
9191
$tester = $this->createCommandTester([]);
9292
$tester->execute(['--format' => 'json'], ['decorated' => false]);
9393
$display = $tester->getDisplay();
94-
$display1 = \json_decode($display, true);
94+
$display1 = json_decode($display, true);
9595

9696
$tester->execute(['filter' => 'date', '--format' => 'json'], ['decorated' => false]);
9797
$display = $tester->getDisplay();
98-
$display2 = \json_decode($display, true);
98+
$display2 = json_decode($display, true);
9999

100100
$this->assertNotSame($display1, $display2);
101101
}

src/Symfony/Bridge/Twig/UndefinedCallableHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function onUndefinedFunction($name)
8484

8585
private static function onUndefined($name, $type, $component)
8686
{
87-
if (\class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
87+
if (class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
8888
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::$fullStackEnable[$component], $type, $name));
8989
}
9090

src/Symfony/Component/Cache/Traits/PhpArrayTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function warmUp(array $values)
9090
if ('N;' === $value || (isset($value[2]) && ':' === $value[1])) {
9191
$value = serialize($value);
9292
}
93-
} elseif (!\is_scalar($value)) {
93+
} elseif (!is_scalar($value)) {
9494
throw new InvalidArgumentException(sprintf('Cache key "%s" has non-serializable %s value.', $key, \gettype($value)));
9595
}
9696

src/Symfony/Component/Cache/Traits/PhpFilesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function doSave(array $values, $lifetime)
136136
if ('N;' === $value || (isset($value[2]) && ':' === $value[1])) {
137137
$value = serialize($value);
138138
}
139-
} elseif (!\is_scalar($value)) {
139+
} elseif (!is_scalar($value)) {
140140
throw new InvalidArgumentException(sprintf('Cache key "%s" has non-serializable %s value.', $key, \gettype($value)));
141141
}
142142

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function loadClass($class)
168168

169169
private function checkClass($class, $file = null)
170170
{
171-
$exists = null === $file || \class_exists($class, false) || \interface_exists($class, false) || \trait_exists($class, false);
171+
$exists = null === $file || class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
172172

173173
if (null !== $file && $class && '\\' === $class[0]) {
174174
$class = substr($class, 1);
@@ -186,13 +186,13 @@ private function checkClass($class, $file = null)
186186
}
187187
$name = $refl->getName();
188188

189-
if ($name !== $class && 0 === \strcasecmp($name, $class)) {
189+
if ($name !== $class && 0 === strcasecmp($name, $class)) {
190190
throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: "%s" vs "%s".', $class, $name));
191191
}
192192

193193
$deprecations = $this->checkAnnotations($refl, $name);
194194

195-
if (isset(self::$php7Reserved[\strtolower($refl->getShortName())])) {
195+
if (isset(self::$php7Reserved[strtolower($refl->getShortName())])) {
196196
$deprecations[] = sprintf('The "%s" class uses the reserved name "%s", it will break on PHP 7 and higher', $name, $refl->getShortName());
197197
}
198198

@@ -223,23 +223,23 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
223223
$deprecations = [];
224224

225225
// Don't trigger deprecations for classes in the same vendor
226-
if (2 > $len = 1 + (\strpos($class, '\\') ?: \strpos($class, '_'))) {
226+
if (2 > $len = 1 + (strpos($class, '\\') ?: strpos($class, '_'))) {
227227
$len = 0;
228228
$ns = '';
229229
} else {
230-
$ns = \str_replace('_', '\\', \substr($class, 0, $len));
230+
$ns = str_replace('_', '\\', substr($class, 0, $len));
231231
}
232232

233233
// Detect annotations on the class
234234
if (false !== $doc = $refl->getDocComment()) {
235235
foreach (['final', 'deprecated', 'internal'] as $annotation) {
236-
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
236+
if (false !== strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
237237
self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
238238
}
239239
}
240240
}
241241

242-
$parent = \get_parent_class($class);
242+
$parent = get_parent_class($class);
243243
$parentAndOwnInterfaces = $this->getOwnInterfaces($class, $parent);
244244
if ($parent) {
245245
$parentAndOwnInterfaces[$parent] = $parent;
@@ -254,22 +254,22 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
254254
}
255255

256256
// Detect if the parent is annotated
257-
foreach ($parentAndOwnInterfaces + \class_uses($class, false) as $use) {
257+
foreach ($parentAndOwnInterfaces + class_uses($class, false) as $use) {
258258
if (!isset(self::$checkedClasses[$use])) {
259259
$this->checkClass($use);
260260
}
261-
if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len) && !isset(self::$deprecated[$class])) {
261+
if (isset(self::$deprecated[$use]) && strncmp($ns, str_replace('_', '\\', $use), $len) && !isset(self::$deprecated[$class])) {
262262
$type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait');
263263
$verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
264264

265265
$deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s.', $class, $type, $verb, $use, self::$deprecated[$use]);
266266
}
267-
if (isset(self::$internal[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) {
267+
if (isset(self::$internal[$use]) && strncmp($ns, str_replace('_', '\\', $use), $len)) {
268268
$deprecations[] = sprintf('The "%s" %s is considered internal%s. It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $class);
269269
}
270270
}
271271

272-
if (\trait_exists($class)) {
272+
if (trait_exists($class)) {
273273
return $deprecations;
274274
}
275275

@@ -296,7 +296,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
296296

297297
if (isset(self::$internalMethods[$class][$method->name])) {
298298
list($declaringClass, $message) = self::$internalMethods[$class][$method->name];
299-
if (\strncmp($ns, $declaringClass, $len)) {
299+
if (strncmp($ns, $declaringClass, $len)) {
300300
$deprecations[] = sprintf('The "%s::%s()" method is considered internal%s. It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $class);
301301
}
302302
}
@@ -307,7 +307,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
307307
}
308308

309309
foreach (['final', 'internal'] as $annotation) {
310-
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
310+
if (false !== strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$|\r?\n)#s', $doc, $notice)) {
311311
$message = isset($notice[1]) ? preg_replace('#\.?\r?\n( \*)? *(?= |\r?\n|$)#', '', $notice[1]) : '';
312312
self::${$annotation.'Methods'}[$class][$method->name] = [$class, $message];
313313
}

0 commit comments

Comments
 (0)