Skip to content

Commit 814d068

Browse files
CS fixes
1 parent 8d0ae6d commit 814d068

11 files changed

+18
-18
lines changed

Compiler/AnalyzeServiceReferencesPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function processValue($value, $isRoot = false)
120120
$value,
121121
$this->lazy || ($targetDefinition && $targetDefinition->isLazy()),
122122
true
123-
);
123+
);
124124
}
125125

126126
return $value;

Compiler/CheckDefinitionValidityPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function process(ContainerBuilder $container)
6363
foreach ($definition->getTags() as $name => $tags) {
6464
foreach ($tags as $attributes) {
6565
foreach ($attributes as $attribute => $value) {
66-
if (!is_scalar($value) && null !== $value) {
66+
if (!\is_scalar($value) && null !== $value) {
6767
throw new RuntimeException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $id, $name, $attribute));
6868
}
6969
}

Dumper/PhpDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,13 @@ private function isTrivialInstance(Definition $definition): bool
688688
if ($v instanceof Reference && $this->container->has($id = (string) $v) && $this->container->findDefinition($id)->isSynthetic()) {
689689
continue;
690690
}
691-
if (!is_scalar($v) || $this->dumpValue($v) !== $this->dumpValue($v, false)) {
691+
if (!\is_scalar($v) || $this->dumpValue($v) !== $this->dumpValue($v, false)) {
692692
return false;
693693
}
694694
}
695695
} elseif ($arg instanceof Reference && $this->container->has($id = (string) $arg) && $this->container->findDefinition($id)->isSynthetic()) {
696696
continue;
697-
} elseif (!is_scalar($arg) || $this->dumpValue($arg) !== $this->dumpValue($arg, false)) {
697+
} elseif (!\is_scalar($arg) || $this->dumpValue($arg) !== $this->dumpValue($arg, false)) {
698698
return false;
699699
}
700700
}

EnvVarProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
111111
}
112112

113113
if ('file' === $prefix || 'require' === $prefix) {
114-
if (!is_scalar($file = $getEnv($name))) {
114+
if (!\is_scalar($file = $getEnv($name))) {
115115
throw new RuntimeException(sprintf('Invalid file name: env var "%s" is non-scalar.', $name));
116116
}
117117
if (!file_exists($file)) {
@@ -183,7 +183,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
183183
return null;
184184
}
185185

186-
if (!is_scalar($env)) {
186+
if (!\is_scalar($env)) {
187187
throw new RuntimeException(sprintf('Non-scalar env var "%s" cannot be cast to "%s".', $name, $prefix));
188188
}
189189

@@ -280,7 +280,7 @@ public function getEnv($prefix, $name, \Closure $getEnv)
280280
$value = $this->container->getParameter($match[1]);
281281
}
282282

283-
if (!is_scalar($value)) {
283+
if (!\is_scalar($value)) {
284284
throw new RuntimeException(sprintf('Parameter "%s" found when resolving env var "%s" must be scalar, "%s" given.', $match[1], $name, \gettype($value)));
285285
}
286286

Loader/Configurator/AbstractConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function processValue($value, $allowServices = false)
8282

8383
switch (true) {
8484
case null === $value:
85-
case is_scalar($value):
85+
case \is_scalar($value):
8686
return $value;
8787

8888
case $value instanceof ArgumentInterface:

Loader/Configurator/DefaultsConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final public function tag(string $name, array $attributes = []): self
4949
}
5050

5151
foreach ($attributes as $attribute => $value) {
52-
if (null !== $value && !is_scalar($value)) {
52+
if (null !== $value && !\is_scalar($value)) {
5353
throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
5454
}
5555
}

Loader/Configurator/Traits/TagTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final public function tag(string $name, array $attributes = []): self
2727
}
2828

2929
foreach ($attributes as $attribute => $value) {
30-
if (!is_scalar($value) && null !== $value) {
30+
if (!\is_scalar($value) && null !== $value) {
3131
throw new InvalidArgumentException(sprintf('A tag attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $this->id, $name, $attribute));
3232
}
3333
}

Loader/YamlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private function parseDefaults(array &$content, string $file): array
277277
}
278278

279279
foreach ($tag as $attribute => $value) {
280-
if (!is_scalar($value) && null !== $value) {
280+
if (!\is_scalar($value) && null !== $value) {
281281
throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type in "%s". Check your YAML syntax.', $name, $attribute, $file));
282282
}
283283
}
@@ -534,7 +534,7 @@ private function parseDefinition(string $id, $service, string $file, array $defa
534534
}
535535

536536
foreach ($tag as $attribute => $value) {
537-
if (!is_scalar($value) && null !== $value) {
537+
if (!\is_scalar($value) && null !== $value) {
538538
throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in "%s". Check your YAML syntax.', $id, $name, $attribute, $file));
539539
}
540540
}

ParameterBag/EnvPlaceholderParameterBag.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public function get($name)
5151
if ($this->has($name)) {
5252
$defaultValue = parent::get($name);
5353

54-
if (null !== $defaultValue && !is_scalar($defaultValue)) { // !is_string in 5.0
54+
if (null !== $defaultValue && !\is_scalar($defaultValue)) { // !is_string in 5.0
5555
//throw new RuntimeException(sprintf('The default value of an env() parameter must be a string or null, but "%s" given to "%s".', \gettype($defaultValue), $name));
5656
throw new RuntimeException(sprintf('The default value of an env() parameter must be scalar or null, but "%s" given to "%s".', \gettype($defaultValue), $name));
57-
} elseif (is_scalar($defaultValue) && !\is_string($defaultValue)) {
57+
} elseif (\is_scalar($defaultValue) && !\is_string($defaultValue)) {
5858
@trigger_error(sprintf('A non-string default value of an env() parameter is deprecated since 4.3, cast "%s" to string instead.', $name), \E_USER_DEPRECATED);
5959
}
6060
}
@@ -162,10 +162,10 @@ public function resolve()
162162
@trigger_error(sprintf('A non-string default value of env parameter "%s" is deprecated since 4.3, cast it to string instead.', $env), \E_USER_DEPRECATED);
163163
}
164164
$this->parameters[$name] = (string) $default;
165-
} elseif (null !== $default && !is_scalar($default)) { // !is_string in 5.0
165+
} elseif (null !== $default && !\is_scalar($default)) { // !is_string in 5.0
166166
//throw new RuntimeException(sprintf('The default value of env parameter "%s" must be a string or null, "%s" given.', $env, \gettype($default)));
167167
throw new RuntimeException(sprintf('The default value of env parameter "%s" must be scalar or null, "%s" given.', $env, \gettype($default)));
168-
} elseif (is_scalar($default) && !\is_string($default)) {
168+
} elseif (\is_scalar($default) && !\is_string($default)) {
169169
@trigger_error(sprintf('A non-string default value of env parameter "%s" is deprecated since 4.3, cast it to string instead.', $env), \E_USER_DEPRECATED);
170170
}
171171
}

Tests/Compiler/RemoveUnusedDefinitionsPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testProcessDoesNotErrorOnServicesThatDoNotHaveDefinitions()
135135
->addArgument(new Reference('not.defined'))
136136
->setPublic(true);
137137

138-
$container->set('not.defined', new \StdClass());
138+
$container->set('not.defined', new \stdClass());
139139

140140
$this->process($container);
141141

0 commit comments

Comments
 (0)