diff --git a/.github/workflows/deptrac.yml b/.github/workflows/deptrac.yml index d7a3d87..1239cdb 100644 --- a/.github/workflows/deptrac.yml +++ b/.github/workflows/deptrac.yml @@ -6,7 +6,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'depfile.yaml' - '.github/workflows/deptrac.yml' push: @@ -14,7 +14,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'depfile.yaml' - '.github/workflows/deptrac.yml' diff --git a/.github/workflows/infection.yml b/.github/workflows/infection.yml index ad6d725..c63fd22 100644 --- a/.github/workflows/infection.yml +++ b/.github/workflows/infection.yml @@ -6,7 +6,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'phpunit*' - '.github/workflows/infection.yml' push: @@ -14,7 +14,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'phpunit*' - '.github/workflows/infection.yml' diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 5732fce..c22b866 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -6,7 +6,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'phpstan*' - '.github/workflows/phpstan.yml' push: @@ -14,7 +14,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'phpstan*' - '.github/workflows/phpstan.yml' diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 73db145..d39d2e4 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -6,7 +6,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'phpunit*' - '.github/workflows/phpunit.yml' push: @@ -14,7 +14,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'phpunit*' - '.github/workflows/phpunit.yml' diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 3e0ee05..0816822 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -6,7 +6,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'rector.php' - '.github/workflows/rector.yml' push: @@ -14,7 +14,7 @@ on: - develop paths: - '**.php' - - 'composer.**' + - 'composer.*' - 'rector.php' - '.github/workflows/rector.yml' @@ -64,5 +64,5 @@ jobs: - name: Analyze for refactoring run: | - composer global require --dev rector/rector:^0.12.10 + composer global require --dev rector/rector:^0.12.16 rector process --dry-run --no-progress-bar diff --git a/composer-unused.php b/composer-unused.php new file mode 100644 index 0000000..f46e293 --- /dev/null +++ b/composer-unused.php @@ -0,0 +1,17 @@ +addNamedFilter(NamedFilter::fromString('symfony/config')) + // ->addPatternFilter(PatternFilter::fromString('/symfony-.*/')) + ->setAdditionalFilesFor('codeigniter4/framework', [ + ...Glob::glob(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers/*.php'), + ]); +}; diff --git a/composer.json b/composer.json index 8f749df..a8c4c80 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,8 @@ "twbs/bootstrap": "^4.0" }, "require-dev": { - "codeigniter4/devkit": "^1.0", - "codeigniter4/framework": "^4.1" + "codeigniter4/framework": "^4.1", + "tatter/tools": "^2.0" }, "config": { "allow-plugins": { diff --git a/rector.php b/rector.php index fab090d..14a7f06 100644 --- a/rector.php +++ b/rector.php @@ -29,6 +29,7 @@ use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector; use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector; +use Rector\Php74\Rector\Property\TypedPropertyRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector; use Rector\Set\ValueObject\LevelSetList; @@ -122,4 +123,8 @@ $services->set(MakeInheritedMethodVisibilitySameAsParentRector::class); $services->set(SimplifyEmptyArrayCheckRector::class); $services->set(NormalizeNamespaceByPSR4ComposerAutoloadRector::class); + $services->set(TypedPropertyRector::class) + ->configure([ + TypedPropertyRector::INLINE_PUBLIC => true, + ]); }; diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml new file mode 100644 index 0000000..6773bb8 --- /dev/null +++ b/roave-bc-check.yaml @@ -0,0 +1,3 @@ +parameters: + ignoreErrors: + - '#\[BC\] SKIPPED: .+ could not be found in the located source#' diff --git a/src/Publishers/DataTablesPublisher.php b/src/Publishers/DataTablesPublisher.php index e465fb3..f893ffb 100644 --- a/src/Publishers/DataTablesPublisher.php +++ b/src/Publishers/DataTablesPublisher.php @@ -19,6 +19,7 @@ public function publish(): bool return $this ->addPath('js') ->addPath('types') + ->removePattern('*.ts') ->merge(true); } } diff --git a/src/Publishers/DataTablesStylePublisher.php b/src/Publishers/DataTablesStylePublisher.php index d81a032..228c2fb 100644 --- a/src/Publishers/DataTablesStylePublisher.php +++ b/src/Publishers/DataTablesStylePublisher.php @@ -21,6 +21,7 @@ public function publish(): bool ->addPath('images') ->addPath('js') ->addPath('types') + ->removePattern('*.ts') ->merge(true); } } diff --git a/src/Publishers/JQueryPublisher.php b/src/Publishers/JQueryPublisher.php index 78399c3..a2dcf2f 100644 --- a/src/Publishers/JQueryPublisher.php +++ b/src/Publishers/JQueryPublisher.php @@ -8,4 +8,17 @@ class JQueryPublisher extends FrontendPublisher { protected string $vendorPath = 'components/jquery'; protected string $publicPath = 'jquery'; + + /** + * Reads files from the sources and copies them out to their destinations. + * This method should be reimplemented by child classes intended for + * discovery. + */ + public function publish(): bool + { + return $this + ->addPath('/') + ->removePattern('*.md') + ->merge(true); + } } diff --git a/tests/PublishersTest.php b/tests/PublishersTest.php index c6b38b1..3bdd713 100644 --- a/tests/PublishersTest.php +++ b/tests/PublishersTest.php @@ -34,7 +34,6 @@ public function publisherProvider(): array DataTablesPublisher::class, [ 'datatables/js/jquery.dataTables.js', - 'datatables/types/types.d.ts', ], ], [