Skip to content

Commit c2b1fc7

Browse files
authored
v1.6.0 released (#7)
* v1.6.0 released * Fix guthub actions
1 parent 5764cfe commit c2b1fc7

16 files changed

+230
-167
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ jobs:
4040
dependency-versions: "${{ matrix.dependency-versions }}"
4141
composer-options: "--prefer-dist --no-progress"
4242

43-
- name: "Run tests"
44-
run: "./vendor/bin/phpunit"
43+
- name: "RUn tests"
44+
run: "composer coverage-html"

.github/workflows/static.yaml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,5 @@ jobs:
4141
- name: Download dependencies
4242
uses: ramsey/composer-install@v2
4343

44-
- name: PHP_CodeSniffer
45-
run: ./vendor/bin/phpcs --standard=phpcs.xml ./src/
46-
47-
phpmd:
48-
name: Mess Detector
49-
runs-on: ubuntu-22.04
50-
steps:
51-
- name: Checkout code
52-
uses: actions/checkout@v2
53-
54-
- name: Setup PHP
55-
uses: shivammathur/setup-php@v2
56-
with:
57-
php-version: 8.2
58-
coverage: none
59-
tools: phpmd/phpmd:^2.13
60-
61-
- name: Download dependencies
62-
uses: ramsey/composer-install@v2
63-
64-
- name: Mess Detector
65-
run: ./vendor/bin/phpmd ./src/ github ./phpmd.xml
44+
- name: Testing
45+
run: composer statics

.gitignore

100755100644
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
vendor/
1+
.idea
2+
vendor
23
composer.lock
34
.phpunit.result.cache
4-
test-coverage-report/
5+
.php-cs-fixer.cache
6+
test-coverage-report
7+
phpunit.xml
8+
.php-cs-fixer.php
9+
phpstan.neon

.php-cs-fixer.dist.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
if (!file_exists(__DIR__.'/src')) {
4+
exit(0);
5+
}
6+
7+
$finder = (new PhpCsFixer\Finder())
8+
->in(__DIR__.'/src')
9+
->in(__DIR__.'/tests')
10+
;
11+
12+
return (new PhpCsFixer\Config())
13+
->setRules(array(
14+
'@Symfony' => true,
15+
'@Symfony:risky' => true,
16+
'protected_to_private' => false,
17+
'semicolon_after_instruction' => false,
18+
'header_comment' => [
19+
'header' => <<<EOF
20+
This file is part of the Micro framework package.
21+
22+
(c) Stanislau Komar <kost@micro-php.net>
23+
24+
For the full copyright and license information, please view the LICENSE
25+
file that was distributed with this source code.
26+
EOF
27+
]
28+
))
29+
->setRiskyAllowed(true)
30+
->setFinder($finder);

composer.json

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
},
1616
"require-dev": {
1717
"ergebnis/composer-normalize": "^2.29",
18-
"phpmd/phpmd": "^2.13",
18+
"friendsofphp/php-cs-fixer": "^3.13",
19+
"phpstan/phpstan": "^1.9",
20+
"phpunit/php-code-coverage": "^9.2",
1921
"phpunit/phpunit": "^9.5",
20-
"squizlabs/php_codesniffer": "^3.7"
21-
},
22-
"conflict": {
23-
"micro/autowire": "<1.1"
22+
"vimeo/psalm": "^5.2"
2423
},
2524
"suggest": {
2625
"micro/autowire": "Autowire helper for dependency injection"
@@ -30,14 +29,40 @@
3029
"Micro\\Component\\DependencyInjection\\": "src/"
3130
}
3231
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"Micro\\Component\\DependencyInjection\\Tests\\Unit\\": "tests/Unit/"
35+
}
36+
},
3337
"config": {
3438
"allow-plugins": {
3539
"ergebnis/composer-normalize": true
36-
}
40+
},
41+
"sort-packages": true
3742
},
3843
"extra": {
3944
"branch-alias": {
4045
"dev-master": "1.x-dev"
4146
}
47+
},
48+
"scripts": {
49+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text",
50+
"coverage-html": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html ./test-coverage-report",
51+
"php-cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --using-cache=no",
52+
"php-cs-try": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no",
53+
"phpstan": "./vendor/bin/phpstan analyze --no-progress",
54+
"phpunit": "./vendor/bin/phpunit",
55+
"psalm": "./vendor/bin/psalm --no-progress --show-info=true",
56+
"statics": [
57+
"@phpstan",
58+
"@psalm",
59+
"@php-cs-try"
60+
],
61+
"test": [
62+
"@statics",
63+
"composer validate --strict",
64+
"composer normalize",
65+
"@coverage"
66+
]
4267
}
4368
}

phpcs.xml

Lines changed: 0 additions & 63 deletions
This file was deleted.

phpmd.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 7
3+
paths:
4+
- src

phpunit.xml renamed to phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
</coverage>
1818
<testsuites>
1919
<testsuite name="Micro Component: Dependency Injection Unit Test Suite">
20-
<directory>tests/unit</directory>
20+
<directory>tests/Unit</directory>
2121
</testsuite>
2222
</testsuites>
2323
<php>
24-
<env name="APP_ENV" value="testing"/>
24+
<env name="APP_ENV" value="dev-test"/>
2525
</php>
2626
</phpunit>

psalm.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="2"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
<issueHandlers>
16+
<InvalidDocblock>
17+
<errorLevel type="info">
18+
<file name="src/Container.php" />
19+
</errorLevel>
20+
</InvalidDocblock>
21+
</issueHandlers>
22+
</psalm>

0 commit comments

Comments
 (0)