diff --git a/.github/workflows/.editorconfig b/.github/workflows/.editorconfig deleted file mode 100644 index 473df25..0000000 --- a/.github/workflows/.editorconfig +++ /dev/null @@ -1,2 +0,0 @@ -[{*.yaml,*.yml}] -indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index e54001a..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: Plugin CI -on: - push: - branches: [ 'master' ] - pull_request: - -env: - PHP_CS_FIXER_IGNORE_ENV: 1 - XDEBUG_MODE: coverage - -jobs: - tests: - name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}" - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - # normal, highest, non-dev installs - php-version: [ '8.2' ] - dependency-versions: [ 'highest' ] - include: - # testing lowest PHP version with the lowest dependencies - # - php-version: '8.2' - # dependency-versions: 'lowest' - - # testing dev versions with the highest PHP - - php-version: '8.2' - dependency-versions: 'highest' - - steps: - - name: "Checkout code" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - - - name: "Composer install" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "${{ matrix.dependency-versions }}" - composer-options: "--prefer-dist --no-progress" - - - name: Run tests - run: composer run test - - - name: Coverage report - run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover coverage.xml - - - name: Upload coverage reports to Codecov - run: | - # Replace `linux` below with the appropriate OS - curl -Os https://uploader.codecov.io/latest/linux/codecov - chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} \ No newline at end of file diff --git a/.gitignore b/.gitignore index c40cd9d..cf39865 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ composer.lock test-coverage-report phpunit.xml .php-cs-fixer.php -phpstan.neon \ No newline at end of file +phpstan.neon +coverage \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index 5147b69..0000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,31 +0,0 @@ -in(__DIR__.'/src') - ->in(__DIR__.'/tests') -; - -return (new PhpCsFixer\Config()) - ->setRules(array( - '@Symfony' => true, - '@Symfony:risky' => true, - 'protected_to_private' => false, - 'semicolon_after_instruction' => false, - 'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress']], - 'header_comment' => [ - 'header' => << - - For the full copyright and license information, please view the LICENSE - file that was distributed with this source code. -EOF - ] - )) - ->setRiskyAllowed(true) - ->setFinder($finder); \ No newline at end of file diff --git a/src/Boot/DependencyProviderBootLoader.php b/Boot/DependencyProviderBootLoader.php similarity index 89% rename from src/Boot/DependencyProviderBootLoader.php rename to Boot/DependencyProviderBootLoader.php index cc95754..24fac07 100644 --- a/src/Boot/DependencyProviderBootLoader.php +++ b/Boot/DependencyProviderBootLoader.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Micro\Framework\Kernel\Boot; +namespace Micro\Framework\BootDependency\Boot; use Micro\Component\DependencyInjection\Autowire\AutowireHelperFactory; use Micro\Component\DependencyInjection\Autowire\AutowireHelperInterface; use Micro\Component\DependencyInjection\Autowire\ContainerAutowire; -use Micro\Component\DependencyInjection\Container; -use Micro\Framework\Kernel\Plugin\DependencyProviderInterface; +use Micro\Framework\DependencyInjection\Container; +use Micro\Framework\BootDependency\Plugin\DependencyProviderInterface; use Micro\Framework\Kernel\Plugin\PluginBootLoaderInterface; use Psr\Container\ContainerInterface; diff --git a/src/Plugin/DependencyProviderInterface.php b/Plugin/DependencyProviderInterface.php similarity index 71% rename from src/Plugin/DependencyProviderInterface.php rename to Plugin/DependencyProviderInterface.php index b002e8c..56edda9 100644 --- a/src/Plugin/DependencyProviderInterface.php +++ b/Plugin/DependencyProviderInterface.php @@ -9,13 +9,10 @@ * file that was distributed with this source code. */ -namespace Micro\Framework\Kernel\Plugin; +namespace Micro\Framework\BootDependency\Plugin; -use Micro\Component\DependencyInjection\Container; +use Micro\Framework\DependencyInjection\Container; -/** - * @TODO: Remove extends for 2.0 version - */ interface DependencyProviderInterface { public function provideDependencies(Container $container): void; diff --git a/tests/Unit/Boot/DependencyProviderBootLoaderTest.php b/Tests/Unit/Boot/DependencyProviderBootLoaderTest.php similarity index 81% rename from tests/Unit/Boot/DependencyProviderBootLoaderTest.php rename to Tests/Unit/Boot/DependencyProviderBootLoaderTest.php index 9a858d1..89fa117 100644 --- a/tests/Unit/Boot/DependencyProviderBootLoaderTest.php +++ b/Tests/Unit/Boot/DependencyProviderBootLoaderTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Micro\Framework\Kernel\Test\Unit\Boot; +namespace Micro\Framework\BootDependency\Tests\Unit\Boot; -use Micro\Component\DependencyInjection\Container; -use Micro\Framework\Kernel\Boot\DependencyProviderBootLoader; -use Micro\Framework\Kernel\Plugin\DependencyProviderInterface; +use Micro\Framework\DependencyInjection\Container; +use Micro\Framework\BootDependency\Boot\DependencyProviderBootLoader; +use Micro\Framework\BootDependency\Plugin\DependencyProviderInterface; use PHPUnit\Framework\TestCase; class DependencyProviderBootLoaderTest extends TestCase diff --git a/composer.json b/composer.json index 78c4ee1..7e597d8 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "micro/kernel-boot-dependency", "description": "Micro Framework: Kernel Boot loader - component to provide dependencies", "license": "MIT", - "type": "micro-plugin", + "type": "library", "authors": [ { "name": "Stanislau Komar", @@ -10,26 +10,19 @@ } ], "require": { - "micro/autowire": "^1.6", - "micro/kernel": "^1.6" + "micro/autowire": "^2.0", + "micro/kernel": "^2.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.29", - "friendsofphp/php-cs-fixer": "^3.13", - "phpstan/phpstan": "^1.9", - "phpunit/php-code-coverage": "^9.2", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.2" + "ergebnis/composer-normalize": "^2.34" }, "autoload": { "psr-4": { - "Micro\\Framework\\Kernel\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Micro\\Framework\\Kernel\\Test\\Unit\\": "tests/Unit" - } + "Micro\\Framework\\BootDependency\\": "/" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "config": { "allow-plugins": { @@ -37,24 +30,5 @@ }, "sort-packages": true }, - "scripts": { - "coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text", - "coverage-html": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html ./test-coverage-report", - "php-cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --using-cache=no", - "php-cs-try": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no", - "phpstan": "./vendor/bin/phpstan analyze --no-progress", - "phpunit": "./vendor/bin/phpunit", - "psalm": "./vendor/bin/psalm --no-progress --show-info=true --no-cache", - "statics": [ - "@phpstan", - "@psalm", - "@php-cs-try" - ], - "test": [ - "@statics", - "composer validate --strict", - "composer normalize", - "@coverage" - ] - } + "minimum-stability": "dev" } diff --git a/coverage/clover.xml b/coverage/clover.xml deleted file mode 100644 index 75dc5bb..0000000 --- a/coverage/clover.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100755 index a92f5e2..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - src/ - - - - - Micro Framework - сode formatting rules. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phpstan.neon.dist b/phpstan.neon.dist deleted file mode 100644 index 18d77f7..0000000 --- a/phpstan.neon.dist +++ /dev/null @@ -1,4 +0,0 @@ -parameters: - level: 7 - paths: - - src \ No newline at end of file diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 99ad2c8..0000000 --- a/psalm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - \ No newline at end of file