-
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.
Merge pull request #2 from Micro-PHP/1.6.0
v1.6.0 released
- Loading branch information
Showing
41 changed files
with
887 additions
and
649 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,9 @@ | ||
/.github export-ignore | ||
/tests export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.php-cs-fixer.dist.php export-ignore | ||
/psalm.xml export-ignore | ||
|
||
*.php diff=php |
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,2 @@ | ||
[{*.yaml,*.yml}] | ||
indent_size = 2 |
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,58 @@ | ||
name: Plugin CI | ||
on: | ||
push: | ||
branches: [ 'master' ] | ||
pull_request: | ||
|
||
env: | ||
PHP_CS_FIXER_IGNORE_ENV: 1 | ||
XDEBUG_MODE: coverage | ||
|
||
jobs: | ||
tests: | ||
name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}" | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# normal, highest, non-dev installs | ||
php-version: [ '8.2' ] | ||
dependency-versions: [ 'highest' ] | ||
include: | ||
# testing lowest PHP version with the lowest dependencies | ||
# - php-version: '8.2' | ||
# dependency-versions: 'lowest' | ||
|
||
# testing dev versions with the highest PHP | ||
- php-version: '8.2' | ||
dependency-versions: 'highest' | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Composer install" | ||
uses: "ramsey/composer-install@v2" | ||
with: | ||
dependency-versions: "${{ matrix.dependency-versions }}" | ||
composer-options: "--prefer-dist --no-progress" | ||
|
||
- name: Run tests | ||
run: composer run test | ||
|
||
- name: Coverage report | ||
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover coverage.xml | ||
|
||
- name: Upload coverage reports to Codecov | ||
run: | | ||
# Replace `linux` below with the appropriate OS | ||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||
chmod +x codecov | ||
./codecov -t ${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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
vendor/ | ||
.idea | ||
vendor | ||
composer.lock | ||
.phpunit.result.cache | ||
.php-cs-fixer.cache | ||
test-coverage-report | ||
phpunit.xml | ||
coverage/ | ||
.php-cs-fixer.php | ||
phpstan.neon |
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,67 @@ | ||
<?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, | ||
'array_indentation' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'combine_consecutive_unsets' => true, | ||
'declare_strict_types' => true, | ||
'dir_constant' => true, | ||
'fully_qualified_strict_types' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'mb_str_functions' => true, | ||
'modernize_types_casting' => true, | ||
'no_alternative_syntax' => true, | ||
'no_null_property_initialization' => true, | ||
'no_php4_constructor' => true, | ||
'no_superfluous_elseif' => true, | ||
'no_unreachable_default_argument_value' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_to_comment' => false, | ||
'phpdoc_types_order' => [ | ||
'null_adjustment' => 'always_last', | ||
'sort_algorithm' => 'none' | ||
], | ||
'php_unit_set_up_tear_down_visibility' => true, | ||
'pow_to_exponentiation' => true, | ||
'semicolon_after_instruction' => true, | ||
'ternary_to_null_coalescing' => true, | ||
'method_argument_space' => [ | ||
'keep_multiple_spaces_after_comma' => true, | ||
'on_multiline' => 'ensure_fully_multiline', | ||
'after_heredoc' => true, | ||
], | ||
'phpdoc_annotation_without_dot' => false, | ||
'phpdoc_var_without_name' => false, | ||
'phpdoc_trim' => true, | ||
'no_superfluous_phpdoc_tags' => false, | ||
'single_line_throw' => true, | ||
'header_comment' => [ | ||
'header' => <<<EOF | ||
This file is part of the Micro framework package. | ||
(c) Stanislau Komar <[email protected]> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF | ||
] | ||
)) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder); |
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,3 @@ | ||
# Micro Framework | ||
|
||
Documentation is available [here](https://micro-php.net/docs). If not, we will be grateful if you can become its author :) |
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 |
---|---|---|
@@ -1,21 +1,60 @@ | ||
{ | ||
"name": "micro/plugin-redis", | ||
"description": "Micro Framework: Redis component", | ||
"type": "library", | ||
"license": "MIT", | ||
"version": "1.0", | ||
"autoload": { | ||
"psr-4": { | ||
"Micro\\Plugin\\Redis\\": "src/" | ||
} | ||
}, | ||
"type": "micro-plugin", | ||
"authors": [ | ||
{ | ||
"name": "Stanislau.Komar", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"micro/kernel": "^1" | ||
"ext-redis": "*", | ||
"micro/kernel-app": "^1.6" | ||
}, | ||
"require-dev": { | ||
"ergebnis/composer-normalize": "^2.29", | ||
"friendsofphp/php-cs-fixer": "^3.13", | ||
"phpstan/phpstan": "^1.9", | ||
"phpunit/php-code-coverage": "^9.2", | ||
"phpunit/phpunit": "^9.5", | ||
"vimeo/psalm": "^5.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Micro\\Plugin\\Redis\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Micro\\Plugin\\Cache\\Test\\Unit\\": "tests/Unit" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"ergebnis/composer-normalize": true | ||
}, | ||
"sort-packages": true | ||
}, | ||
"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 --no-cache", | ||
"statics": [ | ||
"@phpstan", | ||
"@psalm", | ||
"@php-cs-try" | ||
], | ||
"test": [ | ||
"@statics", | ||
"composer validate --strict", | ||
"composer normalize", | ||
"@coverage" | ||
] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parameters: | ||
level: 7 | ||
paths: | ||
- src |
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,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- https://phpunit.readthedocs.io/en/9.5/configuration.html#the-phpunit-element --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" | ||
backupGlobals="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
> | ||
<php> | ||
<ini name="error_reporting" value="-1" force="true"/> | ||
</php> | ||
<testsuites> | ||
<testsuite name="Unit tests"> | ||
<directory>tests/Unit</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
<report> | ||
<html outputDirectory="test-coverage-report/" /> | ||
</report> | ||
</coverage> | ||
|
||
<logging> | ||
<log type="coverage-clover" target="coverage/clover.xml"/> | ||
</logging> | ||
|
||
</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,29 @@ | ||
<?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> | ||
<MissingConstructor> | ||
<errorLevel type="info"> | ||
<file name="src/RedisPlugin.php" /> | ||
</errorLevel> | ||
</MissingConstructor> | ||
<ImplementedReturnTypeMismatch> | ||
<errorLevel type="info"> | ||
<file name="src/RedisPlugin.php" /> | ||
</errorLevel> | ||
</ImplementedReturnTypeMismatch> | ||
</issueHandlers> | ||
|
||
</psalm> |
Oops, something went wrong.