-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ecf7055
Showing
18 changed files
with
530 additions
and
0 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,41 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup PHP with PECL extension | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Tests with code coverage | ||
run: composer coverage-xml | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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,51 @@ | ||
name: code-quality | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup PHP with PECL extension | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Tests quality - infection | ||
run: composer quality:infection | ||
|
||
- name: Code quality - phpcs | ||
run: composer quality:phpcs | ||
|
||
- name: Code quality - phpstan | ||
run: composer quality:phpstan | ||
|
||
- name: Code quality - psalm | ||
run: composer quality:psalm | ||
|
||
- name: Code quality - phan | ||
run: composer quality:phan-silent | ||
|
||
- name: Code quality - phpmd | ||
run: composer quality:phpmd |
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,5 @@ | ||
/.idea/ | ||
/vendor/ | ||
/doc/ | ||
/tmp/ | ||
composer.lock |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Ingenioz IT | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,33 @@ | ||
# Clock | ||
|
||
A [PSR 20](https://www.php-fig.org/psr/psr-20/) Clock implementation. | ||
|
||
Provides : | ||
- A system clock | ||
- A "frozen" clock that can be used for mocking tests | ||
|
||
## About | ||
|
||
| Info | Value | | ||
|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| Latest release | [![Packagist Version](https://img.shields.io/packagist/v/ingenioz-it/clock)](https://packagist.org/packages/ingenioz-it/clock) | | ||
| Requires | ![PHP from Packagist](https://img.shields.io/packagist/php-v/ingenioz-it/clock.svg) | | ||
| License | ![Packagist](https://img.shields.io/packagist/l/ingenioz-it/clock) | | ||
| Unit tests | [![tests](https://github.com/IngeniozIT/psr-clock/actions/workflows/1-tests.yml/badge.svg)](https://github.com/IngeniozIT/psr-clock/actions/workflows/1-tests.yml) | | ||
| Code coverage | [![Code Coverage](https://codecov.io/gh/IngeniozIT/psr-clock/branch/master/graph/badge.svg)](https://codecov.io/gh/IngeniozIT/psr-clock) | | ||
| Code quality | [![code-quality](https://github.com/IngeniozIT/psr-clock/actions/workflows/2-code-quality.yml/badge.svg)](https://github.com/IngeniozIT/psr-clock/actions/workflows/2-code-quality.yml) | | ||
| Quality tested with | [phpunit](https://github.com/sebastianbergmann/phpunit), [phan](https://github.com/phan/phan), [psalm](https://github.com/vimeo/psalm), [phpcs](https://github.com/squizlabs/PHP_CodeSniffer), [phpstan](https://github.com/phpstan/phpstan), [phpmd](https://github.com/phpmd/phpmd), [infection](https://github.com/infection/infection) | | ||
|
||
## Installation | ||
|
||
```sh | ||
composer require ingenioz-it/clock | ||
``` | ||
|
||
## Full documentation | ||
|
||
You can list the available features by running | ||
|
||
```sh | ||
composer testdox | ||
``` |
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,86 @@ | ||
{ | ||
"name": "ingenioz-it/clock", | ||
"type": "library", | ||
"description": "A PSR clock", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "IngeniozIT", | ||
"email": "contact@ingenioz.it" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"require": { | ||
"php": ">=8.2", | ||
"psr/clock": "^1.0" | ||
}, | ||
"provide": { | ||
"psr/clock-implementation": "1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "*", | ||
"squizlabs/php_codesniffer": "*", | ||
"phpstan/phpstan": "*", | ||
"vimeo/psalm": "*", | ||
"phan/phan": "*", | ||
"infection/infection": "*", | ||
"phpmd/phpmd": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"IngeniozIT\\Clock\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"IngeniozIT\\Clock\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "vendor/bin/phpunit -c ./quality/phpunit.xml.dist", | ||
"testdox": "@test --testdox", | ||
"test-xdebug": "XDEBUG_MODE=coverage vendor/bin/phpunit -c ./quality/phpunit.xml.dist", | ||
"coverage-html": "@test-xdebug --coverage-html ./doc", | ||
"coverage-xml": "@test-xdebug --coverage-clover ./tmp/coverage.xml", | ||
"quality:clean": "vendor/bin/phpcbf --standard=./quality/phpcs.xml.dist", | ||
"quality:phpcs": "vendor/bin/phpcs --standard=./quality/phpcs.xml.dist", | ||
"quality:phpstan": "vendor/bin/phpstan analyze -c ./quality/phpstan.neon.dist", | ||
"quality:psalm": "vendor/bin/psalm --no-cache --config ./quality/psalm.xml.dist", | ||
"quality:phan": "vendor/bin/phan --config-file ./quality/phan.php", | ||
"quality:phan-silent": "vendor/bin/phan --no-progress-bar --config-file ./quality/phan.php", | ||
"quality:infection": "vendor/bin/infection --configuration=./quality/infection.json.dist", | ||
"quality:phpmd": "vendor/bin/phpmd src/,tests/ text quality/phpmd.xml.dist", | ||
"fulltest": [ | ||
"@test", | ||
"@quality:infection", | ||
"@quality:phpcs", | ||
"@quality:phpmd", | ||
"@quality:phpstan", | ||
"@quality:psalm", | ||
"@quality:phan", | ||
"echo 'OK'" | ||
] | ||
}, | ||
"scripts-descriptions": { | ||
"test": "Run unit tests", | ||
"testdox": "Run unit tests with testdox output", | ||
"test-xdebug": "Run unit tests with Xdebug enabled", | ||
"coverage-html": "Generate HTML code coverage report", | ||
"coverage-xml": "Generate XML code coverage report", | ||
"quality:clean": "Clean code with PHP Code Beautifier and Fixer", | ||
"quality:phpcs": "Run PHP Code Sniffer", | ||
"quality:phpstan": "Run PHPStan", | ||
"quality:psalm": "Run Psalm", | ||
"quality:phan": "Run Phan", | ||
"quality:phan-silent": "Run Phan without progress bar", | ||
"quality:infection": "Run Infection", | ||
"fulltest": "Run all tests", | ||
"quality:phpmd": "Run PHP Mess Detector" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"infection/extension-installer": true | ||
} | ||
} | ||
} |
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 @@ | ||
<h1>The PHP skeleton is alive !</h1> |
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,15 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/infection/infection/0.26.1/resources/schema.json", | ||
"source": { | ||
"directories": [ | ||
"./src" | ||
] | ||
}, | ||
"logs": { | ||
"text": "./tmp/infection.txt", | ||
"html": "./tmp/infection.html" | ||
}, | ||
"mutators": { | ||
"@default": true | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
return [ | ||
'target_php_version' => '8.2', | ||
'directory_list' => [ | ||
'src/', | ||
'tests/', | ||
'vendor/', | ||
], | ||
'exclude_analysis_directory_list' => [ | ||
'vendor/', | ||
], | ||
'plugins' => [ | ||
'AlwaysReturnPlugin', | ||
'DuplicateArrayKeyPlugin', | ||
'PregRegexCheckerPlugin', | ||
'PrintfCheckerPlugin', | ||
'UnreachableCodePlugin', | ||
'InvokePHPNativeSyntaxCheckPlugin', | ||
'PHPUnitAssertionPlugin', | ||
'EmptyStatementListPlugin', | ||
'LoopVariableReusePlugin', | ||
'RedundantAssignmentPlugin', | ||
'PHPUnitNotDeadCodePlugin', | ||
'WhitespacePlugin', | ||
'PHPDocRedundantPlugin', | ||
], | ||
'plugin_config' => [ | ||
'php_native_syntax_check_max_processes' => 4, | ||
], | ||
'suppress_issue_types' => [ | ||
], | ||
]; |
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,16 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="PSR Standard"> | ||
<file>../src</file> | ||
<file>../tests</file> | ||
|
||
<arg name="basepath" value=".."/> | ||
<arg name="colors"/> | ||
<arg name="parallel" value="75"/> | ||
<arg value="np"/> | ||
|
||
<rule ref="Internal.Tokenizer.Exception"> | ||
<type>error</type> | ||
</rule> | ||
|
||
<rule ref="PSR12"/> | ||
</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,18 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="My first PHPMD rule set" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 | ||
http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
> | ||
<description> | ||
All default rulesets from PHPMD. | ||
</description> | ||
<rule ref="rulesets/codesize.xml" /> | ||
<rule ref="rulesets/cleancode.xml" /> | ||
<rule ref="rulesets/controversial.xml" /> | ||
<rule ref="rulesets/design.xml" /> | ||
<rule ref="rulesets/naming.xml" /> | ||
<rule ref="rulesets/unusedcode.xml" /> | ||
</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,6 @@ | ||
parameters: | ||
level: max | ||
paths: | ||
- ../src | ||
- ../tests | ||
ignoreErrors: |
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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" | ||
cacheDirectory="../tmp/.phpunit.cache" | ||
bootstrap="../vendor/autoload.php" | ||
backupGlobals="false" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
backupStaticProperties="false" | ||
> | ||
<coverage/> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix=".php">../tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<logging/> | ||
<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,26 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="1" | ||
resolveFromConfigFile="true" | ||
strictBinaryOperands="true" | ||
checkForThrowsDocblock="true" | ||
ignoreInternalFunctionNullReturn="true" | ||
findUnusedVariablesAndParams="true" | ||
findUnusedPsalmSuppress="true" | ||
ensureArrayStringOffsetsExist="true" | ||
findUnusedBaselineEntry="true" | ||
findUnusedCode="true" | ||
sealAllProperties="true" | ||
runTaintAnalysis="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" /> | ||
<directory name="../tests" /> | ||
</projectFiles> | ||
<extraFiles> | ||
<directory name="../vendor" /> | ||
</extraFiles> | ||
</psalm> |
Oops, something went wrong.