Skip to content

Commit

Permalink
v1.6.0 released
Browse files Browse the repository at this point in the history
  • Loading branch information
Asisyas committed Jan 20, 2023
1 parent 324c519 commit 9f7b2ca
Show file tree
Hide file tree
Showing 18 changed files with 398 additions and 91 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
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
2 changes: 2 additions & 0 deletions .github/workflows/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[{*.yaml,*.yml}]
indent_size = 2
58 changes: 58 additions & 0 deletions .github/workflows/ci.yaml
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}
10 changes: 7 additions & 3 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.phpdoc/
docs/
vendor/
.idea
vendor
composer.lock
.phpunit.result.cache
.php-cs-fixer.cache
test-coverage-report
phpunit.xml
.php-cs-fixer.php
phpstan.neon
31 changes: 31 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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,
'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress']],
'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);
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Komar Stanislau

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.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Micro Framework - The minimum kernel for application initialization.

Documentation is available [here](https://micro-php.net/docs). If not, we will be grateful if you can become its author :)
57 changes: 46 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,60 @@
{
"name": "micro/kernel-boot-dependency",
"description": "Micro Framework: Kernel Boot loader - component to provide dependencies",
"type": "library",
"version": "1.1",
"license": "MIT",
"type": "micro-plugin",
"authors": [
{
"name": "Stanislau Komar",
"email": "[email protected]"
}
],
"require": {
"micro/kernel": "^1",
"micro/autowire": "^1"
"micro/autowire": "^1.6",
"micro/kernel": "^1.6"
},
"require-dev": {
"phpunit/phpunit": "^9"
"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"
},
"license": "MIT",
"autoload": {
"psr-4": {
"Micro\\Framework\\Kernel\\": "src/"
}
},
"authors": [
{
"name": "Stanislau Komar",
"email": "[email protected]"
"autoload-dev": {
"psr-4": {
"Micro\\Framework\\Kernel\\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"
]
}
}
27 changes: 27 additions & 0 deletions coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1674250343">
<project timestamp="1674250343">
<file name="/home/kost/projects/Vaderlab/MicroFramework/Micro/Kernel/KernelBootLoaderDependencyProvider/src/Boot/DependencyProviderBootLoader.php">
<class name="Micro\Framework\Kernel\Boot\DependencyProviderBootLoader" namespace="global">
<metrics complexity="4" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
</class>
<line num="32" type="method" name="__construct" visibility="public" complexity="2" crap="2" count="1"/>
<line num="34" type="stmt" count="1"/>
<line num="35" type="stmt" count="1"/>
<line num="38" type="stmt" count="1"/>
<line num="40" type="stmt" count="1"/>
<line num="41" type="stmt" count="1"/>
<line num="42" type="stmt" count="1"/>
<line num="43" type="stmt" count="1"/>
<line num="50" type="method" name="boot" visibility="public" complexity="2" crap="2" count="1"/>
<line num="52" type="stmt" count="1"/>
<line num="53" type="stmt" count="1"/>
<line num="56" type="stmt" count="1"/>
<metrics loc="59" ncloc="41" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
</file>
<file name="/home/kost/projects/Vaderlab/MicroFramework/Micro/Kernel/KernelBootLoaderDependencyProvider/src/Plugin/DependencyProviderInterface.php">
<metrics loc="23" ncloc="12" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</file>
<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"/>
</project>
</coverage>
64 changes: 64 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="pcsg-generated-ruleset">
<file>src/</file>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="no-cache"/>
<description>
Micro Framework - сode formatting rules.
</description>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="140"/>
</properties>
</rule>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
<rule ref="Generic.Metrics.NestingLevel"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="MySource.PHP.GetRequestData"/>
<rule ref="PEAR.Classes.ClassDeclaration"/>
<rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
<rule ref="PEAR.Files.IncludingFile"/>
<rule ref="PEAR.Formatting.MultiLineAssignment"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
<rule ref="PEAR.WhiteSpace.ScopeIndent"/>
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Files.SideEffects"/>
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<rule ref="PSR2.Namespaces.UseDeclaration"/>
</ruleset>
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
26 changes: 0 additions & 26 deletions phpunit.xml

This file was deleted.

41 changes: 41 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?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>
<exclude>
<directory>src/Exception</directory>
<file>src/HttpCorePlugin.php</file>
</exclude>
</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>
Loading

0 comments on commit 9f7b2ca

Please sign in to comment.