Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ parameters:
number: 'int|float'
tableRowArray: 'array<string,\PhpBench\Expression\Ast\Node>'
tableColumnDefinition: 'array<string,mixed>'
stubFiles:
- phpstan/Container.stub
includes:
- phpstan-baseline.neon
21 changes: 21 additions & 0 deletions phpstan/Container.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Psr\Container;

interface ContainerInterface
{
/**
* @throws NotFoundExceptionInterface
* @throws ContainerExceptionInterface
* @template T
* @param class-string<T>|string $id
* @return ($id is class-string<T> ? T : mixed)
*/
public function get(string $id);

public function has(string $id): bool;
}

interface NotFoundExceptionInterface extends \Throwable {}

interface ContainerExceptionInterface extends \Throwable {}
1 change: 0 additions & 1 deletion tests/Unit/Expression/NodePrinter/DisplayAsPrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function testDisplayAsBinaryUnit(): void
new IntegerNode(1024 ** 3),
new UnitNode(new StringNode('memory'))
),
[],
[ExpressionExtension::PARAM_MEMORY_UNIT_PREFIX => 'binary']
));
}
Expand Down
5 changes: 2 additions & 3 deletions tests/Unit/Expression/NodePrinterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ class NodePrinterTestCase extends IntegrationTestCase
{
/**
* @param array<string, mixed> $config
* @param parameters $params
*/
public function print(Node $node, array $params = [], array $config = []): string
public function print(Node $node, array $config = []): string
{
return $this->container($config)->get(Printer::class)->print($node, $params);
return $this->container($config)->get(Printer::class)->print($node);
}
}
9 changes: 3 additions & 6 deletions tests/Unit/Expression/ParseletTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ public function evaluate(Node $node, array $params = []): Node
)->evaluate($node, $params);
}

/**
* @param parameters $params
*/
public function print(Node $node, array $params = []): string
public function print(Node $node): string
{
return $this->container()->get(Printer::class)->print($node, $params);
return $this->container()->get(Printer::class)->print($node);
}

/**
Expand Down Expand Up @@ -62,7 +59,7 @@ protected static function providePrintFromEvaluate(): Generator
*/
public function testPrint(string $expr, array $params = [], string $expected = null): void
{
$result = $this->print($this->parse($expr), $params);
$result = $this->print($this->parse($expr));
self::assertEquals($expected ?: $expr, $result);
}

Expand Down