Skip to content

Commit

Permalink
[BUILD] Added more strict phpstan rules (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Jul 30, 2019
2 parents 652706b + 72c2233 commit 0247139
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions phpstan.neon
Expand Up @@ -8,6 +8,12 @@ parameters:
ignoreErrors:
# Symfony DI
- '#Cannot call method defaultValue\(\) on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\|null.#'
- "/Call to function method_exists.. with 'Symfony.+' and 'getRootNode' will always evaluate to false./"

# Symfony Contracts
- '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required.#'

# PHPUnit
-
message: '#Property .*::\$.* has no typehint specified.#'
path: tests/
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Expand Up @@ -22,7 +22,7 @@ public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder('core23_dompdf');

// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
if (!method_exists(TreeBuilder::class, 'getRootNode')) {
$rootNode = $treeBuilder->root('core23_dompdf');
} else {
$rootNode = $treeBuilder->getRootNode();
Expand Down
3 changes: 0 additions & 3 deletions tests/Factory/DompdfFactoryTest.php
Expand Up @@ -12,7 +12,6 @@
namespace Core23\DompdfBundle\Tests\Factory;

use Core23\DompdfBundle\Factory\DompdfFactory;
use Dompdf\Options;
use PHPUnit\Framework\TestCase;

final class DompdfFactoryTest extends TestCase
Expand All @@ -35,7 +34,6 @@ public function testCreate(): void

$options = $dompdf->getOptions();

static::assertInstanceOf(Options::class, $options);
static::assertSame(100, $options->getDpi());
}

Expand All @@ -48,7 +46,6 @@ public function testCreateWithOptions(): void

$options = $dompdf->getOptions();

static::assertInstanceOf(Options::class, $options);
static::assertSame('foo', $options->getTempDir());
static::assertSame(200, $options->getDpi());
}
Expand Down
5 changes: 4 additions & 1 deletion vendor-bin/phpstan/composer.json
@@ -1,9 +1,12 @@
{
"require": {
"ekino/phpstan-banned-code": "^0.1",
"jangregor/phpstan-prophecy": "^0.4",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-phpunit": "^0.11"
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"phpstan/phpstan-symfony": "^0.11"
},
"conflict": {
"phpunit/phpunit": ">=8.0"
Expand Down

0 comments on commit 0247139

Please sign in to comment.