Skip to content

Commit

Permalink
Merge pull request #58 from TomasVotruba/tv-parser-5
Browse files Browse the repository at this point in the history
bump to php-parser 5
  • Loading branch information
TomasVotruba authored Dec 12, 2024
2 parents da439e5 + ae29924 commit 89461ff
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
],
"require": {
"php": ">=8.2",
"illuminate/container": "^11.0",
"illuminate/container": "^11.35",
"nette/utils": "^3.2",
"nikic/php-parser": "^4.19",
"nikic/php-parser": "^5.3",
"symfony/console": "^6.4",
"symfony/finder": "^6.4",
"webmozart/assert": "^1.11"
},
"require-dev": {
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.12",
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.2",
"symplify/easy-coding-standard": "^12.1",
"symplify/phpstan-extensions": "^11.2",
"tomasvotruba/unused-public": "^1.0",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11.5",
"rector/rector": "^2.0",
"symplify/easy-coding-standard": "^12.4",
"symplify/phpstan-extensions": "^12.0",
"tomasvotruba/unused-public": "^2.0",
"tracy/tracy": "^2.10"
},
"autoload": {
Expand Down Expand Up @@ -50,7 +50,7 @@
"scripts": {
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify",
"phpstan": "vendor/bin/phpstan analyse --ansi",
"rector": "vendor/bin/rector process --dry-run --ansi"
}
}
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
level: 8
errorFormat: symplify

paths:
- bin
Expand All @@ -9,3 +10,9 @@ parameters:
excludePaths:
- */Fixture/*
- */Source/*

treatPhpDocTypesAsCertain: false

ignoreErrors:
# enum error type
- '#Method TomasVotruba\\ClassLeak\\Reporting\\UnusedClassReporter::reportResult\(\) never returns 2 so it can be removed from the return type#'
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__DIR__ . '/tests',
])
->withPreparedSets(
deadCode: true, naming: true, privatization: true, earlyReturn: true, codeQuality: true, codingStyle: true, typeDeclarations: true, phpunit: true, phpunitCodeQuality: true
deadCode: true, naming: true, privatization: true, earlyReturn: true, codeQuality: true, codingStyle: true, typeDeclarations: true, phpunitCodeQuality: true
)
->withPhpSets()
->withRootFiles()
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function create(): Container

$container->singleton(Parser::class, static function (): Parser {
$parserFactory = new ParserFactory();
return $parserFactory->create(ParserFactory::PREFER_PHP7);
return $parserFactory->createForHostVersion();
});

$container->singleton(
Expand Down
1 change: 0 additions & 1 deletion src/Filtering/PossiblyUnusedClassesFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace TomasVotruba\ClassLeak\Filtering;

use Symfony\Component\Console\Style\SymfonyStyle;
use TomasVotruba\ClassLeak\ValueObject\FileWithClass;
use Webmozart\Assert\Assert;

Expand Down
4 changes: 3 additions & 1 deletion src/ValueObject/UnusedClassesResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public function getWithParentsFileWithClasses(): array

public function getCount(): int
{
return count($this->parentLessFileWithClasses) + count($this->withParentsFileWithClasses) + count($this->traits);
return count($this->parentLessFileWithClasses) + count($this->withParentsFileWithClasses) + count(
$this->traits
);
}

/**
Expand Down

0 comments on commit 89461ff

Please sign in to comment.