Skip to content

Commit

Permalink
Merge pull request #12 from TomasVotruba/tv-tidyup
Browse files Browse the repository at this point in the history
misc
  • Loading branch information
TomasVotruba authored Dec 18, 2024
2 parents e71ab33 + b426eab commit f497764
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 89 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,11 @@ jobs:

-
name: 'Check Active Classes'
run: vendor/bin/class-leak check bin src tests --ansi --skip-path=Fixture --skip-path=Source

-
name: 'Unit tests'
run: vendor/bin/phpunit
run: vendor/bin/class-leak check bin src --ansi --skip-path=Fixture --skip-path=Source

-
name: "Finalize classes"
run: vendor/bin/swiss-knife finalize-classes bin src tests --dry-run --ansi

-
name: 'Composer dependency Analyser'
run: vendor/bin/composer-dependency-analyser
run: vendor/bin/swiss-knife finalize-classes bin src --dry-run --ansi

-
name: 'Validate Composer'
Expand Down
11 changes: 0 additions & 11 deletions composer-dependency-analyser.php

This file was deleted.

27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@
"description": "Automate repeated steps when coming to a PHP project or create new package",
"require": {
"php": "^8.2",
"illuminate/container": "^11.30",
"symfony/console": "^7.1",
"symfony/process": "^7.1",
"symfony/finder": "^7.1",
"illuminate/container": "^11.36",
"symfony/console": "^7.2",
"symfony/process": "^7.2",
"symfony/finder": "^7.2",
"nette/utils": "^4.0",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan": "^2.0",
"webmozart/assert": "^1.11"
},
"require-dev": {
"rector/rector": "^1.2",
"rector/rector": "^2.0",
"phpstan/extension-installer": "^1.4",
"phpunit/phpunit": "^10.5",
"rector/swiss-knife": "^1.0",
"rector/type-perfect": "^1.0",
"phpunit/phpunit": "^11.5",
"rector/swiss-knife": "^2.0",
"symplify/easy-coding-standard": "^12.3",
"shipmonk/composer-dependency-analyser": "^1.7",
"tomasvotruba/type-coverage": "^1.0",
"tomasvotruba/class-leak": "^1.1",
"tomasvotruba/unused-public": "^1.0",
"tomasvotruba/type-coverage": "^2.0",
"tomasvotruba/class-leak": "^2.0",
"tomasvotruba/unused-public": "^2.0",
"tracy/tracy": "^2.10",
"nikic/php-parser": "^4.19"
"nikic/php-parser": "^5.3",
"symplify/phpstan-extensions": "^12.0"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 0 additions & 18 deletions config/phpstan-rules.neon

This file was deleted.

1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
return ECSConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withPreparedSets(common: true, psr12: true, symplify: true);
11 changes: 3 additions & 8 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
includes:
- config/phpstan-rules.neon

parameters:
level: 8
errorFormat: symplify

paths:
- bin
- src
- tests

ignoreErrors:
- '#Public constant "TomasVotruba\\Handyman\\(.*?)::ERROR_MESSAGE" is never used#'
- '#PHPStan\\Testing\\RuleTestCase but does not specify its types#'
- '#return type with generic interface PHPStan\\Rules\\Rule does not specify its types: TNodeType#'
- '#Method (.*?)::testRule\(\) has parameter \$expectedErrorsWithLines with no value type specified in iterable type array#'
# mess
- '#Parameter \#2 \$replace of function str_replace expects array<string>\|string, list<float\|int\|string\|null> given#'

excludePaths:
- */Source/*
Expand Down
10 changes: 4 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="main">
<directory>tests</directory>
<exclude>tests/PHPStan/Rule/PublicStaticDataProviderRule/Fixture</exclude>
</testsuite>
</testsuites>
</phpunit>
3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Rector\Config\RectorConfig;

return RectorConfig::configure()
->withPaths([__DIR__ . '/bin', __DIR__ . '/src', __DIR__ . '/tests',])
->withPaths([__DIR__ . '/bin', __DIR__ . '/src'])
->withSkip([
'*/Fixture/*',
])
Expand All @@ -22,5 +22,4 @@
phpunitCodeQuality: true,
)
->withAttributesSets()
->withPhpPolyfill()
->withPhpSets();
18 changes: 0 additions & 18 deletions src/Enum/ClassName.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Finder/ClassFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public static function find(string $directory): array
$classNames[] = self::createClassNameFromFilePath($commandFileInfo->getRealPath());
}

Assert::allString($classNames);
Assert::allClassExists($classNames);

// remove abstract classes, check via reflection
Expand Down

0 comments on commit f497764

Please sign in to comment.