Skip to content

Commit ba6b753

Browse files
CS fixes
1 parent 0d26168 commit ba6b753

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

DeprecationErrorHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ private function displayDeprecations($groups, $configuration)
310310

311311
if ($configuration->shouldWriteToLogFile()) {
312312
if (false === $handle = @fopen($file = $configuration->getLogFile(), 'a')) {
313-
throw new \InvalidArgumentException(sprintf('The configured log file "%s" is not writeable.', $file));
313+
throw new \InvalidArgumentException(\sprintf('The configured log file "%s" is not writeable.', $file));
314314
}
315315
} else {
316316
$handle = fopen('php://output', 'w');
317317
}
318318

319319
foreach ($groups as $group) {
320320
if ($this->deprecationGroups[$group]->count()) {
321-
$deprecationGroupMessage = sprintf(
321+
$deprecationGroupMessage = \sprintf(
322322
'%s deprecation notices (%d)',
323323
\in_array($group, ['direct', 'indirect', 'self'], true) ? "Remaining $group" : ucfirst($group),
324324
$this->deprecationGroups[$group]->count()
@@ -337,7 +337,7 @@ private function displayDeprecations($groups, $configuration)
337337
uasort($notices, $cmp);
338338

339339
foreach ($notices as $msg => $notice) {
340-
fwrite($handle, sprintf("\n %sx: %s\n", $notice->count(), $msg));
340+
fwrite($handle, \sprintf("\n %sx: %s\n", $notice->count(), $msg));
341341

342342
$countsByCaller = $notice->getCountsByCaller();
343343
arsort($countsByCaller);
@@ -349,7 +349,7 @@ private function displayDeprecations($groups, $configuration)
349349
fwrite($handle, " ...\n");
350350
break;
351351
}
352-
fwrite($handle, sprintf(" %dx in %s\n", $count, preg_replace('/(.*)\\\\(.*?::.*?)$/', '$2 from $1', $method)));
352+
fwrite($handle, \sprintf(" %dx in %s\n", $count, preg_replace('/(.*)\\\\(.*?::.*?)$/', '$2 from $1', $method)));
353353
}
354354
}
355355
}

DeprecationErrorHandler/Configuration.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
7676

7777
foreach ($thresholds as $group => $threshold) {
7878
if (!\in_array($group, $groups, true)) {
79-
throw new \InvalidArgumentException(sprintf('Unrecognized threshold "%s", expected one of "%s".', $group, implode('", "', $groups)));
79+
throw new \InvalidArgumentException(\sprintf('Unrecognized threshold "%s", expected one of "%s".', $group, implode('", "', $groups)));
8080
}
8181
if (!is_numeric($threshold)) {
82-
throw new \InvalidArgumentException(sprintf('Threshold for group "%s" has invalid value "%s".', $group, $threshold));
82+
throw new \InvalidArgumentException(\sprintf('Threshold for group "%s" has invalid value "%s".', $group, $threshold));
8383
}
8484
$this->thresholds[$group] = (int) $threshold;
8585
}
@@ -111,17 +111,17 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
111111

112112
foreach ($verboseOutput as $group => $status) {
113113
if (!isset($this->verboseOutput[$group])) {
114-
throw new \InvalidArgumentException(sprintf('Unsupported verbosity group "%s", expected one of "%s".', $group, implode('", "', array_keys($this->verboseOutput))));
114+
throw new \InvalidArgumentException(\sprintf('Unsupported verbosity group "%s", expected one of "%s".', $group, implode('", "', array_keys($this->verboseOutput))));
115115
}
116116
$this->verboseOutput[$group] = $status;
117117
}
118118

119119
if ($ignoreFile) {
120120
if (!is_file($ignoreFile)) {
121-
throw new \InvalidArgumentException(sprintf('The ignoreFile "%s" does not exist.', $ignoreFile));
121+
throw new \InvalidArgumentException(\sprintf('The ignoreFile "%s" does not exist.', $ignoreFile));
122122
}
123123
set_error_handler(static function ($t, $m) use ($ignoreFile, &$line) {
124-
throw new \RuntimeException(sprintf('Invalid pattern found in "%s" on line "%d"', $ignoreFile, 1 + $line).substr($m, 12));
124+
throw new \RuntimeException(\sprintf('Invalid pattern found in "%s" on line "%d"', $ignoreFile, 1 + $line).substr($m, 12));
125125
});
126126
try {
127127
foreach (file($ignoreFile) as $line => $pattern) {
@@ -147,7 +147,7 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
147147
$this->baselineDeprecations[$baseline_deprecation->location][$baseline_deprecation->message] = $baseline_deprecation->count;
148148
}
149149
} else {
150-
throw new \InvalidArgumentException(sprintf('The baselineFile "%s" does not exist.', $this->baselineFile));
150+
throw new \InvalidArgumentException(\sprintf('The baselineFile "%s" does not exist.', $this->baselineFile));
151151
}
152152
}
153153

@@ -316,7 +316,7 @@ public static function fromUrlEncodedString($serializedConfiguration): self
316316
parse_str($serializedConfiguration, $normalizedConfiguration);
317317
foreach (array_keys($normalizedConfiguration) as $key) {
318318
if (!\in_array($key, ['max', 'disabled', 'verbose', 'quiet', 'ignoreFile', 'generateBaseline', 'baselineFile', 'logFile'], true)) {
319-
throw new \InvalidArgumentException(sprintf('Unknown configuration option "%s".', $key));
319+
throw new \InvalidArgumentException(\sprintf('Unknown configuration option "%s".', $key));
320320
}
321321
}
322322

DeprecationErrorHandler/Deprecation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ private function getPackage($path)
351351
}
352352
}
353353

354-
throw new \RuntimeException(sprintf('No vendors found for path "%s".', $path));
354+
throw new \RuntimeException(\sprintf('No vendors found for path "%s".', $path));
355355
}
356356

357357
/**

0 commit comments

Comments
 (0)