Skip to content

Commit 3387ea0

Browse files
authored
Merge pull request #3 from Micro-PHP/v1.6.0-release
v1.6.0 released
2 parents 324c519 + 9f7b2ca commit 3387ea0

18 files changed

+398
-91
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.github export-ignore
2+
/tests export-ignore
3+
/phpunit.xml.dist export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.php-cs-fixer.dist.php export-ignore
7+
/psalm.xml export-ignore
8+
9+
*.php diff=php

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[{*.yaml,*.yml}]
2+
indent_size = 2

.github/workflows/ci.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Plugin CI
2+
on:
3+
push:
4+
branches: [ 'master' ]
5+
pull_request:
6+
7+
env:
8+
PHP_CS_FIXER_IGNORE_ENV: 1
9+
XDEBUG_MODE: coverage
10+
11+
jobs:
12+
tests:
13+
name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}"
14+
runs-on: ubuntu-22.04
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
# normal, highest, non-dev installs
20+
php-version: [ '8.2' ]
21+
dependency-versions: [ 'highest' ]
22+
include:
23+
# testing lowest PHP version with the lowest dependencies
24+
# - php-version: '8.2'
25+
# dependency-versions: 'lowest'
26+
27+
# testing dev versions with the highest PHP
28+
- php-version: '8.2'
29+
dependency-versions: 'highest'
30+
31+
steps:
32+
- name: "Checkout code"
33+
uses: "actions/checkout@v2"
34+
35+
- name: "Install PHP"
36+
uses: "shivammathur/setup-php@v2"
37+
with:
38+
coverage: "none"
39+
php-version: "${{ matrix.php-version }}"
40+
41+
- name: "Composer install"
42+
uses: "ramsey/composer-install@v2"
43+
with:
44+
dependency-versions: "${{ matrix.dependency-versions }}"
45+
composer-options: "--prefer-dist --no-progress"
46+
47+
- name: Run tests
48+
run: composer run test
49+
50+
- name: Coverage report
51+
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover coverage.xml
52+
53+
- name: Upload coverage reports to Codecov
54+
run: |
55+
# Replace `linux` below with the appropriate OS
56+
curl -Os https://uploader.codecov.io/latest/linux/codecov
57+
chmod +x codecov
58+
./codecov -t ${CODECOV_TOKEN}

.gitignore

100755100644
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
.phpdoc/
2-
docs/
3-
vendor/
1+
.idea
2+
vendor
43
composer.lock
54
.phpunit.result.cache
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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress']],
19+
'header_comment' => [
20+
'header' => <<<EOF
21+
This file is part of the Micro framework package.
22+
23+
(c) Stanislau Komar <kost@micro-php.net>
24+
25+
For the full copyright and license information, please view the LICENSE
26+
file that was distributed with this source code.
27+
EOF
28+
]
29+
))
30+
->setRiskyAllowed(true)
31+
->setFinder($finder);

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Komar Stanislau
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Micro Framework - The minimum kernel for application initialization.
2+
3+
Documentation is available [here](https://micro-php.net/docs). If not, we will be grateful if you can become its author :)

composer.json

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,60 @@
11
{
22
"name": "micro/kernel-boot-dependency",
33
"description": "Micro Framework: Kernel Boot loader - component to provide dependencies",
4-
"type": "library",
5-
"version": "1.1",
4+
"license": "MIT",
5+
"type": "micro-plugin",
6+
"authors": [
7+
{
8+
"name": "Stanislau Komar",
9+
"email": "stanislau_komar@epam.com"
10+
}
11+
],
612
"require": {
7-
"micro/kernel": "^1",
8-
"micro/autowire": "^1"
13+
"micro/autowire": "^1.6",
14+
"micro/kernel": "^1.6"
915
},
1016
"require-dev": {
11-
"phpunit/phpunit": "^9"
17+
"ergebnis/composer-normalize": "^2.29",
18+
"friendsofphp/php-cs-fixer": "^3.13",
19+
"phpstan/phpstan": "^1.9",
20+
"phpunit/php-code-coverage": "^9.2",
21+
"phpunit/phpunit": "^9.5",
22+
"vimeo/psalm": "^5.2"
1223
},
13-
"license": "MIT",
1424
"autoload": {
1525
"psr-4": {
1626
"Micro\\Framework\\Kernel\\": "src/"
1727
}
1828
},
19-
"authors": [
20-
{
21-
"name": "Stanislau Komar",
22-
"email": "stanislau_komar@epam.com"
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Micro\\Framework\\Kernel\\Test\\Unit\\": "tests/Unit"
2332
}
24-
]
33+
},
34+
"config": {
35+
"allow-plugins": {
36+
"ergebnis/composer-normalize": true
37+
},
38+
"sort-packages": true
39+
},
40+
"scripts": {
41+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text",
42+
"coverage-html": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html ./test-coverage-report",
43+
"php-cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --using-cache=no",
44+
"php-cs-try": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no",
45+
"phpstan": "./vendor/bin/phpstan analyze --no-progress",
46+
"phpunit": "./vendor/bin/phpunit",
47+
"psalm": "./vendor/bin/psalm --no-progress --show-info=true --no-cache",
48+
"statics": [
49+
"@phpstan",
50+
"@psalm",
51+
"@php-cs-try"
52+
],
53+
"test": [
54+
"@statics",
55+
"composer validate --strict",
56+
"composer normalize",
57+
"@coverage"
58+
]
59+
}
2560
}

