Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Jul 24, 2018
1 parent 0a1b533 commit 6c172ad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/Autoload/ScoperAutoloadGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function %1$s() {
private function hasNamespacedFunctions(array $functions): bool
{
foreach ($functions as [$original, $alias]) {
/**
/*
* @var string
* @var string $alias
*/
Expand Down
13 changes: 12 additions & 1 deletion src/PhpParser/Node/NamedIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

declare(strict_types=1);

/*
* This file is part of the humbug/php-scoper package.
*
* Copyright (c) 2017 Théo FIDRY <[email protected]>,
* Pádraic Brady <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Humbug\PhpScoper\PhpParser\Node;

use PhpParser\Node\Identifier;
use PhpParser\Node\Name;

Expand All @@ -25,4 +36,4 @@ public function getOriginalNode(): Identifier
{
return $this->originalNode;
}
}
}
4 changes: 2 additions & 2 deletions src/PhpParser/NodeVisitor/Collection/UseStmtCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace Humbug\PhpScoper\PhpParser\NodeVisitor\Collection;

use ArrayIterator;
use function count;
use Humbug\PhpScoper\PhpParser\Node\NamedIdentifier;
use Humbug\PhpScoper\PhpParser\NodeVisitor\ParentNodeAppender;
use IteratorAggregate;
Expand All @@ -27,6 +26,7 @@
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Use_;
use PhpParser\Node\Stmt\UseUse;
use function count;
use function Humbug\PhpScoper\clone_node;

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ private function isFunctionName(Name $node, ?Node $parentNode): bool
if (false === ($parentNode instanceof Function_)) {
return false;
}
/** @var Function_ $parentNode */
/* @var Function_ $parentNode */

return $node instanceof NamedIdentifier && $node->getOriginalNode() === $parentNode->name;
}
Expand Down
23 changes: 7 additions & 16 deletions tests/Scoper/PhpScoperSpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,12 @@

namespace Humbug\PhpScoper\Scoper;

use function array_diff;
use function array_keys;
use function array_map;
use function current;
use Generator;
use Humbug\PhpScoper\PhpParser\FakeParser;
use Humbug\PhpScoper\PhpParser\TraverserFactory;
use Humbug\PhpScoper\Reflector;
use Humbug\PhpScoper\Scoper;
use Humbug\PhpScoper\Whitelist;
use function is_array;
use LogicException;
use const PHP_EOL;
use PhpParser\Error as PhpParserError;
use PhpParser\Node\Name;
use PhpParser\NodeTraverserInterface;
use PhpParser\Parser;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Roave\BetterReflection\BetterReflection;
use Roave\BetterReflection\Reflector\ClassReflector;
use Roave\BetterReflection\Reflector\FunctionReflector;
Expand All @@ -43,9 +29,15 @@
use Symfony\Component\Finder\Finder;
use Throwable;
use UnexpectedValueException;
use const PHP_EOL;
use function array_diff;
use function array_keys;
use function array_map;
use function current;
use function Humbug\PhpScoper\create_fake_patcher;
use function Humbug\PhpScoper\create_parser;
use function implode;
use function is_array;
use function sprintf;

class PhpScoperSpecTest extends TestCase
Expand Down Expand Up @@ -272,8 +264,7 @@ private function createSpecMessage(
?string $actual,
array $expectedRegisteredClasses,
array $expectedRegisteredFunctions
): string
{
): string {
$formattedWhitelist = $this->formatSimpleList($whitelist->toArray());

$formattedWhitelistGlobalConstants = $this->convertBoolToString($whitelist->whitelistGlobalConstants());
Expand Down
10 changes: 0 additions & 10 deletions tests/Scoper/PhpScoperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Humbug\PhpScoper\Scoper;

use Generator;
use Humbug\PhpScoper\PhpParser\FakeParser;
use Humbug\PhpScoper\PhpParser\TraverserFactory;
use Humbug\PhpScoper\Reflector;
Expand All @@ -28,19 +27,10 @@
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Roave\BetterReflection\BetterReflection;
use Roave\BetterReflection\Reflector\ClassReflector;
use Roave\BetterReflection\Reflector\FunctionReflector;
use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator;
use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator;
use Roave\BetterReflection\SourceLocator\Type\StringSourceLocator;
use Symfony\Component\Finder\Finder;
use Throwable;
use UnexpectedValueException;
use function Humbug\PhpScoper\create_fake_patcher;
use function Humbug\PhpScoper\create_parser;
use function implode;
use function sprintf;

class PhpScoperTest extends TestCase
{
Expand Down

0 comments on commit 6c172ad

Please sign in to comment.