Skip to content

Commit

Permalink
Merge pull request #1136: apply Rector on tests files
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Sep 5, 2024
1 parent a5e0766 commit 141fa8f
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Thumbs.db
clover.xml
.env
builds
tests/runtime/
4 changes: 0 additions & 4 deletions tests/ClassNode/ConflictResolver/ConflictResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ public function testDuplicateProperty(): void
}

/**
* @param string $filename
* @param array $dependencies
*
* @return ClassNode
* @throws \Throwable
*/
private function getDefinition(string $filename, array $dependencies): ClassNode
Expand All @@ -127,7 +124,6 @@ private function getDefinition(string $filename, array $dependencies): ClassNode
}

/**
* @return NodeExtractor
* @throws \Throwable
*/
private function getExtractor(): NodeExtractor
Expand Down
4 changes: 0 additions & 4 deletions tests/InjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@ public function testParentConstructorParamsTypeDefinition(): void
}

/**
* @param string $filename
* @param array $dependencies
*
* @return ClassNode
* @throws \ReflectionException
* @throws ClassNotDeclaredException
*/
Expand Down
4 changes: 1 addition & 3 deletions tests/TraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ public function testOK(): void
$c->bindSingleton(TestClass::class, $t);
$p->bindProperty('testClass', TestClass::class);

$r = ContainerScope::runScope($c, static function () use ($t) {
return $t->getTest();
});
$r = ContainerScope::runScope($c, static fn() => $t->getTest());

$this->assertSame($t, $r);
}
Expand Down
3 changes: 0 additions & 3 deletions tests/Traverse/ConstructorParamsVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public function leaveNode(Node $node): void
}
}

/**
* @return array
*/
public function getParams(): array
{
return $this->params;
Expand Down
12 changes: 0 additions & 12 deletions tests/Traverse/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,11 @@ public function __construct(Parser $parser = null)
$this->parser = $parser ?? (new ParserFactory())->create(ParserFactory::ONLY_PHP7);
}

/**
* @param string $filename
* @return array
*/
public function extractFromFilename(string $filename): array
{
return $this->extractFromString(file_get_contents($filename));
}

/**
* @param string $code
* @return array
*/
public function extractFromString(string $code): array
{
$params = new ConstructorParamsVisitor();
Expand All @@ -40,10 +32,6 @@ public function extractFromString(string $code): array
return $params->getParams();
}

/**
* @param string $code
* @param NodeVisitor ...$visitors
*/
private function traverse(string $code, NodeVisitor ...$visitors): void
{
$tr = new NodeTraverser();
Expand Down

0 comments on commit 141fa8f

Please sign in to comment.