coverage/clover.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<coverage generated="1674250343">
3+
<project timestamp="1674250343">
4+
<file name="/home/kost/projects/Vaderlab/MicroFramework/Micro/Kernel/KernelBootLoaderDependencyProvider/src/Boot/DependencyProviderBootLoader.php">
5+
<class name="Micro\Framework\Kernel\Boot\DependencyProviderBootLoader" namespace="global">
6+
<metrics complexity="4" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
7+
</class>
8+
<line num="32" type="method" name="__construct" visibility="public" complexity="2" crap="2" count="1"/>
9+
<line num="34" type="stmt" count="1"/>
10+
<line num="35" type="stmt" count="1"/>
11+
<line num="38" type="stmt" count="1"/>
12+
<line num="40" type="stmt" count="1"/>
13+
<line num="41" type="stmt" count="1"/>
14+
<line num="42" type="stmt" count="1"/>
15+
<line num="43" type="stmt" count="1"/>
16+
<line num="50" type="method" name="boot" visibility="public" complexity="2" crap="2" count="1"/>
17+
<line num="52" type="stmt" count="1"/>
18+
<line num="53" type="stmt" count="1"/>
19+
<line num="56" type="stmt" count="1"/>
20+
<metrics loc="59" ncloc="41" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
21+
</file>
22+
<file name="/home/kost/projects/Vaderlab/MicroFramework/Micro/Kernel/KernelBootLoaderDependencyProvider/src/Plugin/DependencyProviderInterface.php">
23+
<metrics loc="23" ncloc="12" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
24+
</file>
25+
<metrics files="2" loc="82" ncloc="53" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
26+
</project>
27+
</coverage>

phpcs.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="pcsg-generated-ruleset">
3+
<file>src/</file>
4+
<arg name="basepath" value="."/>
5+
<arg name="colors"/>
6+
<arg name="no-cache"/>
7+
<description>
8+
Micro Framework - сode formatting rules.
9+
</description>
10+
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
11+
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
12+
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
13+
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
14+
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
15+
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
16+
<rule ref="Generic.Files.ByteOrderMark"/>
17+
<rule ref="Generic.Files.LineEndings"/>
18+
<rule ref="Generic.Files.LineLength">
19+
<properties>
20+
<property name="lineLimit" value="120"/>
21+
<property name="absoluteLineLimit" value="140"/>
22+
</properties>
23+
</rule>
24+
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
25+
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
26+
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
27+
<rule ref="Generic.Functions.CallTimePassByReference"/>
28+
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
29+
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
30+
<rule ref="Generic.Metrics.NestingLevel"/>
31+
<rule ref="Generic.NamingConventions.ConstructorName"/>
32+
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
33+
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
34+
<rule ref="Generic.PHP.DeprecatedFunctions"/>
35+
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
36+
<rule ref="Generic.PHP.ForbiddenFunctions"/>
37+
<rule ref="Generic.PHP.LowerCaseConstant"/>
38+
<rule ref="Generic.PHP.NoSilencedErrors"/>
39+
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
40+
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
41+
<rule ref="MySource.PHP.EvalObjectFactory"/>
42+
<rule ref="MySource.PHP.GetRequestData"/>
43+
<rule ref="PEAR.Classes.ClassDeclaration"/>
44+
<rule ref="PEAR.Commenting.InlineComment"/>
45+
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
46+
<rule ref="PEAR.Files.IncludingFile"/>
47+
<rule ref="PEAR.Formatting.MultiLineAssignment"/>
48+
<rule ref="PEAR.Functions.ValidDefaultValue"/>
49+
<rule ref="PEAR.NamingConventions.ValidClassName"/>
50+
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
51+
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
52+
<rule ref="PEAR.WhiteSpace.ScopeIndent"/>
53+
<rule ref="PSR1.Classes.ClassDeclaration"/>
54+
<rule ref="PSR1.Files.SideEffects"/>
55+
<rule ref="PSR2.Classes.ClassDeclaration"/>
56+
<rule ref="PSR2.Classes.PropertyDeclaration"/>
57+
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
58+
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
59+
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
60+
<rule ref="PSR2.Files.EndFileNewline"/>
61+
<rule ref="PSR2.Methods.MethodDeclaration"/>
62+
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
63+
<rule ref="PSR2.Namespaces.UseDeclaration"/>
64+
</ruleset>

0 commit comments

Comments
 (0)