Skip to content

Commit 4a570b7

Browse files
committed
adding leading backslash to all native constants
PHP-CS-Fixer/PHP-CS-Fixer#5426
1 parent 33eb419 commit 4a570b7

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/Definition/ArrayDefinition.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function replaceNestedDefinitions(callable $replacer)
5050

5151
public function __toString()
5252
{
53-
$str = '[' . PHP_EOL;
53+
$str = '[' . \PHP_EOL;
5454

5555
foreach ($this->values as $key => $value) {
5656
if (is_string($key)) {
@@ -60,12 +60,12 @@ public function __toString()
6060
$str .= ' ' . $key . ' => ';
6161

6262
if ($value instanceof Definition) {
63-
$str .= str_replace(PHP_EOL, PHP_EOL . ' ', (string) $value);
63+
$str .= str_replace(\PHP_EOL, \PHP_EOL . ' ', (string) $value);
6464
} else {
6565
$str .= var_export($value, true);
6666
}
6767

68-
$str .= ',' . PHP_EOL;
68+
$str .= ',' . \PHP_EOL;
6969
}
7070

7171
return $str . ']';

src/Definition/Dumper/ObjectDefinitionDumper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function dump(ObjectDefinition $definition) : string
3535
$str = sprintf(' class = %s%s', $warning, $className);
3636

3737
// Lazy
38-
$str .= PHP_EOL . ' lazy = ' . var_export($definition->isLazy(), true);
38+
$str .= \PHP_EOL . ' lazy = ' . var_export($definition->isLazy(), true);
3939

4040
if ($classExist) {
4141
// Constructor
@@ -48,7 +48,7 @@ public function dump(ObjectDefinition $definition) : string
4848
$str .= $this->dumpMethods($className, $definition);
4949
}
5050

51-
return sprintf('Object (' . PHP_EOL . '%s' . PHP_EOL . ')', $str);
51+
return sprintf('Object (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str);
5252
}
5353

5454
private function dumpConstructor(string $className, ObjectDefinition $definition) : string
@@ -60,7 +60,7 @@ private function dumpConstructor(string $className, ObjectDefinition $definition
6060
if ($constructorInjection !== null) {
6161
$parameters = $this->dumpMethodParameters($className, $constructorInjection);
6262

63-
$str .= sprintf(PHP_EOL . ' __construct(' . PHP_EOL . ' %s' . PHP_EOL . ' )', $parameters);
63+
$str .= sprintf(\PHP_EOL . ' __construct(' . \PHP_EOL . ' %s' . \PHP_EOL . ' )', $parameters);
6464
}
6565

6666
return $str;
@@ -74,7 +74,7 @@ private function dumpProperties(ObjectDefinition $definition) : string
7474
$value = $propertyInjection->getValue();
7575
$valueStr = $value instanceof Definition ? (string) $value : var_export($value, true);
7676

77-
$str .= sprintf(PHP_EOL . ' $%s = %s', $propertyInjection->getPropertyName(), $valueStr);
77+
$str .= sprintf(\PHP_EOL . ' $%s = %s', $propertyInjection->getPropertyName(), $valueStr);
7878
}
7979

8080
return $str;
@@ -87,7 +87,7 @@ private function dumpMethods(string $className, ObjectDefinition $definition) :
8787
foreach ($definition->getMethodInjections() as $methodInjection) {
8888
$parameters = $this->dumpMethodParameters($className, $methodInjection);
8989

90-
$str .= sprintf(PHP_EOL . ' %s(' . PHP_EOL . ' %s' . PHP_EOL . ' )', $methodInjection->getMethodName(), $parameters);
90+
$str .= sprintf(\PHP_EOL . ' %s(' . \PHP_EOL . ' %s' . \PHP_EOL . ' )', $methodInjection->getMethodName(), $parameters);
9191
}
9292

9393
return $str;
@@ -130,6 +130,6 @@ private function dumpMethodParameters(string $className, MethodInjection $method
130130
$args[] = sprintf('$%s = #UNDEFINED#', $parameter->getName());
131131
}
132132

133-
return implode(PHP_EOL . ' ', $args);
133+
return implode(\PHP_EOL . ' ', $args);
134134
}
135135
}

src/Definition/EnvironmentVariableDefinition.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ public function replaceNestedDefinitions(callable $replacer)
9393

9494
public function __toString()
9595
{
96-
$str = ' variable = ' . $this->variableName . PHP_EOL
96+
$str = ' variable = ' . $this->variableName . \PHP_EOL
9797
. ' optional = ' . ($this->isOptional ? 'yes' : 'no');
9898

9999
if ($this->isOptional) {
100100
if ($this->defaultValue instanceof Definition) {
101101
$nestedDefinition = (string) $this->defaultValue;
102-
$defaultValueStr = str_replace(PHP_EOL, PHP_EOL . ' ', $nestedDefinition);
102+
$defaultValueStr = str_replace(\PHP_EOL, \PHP_EOL . ' ', $nestedDefinition);
103103
} else {
104104
$defaultValueStr = var_export($this->defaultValue, true);
105105
}
106106

107-
$str .= PHP_EOL . ' default = ' . $defaultValueStr;
107+
$str .= \PHP_EOL . ' default = ' . $defaultValueStr;
108108
}
109109

110-
return sprintf('Environment variable (' . PHP_EOL . '%s' . PHP_EOL . ')', $str);
110+
return sprintf('Environment variable (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str);
111111
}
112112
}

src/Definition/Exception/InvalidDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class InvalidDefinition extends \Exception
1616
public static function create(Definition $definition, string $message, \Exception $previous = null) : self
1717
{
1818
return new self(sprintf(
19-
'%s' . PHP_EOL . 'Full definition:' . PHP_EOL . '%s',
19+
'%s' . \PHP_EOL . 'Full definition:' . \PHP_EOL . '%s',
2020
$message,
2121
(string) $definition
2222
), 0, $previous);

0 commit comments

Comments
 (0)