Skip to content

Commit 3880541

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 043bf86 + d061a45 commit 3880541

File tree

15 files changed

+27
-27
lines changed

15 files changed

+27
-27
lines changed

Definition/ArrayNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ protected function finalizeValue($value)
235235
}
236236

237237
if ($child->isDeprecated()) {
238-
@trigger_error($child->getDeprecationMessage($name, $this->getPath()), E_USER_DEPRECATED);
238+
@trigger_error($child->getDeprecationMessage($name, $this->getPath()), \E_USER_DEPRECATED);
239239
}
240240

241241
try {
@@ -305,7 +305,7 @@ protected function normalizeValue($value)
305305
$guesses = [];
306306

307307
foreach (array_keys($value) as $subject) {
308-
$minScore = INF;
308+
$minScore = \INF;
309309
foreach ($proposals as $proposal) {
310310
$distance = levenshtein($subject, $proposal);
311311
if ($distance <= $minScore && $distance < 3) {

Definition/Builder/NodeDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public function setPathSeparator(string $separator)
362362
$child->setPathSeparator($separator);
363363
}
364364
} else {
365-
@trigger_error(sprintf('Not implementing the "%s::getChildNodeDefinitions()" method in "%s" is deprecated since Symfony 4.1.', ParentNodeDefinitionInterface::class, static::class), E_USER_DEPRECATED);
365+
@trigger_error(sprintf('Not implementing the "%s::getChildNodeDefinitions()" method in "%s" is deprecated since Symfony 4.1.', ParentNodeDefinitionInterface::class, static::class), \E_USER_DEPRECATED);
366366
}
367367
}
368368

Definition/Builder/TreeBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TreeBuilder implements NodeParentInterface
2727
public function __construct(string $name = null, string $type = 'array', NodeBuilder $builder = null)
2828
{
2929
if (null === $name) {
30-
@trigger_error('A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.', E_USER_DEPRECATED);
30+
@trigger_error('A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.', \E_USER_DEPRECATED);
3131
} else {
3232
$builder = $builder ?: new NodeBuilder();
3333
$this->root = $builder->node($name, $type)->setParent($this);
@@ -48,7 +48,7 @@ public function __construct(string $name = null, string $type = 'array', NodeBui
4848
*/
4949
public function root($name, $type = 'array', NodeBuilder $builder = null)
5050
{
51-
@trigger_error(sprintf('The "%s()" method called for the "%s" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead.', __METHOD__, $name), E_USER_DEPRECATED);
51+
@trigger_error(sprintf('The "%s()" method called for the "%s" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead.', __METHOD__, $name), \E_USER_DEPRECATED);
5252

5353
$builder = $builder ?: new NodeBuilder();
5454

Definition/Dumper/XmlReferenceDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private function writeNode(NodeInterface $node, int $depth = 0, bool $root = fal
188188
$commentDepth = $depth + 4 + \strlen($attrName) + 2;
189189
$commentLines = explode("\n", $comment);
190190
$multiline = (\count($commentLines) > 1);
191-
$comment = implode(PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
191+
$comment = implode(\PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
192192

193193
if ($multiline) {
194194
$this->writeLine('<!--', $depth);
@@ -259,7 +259,7 @@ private function writeLine(string $text, int $indent = 0)
259259
$indent = \strlen($text) + $indent;
260260
$format = '%'.$indent.'s';
261261

262-
$this->reference .= sprintf($format, $text).PHP_EOL;
262+
$this->reference .= sprintf($format, $text).\PHP_EOL;
263263
}
264264

265265
/**

Definition/VariableNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function finalizeValue($value)
8484
// deny environment variables only when using custom validators
8585
// this avoids ever passing an empty value to final validation closures
8686
if (!$this->allowEmptyValue && $this->isHandlingPlaceholder() && $this->finalValidationClosures) {
87-
@trigger_error(sprintf('Setting path "%s" to an environment variable is deprecated since Symfony 4.3. Remove "cannotBeEmpty()", "validate()" or include a prefix/suffix value instead.', $this->getPath()), E_USER_DEPRECATED);
87+
@trigger_error(sprintf('Setting path "%s" to an environment variable is deprecated since Symfony 4.3. Remove "cannotBeEmpty()", "validate()" or include a prefix/suffix value instead.', $this->getPath()), \E_USER_DEPRECATED);
8888
// $e = new InvalidConfigurationException(sprintf('The path "%s" cannot contain an environment variable when empty values are not allowed by definition and are validated.', $this->getPath()));
8989
// if ($hint = $this->getInfo()) {
9090
// $e->addHint($hint);

FileLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private function isAbsolutePath(string $file): bool
8484
&& ':' === $file[1]
8585
&& ('\\' === $file[2] || '/' === $file[2])
8686
)
87-
|| null !== parse_url($file, PHP_URL_SCHEME)
87+
|| null !== parse_url($file, \PHP_URL_SCHEME)
8888
) {
8989
return true;
9090
}

Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getLocator()
7474
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null/*, $exclude = null*/)
7575
{
7676
if (\func_num_args() < 5 && __CLASS__ !== static::class && 0 !== strpos(static::class, 'Symfony\Component\\') && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
77-
@trigger_error(sprintf('The "%s()" method will have a new "$exclude = null" argument in version 5.0, not defining it is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED);
77+
@trigger_error(sprintf('The "%s()" method will have a new "$exclude = null" argument in version 5.0, not defining it is deprecated since Symfony 4.4.', __METHOD__), \E_USER_DEPRECATED);
7878
}
7979
$exclude = \func_num_args() >= 5 ? func_get_arg(4) : null;
8080

Resource/GlobResource.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(string $prefix, string $pattern, bool $recursive, bo
4848
$this->recursive = $recursive;
4949
$this->forExclusion = $forExclusion;
5050
$this->excludedPrefixes = $excludedPrefixes;
51-
$this->globBrace = \defined('GLOB_BRACE') ? GLOB_BRACE : 0;
51+
$this->globBrace = \defined('GLOB_BRACE') ? \GLOB_BRACE : 0;
5252

5353
if (false === $this->prefix) {
5454
throw new \InvalidArgumentException(sprintf('The path "%s" does not exist.', $prefix));
@@ -107,10 +107,10 @@ public function getIterator()
107107

108108
if (0 !== strpos($this->prefix, 'phar://') && false === strpos($this->pattern, '/**/')) {
109109
if ($this->globBrace || false === strpos($this->pattern, '{')) {
110-
$paths = glob($this->prefix.$this->pattern, GLOB_NOSORT | $this->globBrace);
110+
$paths = glob($this->prefix.$this->pattern, \GLOB_NOSORT | $this->globBrace);
111111
} elseif (false === strpos($this->pattern, '\\') || !preg_match('/\\\\[,{}]/', $this->pattern)) {
112112
foreach ($this->expandGlob($this->pattern) as $p) {
113-
$paths[] = glob($this->prefix.$p, GLOB_NOSORT);
113+
$paths[] = glob($this->prefix.$p, \GLOB_NOSORT);
114114
}
115115
$paths = array_merge(...$paths);
116116
}
@@ -203,7 +203,7 @@ private function computeHash(): string
203203

204204
private function expandGlob(string $pattern): array
205205
{
206-
$segments = preg_split('/\{([^{}]*+)\}/', $pattern, -1, PREG_SPLIT_DELIM_CAPTURE);
206+
$segments = preg_split('/\{([^{}]*+)\}/', $pattern, -1, \PREG_SPLIT_DELIM_CAPTURE);
207207
$paths = [$segments[0]];
208208
$patterns = [];
209209

ResourceCheckerConfigCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function write($content, array $metadata = null)
137137
}
138138
}
139139

140-
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
140+
if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) {
141141
@opcache_invalidate($this->file, true);
142142
}
143143
}

Tests/Definition/ArrayNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function testSetDeprecated()
237237

238238
$deprecationTriggered = false;
239239
$deprecationHandler = function ($level, $message, $file, $line) use (&$prevErrorHandler, &$deprecationTriggered) {
240-
if (E_USER_DEPRECATED === $level) {
240+
if (\E_USER_DEPRECATED === $level) {
241241
return $deprecationTriggered = true;
242242
}
243243

0 commit comments

Comments
 (0)