Skip to content

Commit bdb04a8

Browse files
committed
Fix CS
1 parent ecfdb02 commit bdb04a8

File tree

8 files changed

+28
-31
lines changed

8 files changed

+28
-31
lines changed

src/Configuration.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414

1515
namespace Humbug\PhpScoper;
1616

17-
use function array_key_exists;
18-
use Closure;
1917
use InvalidArgumentException;
2018
use Iterator;
2119
use RuntimeException;
2220
use SplFileInfo;
2321
use Symfony\Component\Filesystem\Filesystem;
2422
use Symfony\Component\Finder\Finder;
2523
use const DIRECTORY_SEPARATOR;
24+
use function array_key_exists;
2625
use function dirname;
2726
use function file_exists;
2827
use function gettype;
@@ -139,15 +138,15 @@ public static function load(string $path = null, array $paths = []): self
139138
}
140139

141140
/**
142-
* @param string|null $path Absolute path to the configuration file loaded.
143-
* @param string|null $prefix The prefix applied.
144-
* @param string[][] $filesWithContents Array of tuple with the first argument being the file path and the second its contents
145-
* @param callable[] $patchers List of closures which can alter the content of the files being
146-
* scoped.
147-
* @param Whitelist $whitelist List of classes that will not be scoped.
148-
* returning a boolean which if `true` means the class should be scoped
149-
* (i.e. is ignored) or scoped otherwise.
150-
* @param string[] $whitelistedFiles List of absolute paths of files to completely ignore
141+
* @param string|null $path Absolute path to the configuration file loaded.
142+
* @param string|null $prefix The prefix applied.
143+
* @param string[][] $filesWithContents Array of tuple with the first argument being the file path and the second its contents
144+
* @param callable[] $patchers List of closures which can alter the content of the files being
145+
* scoped.
146+
* @param Whitelist $whitelist List of classes that will not be scoped.
147+
* returning a boolean which if `true` means the class should be scoped
148+
* (i.e. is ignored) or scoped otherwise.
149+
* @param string[] $whitelistedFiles List of absolute paths of files to completely ignore
151150
*/
152151
private function __construct(
153152
?string $path,

src/PhpParser/NodeTraverser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
namespace Humbug\PhpScoper\PhpParser;
1616

17-
use function array_slice;
18-
use function array_values;
19-
use function count;
2017
use PhpParser\Node;
2118
use PhpParser\Node\Name;
2219
use PhpParser\Node\Stmt\Declare_;
@@ -26,6 +23,9 @@
2623
use PhpParser\Node\Stmt\Use_;
2724
use PhpParser\Node\Stmt\UseUse;
2825
use PhpParser\NodeTraverser as PhpParserNodeTraverser;
26+
use function array_slice;
27+
use function array_values;
28+
use function count;
2929

3030
/**
3131
* @private

src/PhpParser/NodeVisitor/Collection/NamespaceStmtCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class NamespaceStmtCollection implements IteratorAggregate, Countable
3838

3939
/**
4040
* @var (Name|null)[] Associative array with the potentially prefixed namespace names as keys and their original name
41-
* as value.
41+
* as value.
4242
*/
4343
private $mapping = [];
4444

src/PhpParser/NodeVisitor/ConstStmtReplacer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Humbug\PhpScoper\Whitelist;
1919
use PhpParser\Node;
2020
use PhpParser\Node\Arg;
21-
use PhpParser\Node\Expr;
2221
use PhpParser\Node\Expr\FuncCall;
2322
use PhpParser\Node\Name;
2423
use PhpParser\Node\Name\FullyQualified;

src/PhpParser/NodeVisitor/StringScalarPrefixer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use function array_key_exists;
3333
use function array_shift;
3434
use function array_values;
35-
use function Humbug\PhpScoper\is_stringable;
3635
use function implode;
3736
use function in_array;
3837
use function is_string;
@@ -149,7 +148,7 @@ private function prefixStringArg(String_ $string, Arg $parentNode): String_
149148

150149
// In the case of a function call, we allow to prefix strings which could be classes belonging to the global
151150
// namespace in some cases
152-
$functionName = $functionNode->name instanceof Name? (string) $functionNode->name : null;
151+
$functionName = $functionNode->name instanceof Name ? (string) $functionNode->name : null;
153152

154153
if (false === in_array($functionName, self::SPECIAL_FUNCTION_NAMES, true)) {
155154
return $this->belongsToTheGlobalNamespace($string)

src/Scoper/Composer/AutoloadPrefixer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
namespace Humbug\PhpScoper\Scoper\Composer;
1616

1717
use Humbug\PhpScoper\Whitelist;
18-
use function is_string;
1918
use stdClass;
2019
use function array_map;
2120
use function is_array;
21+
use function is_string;
2222
use function str_replace;
2323

2424
/**
@@ -151,8 +151,8 @@ private static function updatePSR0Path($path, string $namespace)
151151
* string |
152152
* or simply the namespace not existing as a psr-4 entry.
153153
*
154-
* @param string $psr0Namespace
155-
* @param string|string[] $psr0Path
154+
* @param string $psr0Namespace
155+
* @param string|string[] $psr0Path
156156
* @param (string|string[])[] $psr4
157157
*
158158
* @return string|string[]

src/Scoper/Composer/JsonFileScoper.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414

1515
namespace Humbug\PhpScoper\Scoper\Composer;
1616

17-
use function gettype;
1817
use Humbug\PhpScoper\Scoper;
1918
use Humbug\PhpScoper\Whitelist;
19+
use LogicException;
20+
use stdClass;
21+
use function gettype;
2022
use function Humbug\PhpScoper\json_decode;
2123
use function Humbug\PhpScoper\json_encode;
22-
use InvalidArgumentException;
23-
use LogicException;
2424
use function sprintf;
25-
use stdClass;
2625

2726
final class JsonFileScoper implements Scoper
2827
{

src/json.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
*/
1414

1515
namespace Humbug\PhpScoper {
16-
17-
use function class_exists;
18-
use function error_clear_last;
1916
use Exception;
20-
use function json_last_error;
2117
use JsonException;
18+
use function class_exists;
19+
use function error_clear_last;
2220
use function json_decode as original_json_decode;
2321
use function json_encode as original_json_encode;
22+
use function json_last_error;
2423
use function json_last_error_msg as original_json_last_error_msg;
2524

2625
/**
@@ -47,7 +46,7 @@ function json_encode($value, int $options = 0, int $depth = 512): string
4746

4847
$result = original_json_encode($value, $options, $depth);
4948

50-
if ($result === false) {
49+
if (false === $result) {
5150
throw create_json_exception();
5251
}
5352

@@ -65,6 +64,8 @@ function create_json_exception(): JsonException
6564

6665
namespace {
6766
if (false === class_exists(JsonException::class, false)) {
68-
class JsonException extends Exception {}
67+
class JsonException extends Exception
68+
{
69+
}
6970
}
7071
}

0 commit comments

Comments
 (0)