Skip to content

Commit 70a4e4a

Browse files
committed
Chore: Added dev-tools library
- Added micro/dev-tools library; - Refactored composer commands; - Run php-cs-fixer; - CI/CD improvements;
1 parent 56938c9 commit 70a4e4a

File tree

4 files changed

+30
-33
lines changed

4 files changed

+30
-33
lines changed

Diff for: .github/workflows/ci.yaml

+18-10
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,28 @@ jobs:
2929
dependency-versions: 'highest'
3030

3131
steps:
32-
- name: "Checkout code"
33-
uses: "actions/checkout@v2"
32+
- name: Checkout code
33+
uses: actions/checkout@v2
3434

35-
- name: "Install PHP"
36-
uses: "shivammathur/setup-php@v2"
35+
- name: Install PHP
36+
uses: shivammathur/setup-php@v2
3737
with:
38-
coverage: "none"
39-
php-version: "${{ matrix.php-version }}"
38+
coverage: none
39+
php-version: ${{ matrix.php-version }}
4040

41-
- name: "Composer install"
42-
uses: "ramsey/composer-install@v2"
41+
- name: Composer install
42+
uses: ramsey/composer-install@v2
4343
with:
44-
dependency-versions: "${{ matrix.dependency-versions }}"
45-
composer-options: "--prefer-dist --no-progress"
44+
dependency-versions: ${{ matrix.dependency-versions }}
45+
composer-options: --prefer-dist --no-progress
46+
47+
- name: Test tools install
48+
run: |
49+
cd vendor/micro/dev-tools/tools/psalm; composer install; cd ../../../../..;
50+
cd vendor/micro/dev-tools/tools/phpstan; composer install; cd ../../../../..;
51+
cd vendor/micro/dev-tools/tools/php-cs-fixer; composer install; cd ../../../../..;
52+
cd vendor/micro/dev-tools/tools/phpcs; composer install; cd ../../../../..;
53+
cd vendor/micro/dev-tools/tools/phpmd; composer install; cd ../../../../..;
4654
4755
- name: Run tests
4856
run: composer run test

Diff for: composer.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
"micro/dependency-injection": "^1.6"
1515
},
1616
"require-dev": {
17-
"ergebnis/composer-normalize": "^2.29",
18-
"friendsofphp/php-cs-fixer": "^3.13",
19-
"phpstan/phpstan": "^1.9",
20-
"phpunit/php-code-coverage": "^9.2",
21-
"phpunit/phpunit": "^9.5",
22-
"vimeo/psalm": "^5.2"
17+
"micro/dev-tools": "dev-feature/library-created"
2318
},
19+
"repositories": [
20+
{
21+
"type": "vcs",
22+
"url": "[email protected]:Micro-PHP/dev-tools.git"
23+
}
24+
],
25+
"minimum-stability": "dev",
2426
"autoload": {
2527
"psr-4": {
2628
"Micro\\Framework\\Kernel\\": "src/"
@@ -40,11 +42,11 @@
4042
"scripts": {
4143
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text",
4244
"coverage-html": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html ./test-coverage-report",
43-
"php-cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --using-cache=no",
44-
"php-cs-try": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no",
45-
"phpstan": "./vendor/bin/phpstan analyze --no-progress",
4645
"phpunit": "./vendor/bin/phpunit",
47-
"psalm": "./vendor/bin/psalm --no-progress --show-info=true --no-cache",
46+
"php-cs-fix": "./vendor/micro/dev-tools/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --verbose --using-cache=no",
47+
"php-cs-try": "./vendor/micro/dev-tools/tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no",
48+
"phpstan": "./vendor/micro/dev-tools/tools/phpstan/vendor/bin/phpstan analyze --no-progress",
49+
"psalm": "./vendor/micro/dev-tools/tools/psalm/vendor/bin/psalm --no-progress --show-info=true --no-cache",
4850
"statics": [
4951
"@phpstan",
5052
"@psalm",

Diff for: src/Kernel.php

-12
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ public function setBootLoaders(iterable $bootLoaders): self
6565
return $this;
6666
}
6767

68-
/**
69-
* {@inheritDoc}
70-
*/
7168
public function run(): void
7269
{
7370
if ($this->isStarted) {
@@ -78,17 +75,11 @@ public function run(): void
7875
$this->isStarted = true;
7976
}
8077

81-
/**
82-
* {@inheritDoc}
83-
*/
8478
public function container(): Container
8579
{
8680
return $this->container;
8781
}
8882

89-
/**
90-
* {@inheritDoc}
91-
*/
9283
public function loadPlugin(string $applicationPluginClass): void
9384
{
9485
if (\in_array($applicationPluginClass, $this->pluginsLoaded, true)) {
@@ -105,9 +96,6 @@ public function loadPlugin(string $applicationPluginClass): void
10596
$this->pluginsLoaded[] = $applicationPluginClass;
10697
}
10798

108-
/**
109-
* {@inheritDoc}
110-
*/
11199
public function plugins(string $interfaceInherited = null): \Traversable
112100
{
113101
foreach ($this->plugins as $plugin) {

Diff for: src/KernelInterface.php

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public function loadPlugin(string $applicationPluginClass): void;
5656
* @template T of object
5757
*
5858
* @psalm-param class-string<T>|null $interfaceInherited if empty, each connected plugin will be iterated
59-
6059
*
6160
* @return \Traversable<T|object> Application plugins iterator
6261
*

0 commit comments

Comments
 (0)