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

Skip to content

Commit 9526988

Browse files
committed
fixed CS
1 parent 84bc7ab commit 9526988

File tree

51 files changed

+84
-84
lines changed

Some content is hidden

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

51 files changed

+84
-84
lines changed

src/Symfony/Bridge/PhpUnit/ClassExistsMock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ public static function withMockedClasses(array $classes)
3030

3131
public static function class_exists($name, $autoload = true)
3232
{
33-
return (bool) (self::$classes[ltrim($name, '\\')] ?? \class_exists($name, $autoload));
33+
return (bool) (self::$classes[ltrim($name, '\\')] ?? class_exists($name, $autoload));
3434
}
3535

3636
public static function interface_exists($name, $autoload = true)
3737
{
38-
return (bool) (self::$classes[ltrim($name, '\\')] ?? \interface_exists($name, $autoload));
38+
return (bool) (self::$classes[ltrim($name, '\\')] ?? interface_exists($name, $autoload));
3939
}
4040

4141
public static function trait_exists($name, $autoload = true)
4242
{
43-
return (bool) (self::$classes[ltrim($name, '\\')] ?? \trait_exists($name, $autoload));
43+
return (bool) (self::$classes[ltrim($name, '\\')] ?? trait_exists($name, $autoload));
4444
}
4545

4646
public static function register($class)

src/Symfony/Bridge/Twig/Extension/HttpFoundationExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct($urlHelper)
4646

