Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"

- name: "Run tests"
run: "./vendor/bin/phpunit"
- name: "RUn tests"
run: "composer coverage-html"
24 changes: 2 additions & 22 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,5 @@ jobs:
- name: Download dependencies
uses: ramsey/composer-install@v2

- name: PHP_CodeSniffer
run: ./vendor/bin/phpcs --standard=phpcs.xml ./src/

phpmd:
name: Mess Detector
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
tools: phpmd/phpmd:^2.13

- name: Download dependencies
uses: ramsey/composer-install@v2

- name: Mess Detector
run: ./vendor/bin/phpmd ./src/ github ./phpmd.xml
- name: Testing
run: composer statics
9 changes: 7 additions & 2 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
vendor/
.idea
vendor
composer.lock
.phpunit.result.cache
test-coverage-report/
.php-cs-fixer.cache
test-coverage-report
phpunit.xml
.php-cs-fixer.php
phpstan.neon
30 changes: 30 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

if (!file_exists(__DIR__.'/src')) {
exit(0);
}

$finder = (new PhpCsFixer\Finder())
->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,
'header_comment' => [
'header' => <<<EOF
This file is part of the Micro framework package.

(c) Stanislau Komar <kost@micro-php.net>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF
]
))
->setRiskyAllowed(true)
->setFinder($finder);
37 changes: 31 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.29",
"phpmd/phpmd": "^2.13",
"friendsofphp/php-cs-fixer": "^3.13",
"phpstan/phpstan": "^1.9",
"phpunit/php-code-coverage": "^9.2",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.7"
},
"conflict": {
"micro/autowire": "<1.1"
"vimeo/psalm": "^5.2"
},
"suggest": {
"micro/autowire": "Autowire helper for dependency injection"
Expand All @@ -30,14 +29,40 @@
"Micro\\Component\\DependencyInjection\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Micro\\Component\\DependencyInjection\\Tests\\Unit\\": "tests/Unit/"
}
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
}
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"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",
"statics": [
"@phpstan",
"@psalm",
"@php-cs-try"
],
"test": [
"@statics",
"composer validate --strict",
"composer normalize",
"@coverage"
]
}
}
63 changes: 0 additions & 63 deletions phpcs.xml

This file was deleted.

14 changes: 0 additions & 14 deletions phpmd.xml

This file was deleted.

4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 7
paths:
- src
4 changes: 2 additions & 2 deletions phpunit.xml → phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
</coverage>
<testsuites>
<testsuite name="Micro Component: Dependency Injection Unit Test Suite">
<directory>tests/unit</directory>
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_ENV" value="dev-test"/>
</php>
</phpunit>
22 changes: 22 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<InvalidDocblock>
<errorLevel type="info">
<file name="src/Container.php" />
</errorLevel>
</InvalidDocblock>
</issueHandlers>
</psalm>
Loading