Skip to content

Commit

Permalink
Prepeare first release. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 25, 2024
1 parent bd4870e commit 0a998c9
Show file tree
Hide file tree
Showing 17 changed files with 204 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.xml]
indent_size = 2
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'psalm.xml'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -25,9 +26,10 @@ jobs:
phpunit:
uses: php-forge/actions/.github/workflows/phpunit.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.1', '8.2']
['8.1', '8.2', '8.3']
5 changes: 4 additions & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- 'psalm.xml'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -26,8 +27,10 @@ name: dependency-check
jobs:
composer-require-checker:
uses: php-forge/actions/.github/workflows/composer-require-checker.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
['8.1']
34 changes: 34 additions & 0 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'

name: ecs

jobs:
easy-coding-standard:
uses: php-forge/actions/.github/workflows/ecs.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
2 changes: 2 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'psalm.xml'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -23,6 +24,7 @@ jobs:
mutation:
uses: php-forge/actions/.github/workflows/roave-infection.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
with:
os: >-
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'phpunit.xml.dist'

push:
branches: ['main']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -24,8 +25,10 @@ name: static analysis
jobs:
psalm:
uses: php-forge/actions/.github/workflows/psalm.yml@main
secrets:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
with:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
['8.1']
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
.idea

# phpunit
phpunit.phar
.phpunit.result.cache
.phpunit.cache
phpunit.xlm
.phpunit.result.cache
phpunit.xml
phpunit.phar

#yii3 config packages
/config/packages

# windows thumbnail cache
Thumbs.db

# security private repo
auth.json

.vscode
7 changes: 4 additions & 3 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ enabled:
- combine_nested_dirname
- declare_strict_types
- dir_constant
- empty_loop_body_braces
- fully_qualified_strict_types
- function_to_constant
- hash_to_slash_comment
- integer_literal_case
- is_null
- logical_operators
- magic_constant_casing
Expand Down Expand Up @@ -56,7 +58,6 @@ enabled:
- phpdoc_order
- phpdoc_property
- phpdoc_scalar
- phpdoc_separation
- phpdoc_singular_inheritdoc
- phpdoc_trim
- phpdoc_trim_consecutive_blank_line_separation
Expand All @@ -78,9 +79,9 @@ enabled:
- trailing_comma_in_multiline_array
- unalign_double_arrow
- unalign_equals
- empty_loop_body_braces
- integer_literal_case
- union_type_without_spaces

disabled:
- function_declaration
- psr12_braces
- psr12_class_definition
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

## 0.1.0 February 25, 2024

- Initial release.
54 changes: 40 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,42 @@
<br>
</p>

## Requirements
<p align="center">
<a href="https://github.com/php-forge/helpers/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/php-forge/helpers/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
</a>
<a href="https://codecov.io/gh/php-forge/helpers" target="_blank">
<img src="https://codecov.io/gh/php-forge/helpers/branch/main/graph/badge.svg?token=MF0XUGVLYC" alt="Codecov">
</a>
<a href="https://dashboard.stryker-mutator.io/reports/github.com/php-forge/helpers/main" target="_blank">
<img src="https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fphp-forge%2Fhelpers%2Fmain" alt="Infection">
</a>
<a href="https://github.com/php-forge/helpers/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/php-forge/helpers/actions/workflows/static.yml/badge.svg" alt="Psalm">
</a>
<a href="https://shepherd.dev/github/php-forge/helpers" target="_blank">
<img src="https://shepherd.dev/github/php-forge/helpers/coverage.svg" alt="Psalm Coverage">
</a>
<a href="https://github.styleci.io/repos/667051036?branch=main">
<img src="https://github.styleci.io/repos/667051036/shield?branch=main" alt="StyleCI">
</a>
</p>

## Installation

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

The minimun version of `PHP` required by this package is `PHP 8.1`.
Either run

For install this package, you need [composer](https://getcomposer.org/).
```shell
composer require --prefer-dist php-forge/helpers:"^0.1"
```

or add

```json
"php-forge/helpers": "^0.1"
```

## Usage

Expand All @@ -20,19 +51,14 @@ For install this package, you need [composer](https://getcomposer.org/).

[Check the documentation testing](/docs/testing.md) to learn about testing.

## CI status

[![build](https://github.com/php-forge/helpers/actions/workflows/build.yml/badge.svg)](https://github.com/php-forge/helpers/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/php-forge/helpers/branch/main/graph/badge.svg?token=MF0XUGVLYC)](https://codecov.io/gh/php-forge/helpers)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fphp-forge%2Fhelpers%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/php-forge/helpers/main)
[![static analysis](https://github.com/php-forge/helpers/actions/workflows/static.yml/badge.svg)](https://github.com/php-forge/helpers/actions/workflows/static.yml)
[![type-coverage](https://shepherd.dev/github/php-forge/helpers/coverage.svg)](https://shepherd.dev/github/php-forge/helpers)
[![StyleCI](https://github.styleci.io/repos/667051036/shield?branch=main)](https://github.styleci.io/repos/667051036?branch=main)

## Our social networks
## Support versions

[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)
[![PHP81](https://img.shields.io/badge/PHP-%3E%3D8.1-787CB5)](https://www.php.net/releases/8.1/en.php)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Our social networks

[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)
2 changes: 0 additions & 2 deletions changelog.md

This file was deleted.

19 changes: 11 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
"helpers"
],
"license": "mit",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.1"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.6",
"phpunit/phpunit": "^10.2",
"roave/infection-static-analysis-plugin": "^1.32",
"vimeo/psalm": "^5.1"
"maglnet/composer-require-checker": "^4.7",
"phpunit/phpunit": "^10.5",
"roave/infection-static-analysis-plugin": "^1.34",
"symplify/easy-coding-standard": "^12.1",
"vimeo/psalm": "^5.20"
},
"autoload": {
"psr-4": {
Expand All @@ -30,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.0.x-dev"
"dev-main": "0.1-dev"
}
},
"config": {
Expand All @@ -41,7 +40,11 @@
},
"scripts": {
"check-dependencies": "composer-require-checker",
"mutation": "roave-infection-static-analysis-plugin",
"easy-coding-standard": "ecs check",
"mutation": [
"Composer\\Config::disableProcessTimeout",
"roave-infection-static-analysis-plugin"
],
"psalm": "psalm",
"test": "phpunit"
}
Expand Down
39 changes: 39 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
->withConfiguredRule(
ClassDefinitionFixer::class,
[
'space_before_parenthesis' => true,
],
)
->withFileExtensions(['php'])
->withPaths(
[
__DIR__ . '/src',
__DIR__ . '/tests',
],
)
->withPhpCsFixerSets(perCS20: true)
->withPreparedSets(
cleanCode: true,
comments:true,
docblocks: true,
namespaces: true,
psr12: true
)
->withRules(
[
NoUnusedImportsFixer::class,
OrderedClassElementsFixer::class,
OrderedTraitsFixer::class,
]
);
38 changes: 19 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?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"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Helpers">
<directory>tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="Helpers">
<directory>tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
7 changes: 7 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0"?>

<psalm
errorLevel="1"
findUnusedBaselineEntry="true"
Expand All @@ -10,5 +11,11 @@
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<MixedAssignment errorLevel="suppress" />
</issueHandlers>
</psalm>

0 comments on commit 0a998c9

Please sign in to comment.