Skip to content

Commit 01a9058

Browse files
committed
minor #791 [CI] fix php-cs-fixer squawks in CI (jrushlow)
This PR was merged into the 1.0-dev branch. Discussion ---------- [CI] fix php-cs-fixer squawks in CI PHP-CS-Fixer/PHP-CS-Fixer#5426 updated the Symfony ruleset which broke CI. Changes included in this PR are as a result of `php-cs-fixer fix` Commits ------- f236580 php-cs-fixer it up
2 parents 6f4d27a + f236580 commit 01a9058

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

src/Console/MigrationDiffFilteredOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private function filterMessages($messages, bool $newLine)
110110
$this->buffer .= $message;
111111

112112
if ($newLine) {
113-
$this->buffer .= PHP_EOL;
113+
$this->buffer .= \PHP_EOL;
114114
}
115115

116116
if ($this->previousLineWasRemoved && !trim($message)) {

src/FileManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function setIO(SymfonyStyle $io)
5757
public function parseTemplate(string $templatePath, array $parameters): string
5858
{
5959
ob_start();
60-
extract($parameters, EXTR_SKIP);
60+
extract($parameters, \EXTR_SKIP);
6161
include $templatePath;
6262

6363
return ob_get_clean();

src/Maker/MakeEntity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ public function __construct(FileManager $fileManager, DoctrineHelper $doctrineHe
5656
// $projectDirectory is unused, argument kept for BC
5757

5858
if (null === $generator) {
59-
@trigger_error(sprintf('Passing a "%s" instance as 4th argument is mandatory since version 1.5.', Generator::class), E_USER_DEPRECATED);
59+
@trigger_error(sprintf('Passing a "%s" instance as 4th argument is mandatory since version 1.5.', Generator::class), \E_USER_DEPRECATED);
6060
$this->generator = new Generator($fileManager, 'App\\');
6161
} else {
6262
$this->generator = $generator;
6363
}
6464

6565
if (null === $entityClassGenerator) {
66-
@trigger_error(sprintf('Passing a "%s" instance as 5th argument is mandatory since version 1.15.1', EntityClassGenerator::class), E_USER_DEPRECATED);
66+
@trigger_error(sprintf('Passing a "%s" instance as 5th argument is mandatory since version 1.15.1', EntityClassGenerator::class), \E_USER_DEPRECATED);
6767
$this->entityClassGenerator = new EntityClassGenerator($generator, $this->doctrineHelper);
6868
} else {
6969
$this->entityClassGenerator = $entityClassGenerator;

src/Maker/MakeUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
130130
$input->getOption('with-password')
131131
);
132132
if ($input->getOption('use-argon2')) {
133-
@trigger_error('The "--use-argon2" option is deprecated since MakerBundle 1.12.', E_USER_DEPRECATED);
133+
@trigger_error('The "--use-argon2" option is deprecated since MakerBundle 1.12.', \E_USER_DEPRECATED);
134134
$userClassConfiguration->useArgon2(true);
135135
}
136136

src/Test/MakerTestEnvironment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function getGeneratedFilesFromOutputText()
254254

255255
$matches = [];
256256

257-
preg_match_all('#(created|updated): (]8;;[^]*\\\)?(.*?)(]8;;\\\)?\n#iu', $output, $matches, PREG_PATTERN_ORDER);
257+
preg_match_all('#(created|updated): (]8;;[^]*\\\)?(.*?)(]8;;\\\)?\n#iu', $output, $matches, \PREG_PATTERN_ORDER);
258258

259259
return array_map('trim', $matches[3]);
260260
}

src/Util/PhpCompatUtil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ protected function getPhpVersion(): string
5050
$composerLockPath = sprintf('%s/composer.lock', $rootDirectory);
5151

5252
if (!$this->fileManager->fileExists($composerLockPath)) {
53-
return PHP_VERSION;
53+
return \PHP_VERSION;
5454
}
5555

5656
$lockFileContents = json_decode($this->fileManager->getFileContents($composerLockPath), true);
5757

5858
if (empty($lockFileContents['platform-overrides']) || empty($lockFileContents['platform-overrides']['php'])) {
59-
return PHP_VERSION;
59+
return \PHP_VERSION;
6060
}
6161

6262
return $lockFileContents['platform-overrides']['php'];

src/Util/YamlSourceManipulator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ private function advanceBeyondValue($value)
570570

571571
private function getEndOfKeyPosition($key)
572572
{
573-
preg_match($this->getKeyRegex($key), $this->contents, $matches, PREG_OFFSET_CAPTURE, $this->currentPosition);
573+
preg_match($this->getKeyRegex($key), $this->contents, $matches, \PREG_OFFSET_CAPTURE, $this->currentPosition);
574574

575575
if (empty($matches)) {
576576
// for integers, the key may not be explicitly printed
@@ -589,7 +589,7 @@ private function getEndOfKeyPosition($key)
589589
*/
590590
private function getEndOfPreviousKeyPosition($key): int
591591
{
592-
preg_match($this->getKeyRegex($key), $this->contents, $matches, PREG_OFFSET_CAPTURE, $this->currentPosition);
592+
preg_match($this->getKeyRegex($key), $this->contents, $matches, \PREG_OFFSET_CAPTURE, $this->currentPosition);
593593

594594
if (empty($matches)) {
595595
// for integers, the key may not be explicitly printed
@@ -863,7 +863,7 @@ private function findEndPositionOfValue($value, $offset = null)
863863
return $offset;
864864
}
865865

866-
preg_match(sprintf('#%s#', $pattern), $this->contents, $matches, PREG_OFFSET_CAPTURE, $offset);
866+
preg_match(sprintf('#%s#', $pattern), $this->contents, $matches, \PREG_OFFSET_CAPTURE, $offset);
867867
if (empty($matches)) {
868868
throw new YamlManipulationFailedException(sprintf('Cannot find the original value "%s"', $value));
869869
}

src/Validator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function validateLength($length)
8484
return $length;
8585
}
8686

87-
$result = filter_var($length, FILTER_VALIDATE_INT, [
87+
$result = filter_var($length, \FILTER_VALIDATE_INT, [
8888
'options' => ['min_range' => 1],
8989
]);
9090

@@ -101,7 +101,7 @@ public static function validatePrecision($precision)
101101
return $precision;
102102
}
103103

104-
$result = filter_var($precision, FILTER_VALIDATE_INT, [
104+
$result = filter_var($precision, \FILTER_VALIDATE_INT, [
105105
'options' => ['min_range' => 1, 'max_range' => 65],
106106
]);
107107

@@ -118,7 +118,7 @@ public static function validateScale($scale)
118118
return $scale;
119119
}
120120

121-
$result = filter_var($scale, FILTER_VALIDATE_INT, [
121+
$result = filter_var($scale, \FILTER_VALIDATE_INT, [
122122
'options' => ['min_range' => 0, 'max_range' => 30],
123123
]);
124124

@@ -139,7 +139,7 @@ public static function validateBoolean($value)
139139
return false;
140140
}
141141

142-
if (null === $valueAsBool = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) {
142+
if (null === $valueAsBool = filter_var($value, \FILTER_VALIDATE_BOOLEAN, \FILTER_NULL_ON_FAILURE)) {
143143
throw new RuntimeCommandException(sprintf('Invalid bool value "%s".', $value));
144144
}
145145

@@ -177,7 +177,7 @@ public static function validateDoctrineFieldName(string $name, $registry)
177177

178178
public static function validateEmailAddress(?string $email): string
179179
{
180-
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
180+
if (!filter_var($email, \FILTER_VALIDATE_EMAIL)) {
181181
throw new RuntimeCommandException(sprintf('"%s" is not a valid email address.', $email));
182182
}
183183

tests/Util/PhpVersionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testFallBackToPhpVersionWithoutLockFile(): void
105105

106106
$result = $util->getVersionForTest();
107107

108-
self::assertSame(PHP_VERSION, $result);
108+
self::assertSame(\PHP_VERSION, $result);
109109
}
110110

111111
public function testWithoutPlatformVersionSet(): void
@@ -137,7 +137,7 @@ public function testWithoutPlatformVersionSet(): void
137137

138138
$result = $util->getVersionForTest();
139139

140-
self::assertSame(PHP_VERSION, $result);
140+
self::assertSame(\PHP_VERSION, $result);
141141
}
142142

143143
/**

0 commit comments

Comments
 (0)