Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Added dev-tools library #10

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,28 @@ jobs:
dependency-versions: 'highest'

steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
- name: Checkout code
uses: actions/checkout@v2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
coverage: none
php-version: ${{ matrix.php-version }}

- name: "Composer install"
uses: "ramsey/composer-install@v2"
- name: Composer install
uses: ramsey/composer-install@v2
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
dependency-versions: ${{ matrix.dependency-versions }}
composer-options: --prefer-dist --no-progress

- name: Test tools install
run: |
cd vendor/micro/dev-tools/tools/psalm; composer install; cd ../../../../..;
cd vendor/micro/dev-tools/tools/phpstan; composer install; cd ../../../../..;
cd vendor/micro/dev-tools/tools/php-cs-fixer; composer install; cd ../../../../..;
cd vendor/micro/dev-tools/tools/phpcs; composer install; cd ../../../../..;
cd vendor/micro/dev-tools/tools/phpmd; composer install; cd ../../../../..;

- name: Run tests
run: composer run test
Expand Down
22 changes: 12 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
"micro/dependency-injection": "^1.6"
},
"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"
"micro/dev-tools": "dev-feature/library-created"
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:Micro-PHP/dev-tools.git"
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Micro\\Framework\\Kernel\\": "src/"
Expand All @@ -40,11 +42,11 @@
"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",
"php-cs-fix": "./vendor/micro/dev-tools/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --verbose --using-cache=no",
"php-cs-try": "./vendor/micro/dev-tools/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no",
"phpstan": "./vendor/micro/dev-tools/tools/phpstan/vendor/bin/phpstan analyze --no-progress",
"psalm": "./vendor/micro/dev-tools/tools/psalm/vendor/bin/psalm --no-progress --show-info=true --no-cache",
"statics": [
"@phpstan",
"@psalm",
Expand Down
12 changes: 0 additions & 12 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ public function setBootLoaders(iterable $bootLoaders): self
return $this;
}

/**
* {@inheritDoc}
*/
public function run(): void
{
if ($this->isStarted) {
Expand All @@ -78,17 +75,11 @@ public function run(): void
$this->isStarted = true;
}

/**
* {@inheritDoc}
*/
public function container(): Container
{
return $this->container;
}

/**
* {@inheritDoc}
*/
public function loadPlugin(string $applicationPluginClass): void
{
if (\in_array($applicationPluginClass, $this->pluginsLoaded, true)) {
Expand All @@ -105,9 +96,6 @@ public function loadPlugin(string $applicationPluginClass): void
$this->pluginsLoaded[] = $applicationPluginClass;
}

/**
* {@inheritDoc}
*/
public function plugins(string $interfaceInherited = null): \Traversable
{
foreach ($this->plugins as $plugin) {
Expand Down
1 change: 0 additions & 1 deletion src/KernelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public function loadPlugin(string $applicationPluginClass): void;
* @template T of object
*
* @psalm-param class-string<T>|null $interfaceInherited if empty, each connected plugin will be iterated

*
* @return \Traversable<T|object> Application plugins iterator
*
Expand Down