4747
$requestContext = null;
4848
if (2 === \func_num_args()) {
49-
$requestContext = \func_get_arg(1);
49+
$requestContext = func_get_arg(1);
5050
if (null !== $requestContext && !$requestContext instanceof RequestContext) {
5151
throw new \TypeError(sprintf('The second argument must be an instance of "%s".', RequestContext::class));
5252
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,12 +1115,12 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11151115
$defaultDir = $container->getParameterBag()->resolveValue($config['default_path']);
11161116
$rootDir = $container->getParameter('kernel.root_dir');
11171117
foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
1118-
if (\is_dir($dir = $bundle['path'].'/Resources/translations')) {
1118+
if (is_dir($dir = $bundle['path'].'/Resources/translations')) {
11191119
$dirs[] = $dir;
11201120
} else {
11211121
$nonExistingDirs[] = $dir;
11221122
}
1123-
if (\is_dir($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
1123+
if (is_dir($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
11241124
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.', $dir, $defaultDir), E_USER_DEPRECATED);
11251125
$dirs[] = $dir;
11261126
} else {
@@ -1129,7 +1129,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11291129
}
11301130

11311131
foreach ($config['paths'] as $dir) {
1132-
if (\is_dir($dir)) {
1132+
if (is_dir($dir)) {
11331133
$dirs[] = $transPaths[] = $dir;
11341134
} else {
11351135
throw new \UnexpectedValueException(sprintf('%s defined in translator.paths does not exist or is not a directory', $dir));
@@ -1144,13 +1144,13 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11441144
$container->getDefinition('console.command.translation_update')->replaceArgument(6, $transPaths);
11451145
}
11461146

1147-
if (\is_dir($defaultDir)) {
1147+
if (is_dir($defaultDir)) {
11481148
$dirs[] = $defaultDir;
11491149
} else {
11501150
$nonExistingDirs[] = $defaultDir;
11511151
}
11521152

1153-
if (\is_dir($dir = $rootDir.'/Resources/translations')) {
1153+
if (is_dir($dir = $rootDir.'/Resources/translations')) {
11541154
if ($dir !== $defaultDir) {
11551155
@trigger_error(sprintf('Translations directory "%s" is deprecated since Symfony 4.2, use "%s" instead.', $dir, $defaultDir), E_USER_DEPRECATED);
11561156
}
@@ -1186,7 +1186,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
11861186
$translator->getArgument(4),
11871187
[
11881188
'resource_files' => $files,
1189-
'scanned_directories' => \array_merge($dirs, $nonExistingDirs),
1189+
'scanned_directories' => array_merge($dirs, $nonExistingDirs),
11901190
]
11911191
);
11921192

src/Symfony/Bundle/FrameworkBundle/Test/WebTestAssertionsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private static function getClient(KernelBrowser $newClient = null): ?KernelBrows
195195
}
196196

197197
if (!$client instanceof KernelBrowser) {
198-
static::fail(\sprintf('A client must be set to make assertions on it. Did you forget to call "%s::createClient()"?', __CLASS__));
198+
static::fail(sprintf('A client must be set to make assertions on it. Did you forget to call "%s::createClient()"?', __CLASS__));
199199
}
200200

201201
return $client;

src/Symfony/Component/Cache/Adapter/AbstractTagAwareAdapter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static function ($key, $value, $isHit) use ($defaultLifetime) {
6060
$item->metadata[CacheItem::METADATA_TAGS] = $value['tags'] ?? [];
6161
if (isset($value['meta'])) {
6262
// For compactness these values are packed, & expiry is offset to reduce size
63-
$v = \unpack('Ve/Nc', $value['meta']);
63+
$v = unpack('Ve/Nc', $value['meta']);
6464
$item->metadata[CacheItem::METADATA_EXPIRY] = $v['e'] + CacheItem::METADATA_EXPIRY_OFFSET;
6565
$item->metadata[CacheItem::METADATA_CTIME] = $v['c'];
6666
}
@@ -96,16 +96,16 @@ static function ($deferred, &$expiredIds) use ($getId, $tagPrefix) {
9696

9797
if ($metadata) {
9898
// For compactness, expiry and creation duration are packed, using magic numbers as separators
99-
$value['meta'] = \pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - CacheItem::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME]);
99+
$value['meta'] = pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - CacheItem::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME]);
100100
}
101101

102102
// Extract tag changes, these should be removed from values in doSave()
103103
$value['tag-operations'] = ['add' => [], 'remove' => []];
104104
$oldTags = $item->metadata[CacheItem::METADATA_TAGS] ?? [];
105-
foreach (\array_diff($value['tags'], $oldTags) as $addedTag) {
105+
foreach (array_diff($value['tags'], $oldTags) as $addedTag) {
106106
$value['tag-operations']['add'][] = $getId($tagPrefix.$addedTag);
107107
}
108-
foreach (\array_diff($oldTags, $value['tags']) as $removedTag) {
108+
foreach (array_diff($oldTags, $value['tags']) as $removedTag) {
109109
$value['tag-operations']['remove'][] = $getId($tagPrefix.$removedTag);
110110
}
111111

@@ -236,7 +236,7 @@ public function deleteItems(array $keys)
236236
}
237237

238238
try {
239-
if ($this->doDelete(\array_values($ids), $tagData)) {
239+
if ($this->doDelete(array_values($ids), $tagData)) {
240240
return true;
241241
}
242242
} catch (\Exception $e) {
@@ -271,7 +271,7 @@ public function invalidateTags(array $tags)
271271
}
272272

273273
$tagIds = [];
274-
foreach (\array_unique($tags) as $tag) {
274+
foreach (array_unique($tags) as $tag) {
275275
$tagIds[] = $this->getId(self::TAGS_PREFIX.$tag);
276276
}
277277

src/Symfony/Component/Cache/Adapter/FilesystemTagAwareAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected function doInvalidate(array $tagIds): bool
126126
}
127127

128128
$valueFile = $itemLink->getRealPath();
129-
if ($valueFile && \file_exists($valueFile)) {
129+
if ($valueFile && file_exists($valueFile)) {
130130
@unlink($valueFile);
131131
}
132132

src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function __construct($redisClient, string $namespace = '', int $defaultLi
8282
$this->init($redisClient, $namespace, $defaultLifetime, $marshaller);
8383

8484
// Make sure php-redis is 3.1.3 or higher configured for Redis classes
85-
if (!$this->redis instanceof Predis\Client && \version_compare(\phpversion('redis'), '3.1.3', '<')) {
85+
if (!$this->redis instanceof Predis\Client && version_compare(phpversion('redis'), '3.1.3', '<')) {
8686
throw new LogicException('RedisTagAwareAdapter requires php-redis 3.1.3 or higher, alternatively use predis/predis');
8787
}
8888
}
@@ -120,7 +120,7 @@ protected function doSave(array $values, ?int $lifetime, array $addTagData = [],
120120

121121
foreach ($results as $id => $result) {
122122
// Skip results of SADD/SREM operations, they'll be 1 or 0 depending on if set value already existed or not
123-
if (\is_numeric($result)) {
123+
if (is_numeric($result)) {
124124
continue;
125125
}
126126
// setEx results
@@ -152,7 +152,7 @@ protected function doDelete(array $ids, array $tagData = []): bool
152152
}
153153

154154
foreach ($tagData as $tagId => $idList) {
155-
yield 'sRem' => \array_merge([$tagId], $idList);
155+
yield 'sRem' => array_merge([$tagId], $idList);
156156
}
157157
})->rewind();
158158

@@ -178,10 +178,10 @@ protected function doInvalidate(array $tagIds): bool
178178
});
179179

180180
// Flatten generator result from pipeline, ignore keys (tag ids)
181-
$ids = \array_unique(\array_merge(...\iterator_to_array($tagIdSets, false)));
181+
$ids = array_unique(array_merge(...iterator_to_array($tagIdSets, false)));
182182

183183
// Delete cache in chunks to avoid overloading the connection
184-
foreach (\array_chunk($ids, self::BULK_DELETE_LIMIT) as $chunkIds) {
184+
foreach (array_chunk($ids, self::BULK_DELETE_LIMIT) as $chunkIds) {
185185
$this->doDelete($chunkIds);
186186
}
187187

src/Symfony/Component/Console/Helper/ProgressBar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function setRedrawFrequency(int $freq)
250250
*/
251251
public function iterate(iterable $iterable, ?int $max = null): iterable
252252
{
253-
$this->start($max ?? (\is_countable($iterable) ? \count($iterable) : 0));
253+
$this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0));
254254

255255
foreach ($iterable as $key => $value) {
256256
yield $key => $value;

src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ public function testIterate(): void
884884
{
885885
$bar = new ProgressBar($output = $this->getOutputStream());
886886

887-
$this->assertEquals([1, 2], \iterator_to_array($bar->iterate([1, 2])));
887+
$this->assertEquals([1, 2], iterator_to_array($bar->iterate([1, 2])));
888888

889889
rewind($output->getStream());
890890
$this->assertEquals(
@@ -900,7 +900,7 @@ public function testIterateUncountable(): void
900900
{
901901
$bar = new ProgressBar($output = $this->getOutputStream());
902902

903-
$this->assertEquals([1, 2], \iterator_to_array($bar->iterate((function () {
903+
$this->assertEquals([1, 2], iterator_to_array($bar->iterate((function () {
904904
yield 1;
905905
yield 2;
906906
})())));

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public function checkAnnotations(\ReflectionClass $refl, $class)
238238
}
239239
}
240240

241-
if ($refl->isInterface() && false !== \strpos($doc, 'method') && preg_match_all('#\n \* @method\s+(static\s+)?+(?:[\w\|&\[\]\\\]+\s+)?(\w+(?:\s*\([^\)]*\))?)+(.+?([[:punct:]]\s*)?)?(?=\r?\n \*(?: @|/$|\r?\n))#', $doc, $notice, PREG_SET_ORDER)) {
241+
if ($refl->isInterface() && false !== strpos($doc, 'method') && preg_match_all('#\n \* @method\s+(static\s+)?+(?:[\w\|&\[\]\\\]+\s+)?(\w+(?:\s*\([^\)]*\))?)+(.+?([[:punct:]]\s*)?)?(?=\r?\n \*(?: @|/$|\r?\n))#', $doc, $notice, PREG_SET_ORDER)) {
242242
foreach ($notice as $method) {
243243
$static = '' !== $method[1];
244244
$name = $method[2];

0 commit comments

Comments
 (0)