-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from dotkernel/issue-12
Issue #12: Code quality
- Loading branch information
Showing
52 changed files
with
2,269 additions
and
872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
on: | ||
- push | ||
|
||
name: Run phpcs checks | ||
|
||
jobs: | ||
mutation: | ||
name: PHP ${{ matrix.php }}-${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
|
||
php: | ||
- "8.1" | ||
- "8.2" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
tools: composer:v2, cs2pr | ||
coverage: none | ||
|
||
- name: Determine composer cache directory | ||
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | ||
|
||
- name: Cache dependencies installed with composer | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
php${{ matrix.php }}-composer- | ||
- name: Install dependencies with composer | ||
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
|
||
- name: Run phpcs checks | ||
run: vendor/bin/phpcs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
on: | ||
- push | ||
|
||
name: Run static analysis | ||
|
||
jobs: | ||
mutation: | ||
name: PHP ${{ matrix.php }}-${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
|
||
php: | ||
- "8.1" | ||
- "8.2" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
tools: composer:v2, cs2pr | ||
coverage: none | ||
|
||
- name: Determine composer cache directory | ||
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | ||
|
||
- name: Cache dependencies installed with composer | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
php${{ matrix.php }}-composer- | ||
- name: Install dependencies with composer | ||
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
|
||
- name: Run static analysis | ||
run: vendor/bin/psalm --no-cache --output-format=github --show-info=false --threads=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
on: | ||
- push | ||
|
||
name: Run PHPUnit tests | ||
|
||
jobs: | ||
mutation: | ||
name: PHP ${{ matrix.php }}-${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
|
||
php: | ||
- "8.1" | ||
- "8.2" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
tools: composer:v2, cs2pr | ||
coverage: none | ||
|
||
- name: Determine composer cache directory | ||
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV | ||
|
||
- name: Cache dependencies installed with composer | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
php${{ matrix.php }}-composer- | ||
- name: Install dependencies with composer | ||
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi | ||
|
||
- name: Run PHPUnit tests | ||
run: vendor/bin/phpunit --colors=always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,20 +17,26 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
}, | ||
"require": { | ||
"php": "^7.4 || ~8.0.0 || ~8.1.0", | ||
"psr/http-message": "^1.0.1", | ||
"psr/http-server-middleware": "^1.0.1", | ||
"laminas/laminas-servicemanager": "^3.11.2", | ||
"php": "~8.1.0 || ~8.2.0", | ||
"dotkernel/dot-authorization": "^3.1.0", | ||
"dotkernel/dot-helpers": "^3.2.0", | ||
"laminas/laminas-escaper": "^2.10.0", | ||
"laminas/laminas-servicemanager": "^3.11.2", | ||
"mezzio/mezzio-template": "^2.4.0", | ||
"dotkernel/dot-helpers": "^3.2.0" | ||
"psr/http-message": "^1.0.1", | ||
"psr/http-server-middleware": "^1.0.1" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.5.20", | ||
"squizlabs/php_codesniffer": "^3.6.2", | ||
"laminas/laminas-stdlib": "^3.7.1", | ||
"dotkernel/dot-authorization": "^3.1.0" | ||
"laminas/laminas-coding-standard": "^2.5", | ||
"phpunit/phpunit": "^10.2", | ||
"vimeo/psalm": "^5.13" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
@@ -41,5 +47,16 @@ | |
"psr-4": { | ||
"DotTest\\Navigation\\": "test/" | ||
} | ||
}, | ||
"scripts": { | ||
"check": [ | ||
"@cs-check", | ||
"@test" | ||
], | ||
"cs-check": "phpcs", | ||
"cs-fix": "phpcbf", | ||
"test": "phpunit --colors=always", | ||
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml", | ||
"static-analysis": "psalm --shepherd --stats" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> | ||
|
||
<arg name="basepath" value="."/> | ||
<arg name="cache" value=".phpcs-cache"/> | ||
<arg name="colors"/> | ||
<arg name="extensions" value="php"/> | ||
<arg name="parallel" value="80"/> | ||
|
||
<!-- Show progress --> | ||
<arg value="p"/> | ||
|
||
<!-- Paths to check --> | ||
<file>src</file> | ||
<file>test</file> | ||
|
||
<!-- Include all rules from the Laminas Coding Standard --> | ||
<rule ref="LaminasCodingStandard"/> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" | ||
bootstrap="./vendor/autoload.php" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="Dot-Navigation Test Suite"> | ||
<directory>./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage/> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015"> | ||
<file src="src/Filter/IsAllowedFilter.php"> | ||
<MissingTemplateParam> | ||
<code>IsAllowedFilter</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/NavigationContainer.php"> | ||
<MissingTemplateParam> | ||
<code>RecursiveIterator</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Provider/ProviderPluginManager.php"> | ||
<MissingTemplateParam> | ||
<code>ProviderPluginManager</code> | ||
</MissingTemplateParam> | ||
</file> | ||
</files> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="4" | ||
resolveFromConfigFile="true" | ||
findUnusedCode="false" | ||
findUnusedBaselineEntry="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" | ||
errorBaseline="psalm-baseline.xml" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
</psalm> |
Oops, something went wrong.