generated from php-standard-library/repository-template
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 cd223ca
Showing
22 changed files
with
682 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,17 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.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,40 @@ | ||
# Autodetect text files | ||
* text=auto | ||
|
||
# ...Unless the name matches the following overriding patterns | ||
|
||
# Definitively text files | ||
*.php text | ||
*.css text | ||
*.js text | ||
*.txt text | ||
*.md text | ||
*.xml text | ||
*.json text | ||
*.bat text | ||
*.sql text | ||
*.yml text | ||
|
||
# Ensure those won't be messed up with | ||
*.png binary | ||
*.jpg binary | ||
*.gif binary | ||
*.ttf binary | ||
|
||
# Ignore some meta files when creating an archive of this repository | ||
/.github export-ignore | ||
/.editorconfig export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.scrutinizer.yml export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/psalm.xml export-ignore | ||
/.phpcs.xml export-ignore | ||
/.php_cs.dist export-ignore | ||
/tests export-ignore | ||
/docs export-ignore | ||
|
||
# Avoid merge conflicts in CHANGELOG | ||
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/ | ||
/CHANGELOG.md merge=union | ||
|
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 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: 'Type: Bug' | ||
assignees: azjezz | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Code to reproduce the behavior: | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Environment (please complete the following information):** | ||
- OS: [e.g. iOS, Ubuntu] | ||
- PHP version [e.g. 7.4, 8.0] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: 'Type: Enhancement' | ||
assignees: azjezz | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,36 @@ | ||
name: "code coverage" | ||
|
||
on: | ||
pull_request: ~ | ||
push: ~ | ||
|
||
jobs: | ||
code-coverage: | ||
name: "code coverage" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "installing PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "8.0" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2, cs2pr | ||
extensions: bcmath, mbstring, intl, sodium, json | ||
|
||
- name: "installing dependencies" | ||
run: "composer install --no-interaction --no-progress --ignore-platform-req php" | ||
|
||
- name: "running unit tests ( phpunit )" | ||
run: "php vendor/bin/phpunit" | ||
|
||
- name: "sending code coverage to coveralls" | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
composer global require php-coveralls/php-coveralls | ||
php-coveralls -x tests/logs/clover.xml -o tests/logs/coveralls-upload.json -v |
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,30 @@ | ||
name: "coding standards" | ||
|
||
on: | ||
pull_request: ~ | ||
push: ~ | ||
|
||
jobs: | ||
coding-standards: | ||
name: "coding standards" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "installing PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "7.4" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2, cs2pr | ||
extensions: bcmath, mbstring, intl, sodium, json | ||
|
||
- name: "installing dependencies" | ||
run: "composer update --no-interaction --no-progress" | ||
|
||
- name: "checking coding standards ( codesniffer )" | ||
run: "php vendor/bin/phpcs" | ||
|
||
- name: "checking coding standards ( php-cs-fixer )" | ||
run: "php vendor/bin/php-cs-fixer fix --dry-run --diff --ansi" |
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,27 @@ | ||
name: "security analysis" | ||
|
||
on: | ||
pull_request: ~ | ||
push: ~ | ||
|
||
jobs: | ||
security-analysis: | ||
name: "security analysis" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "installing PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "7.4" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2, cs2pr | ||
extensions: bcmath, mbstring, intl, sodium, json | ||
|
||
- name: "installing dependencies" | ||
run: "composer update --no-interaction --no-progress" | ||
|
||
- name: "running security analysis ( psalm )" | ||
run: "vendor/bin/psalm --output-format=github --taint-analysis" |
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 @@ | ||
name: "static analysis" | ||
|
||
on: | ||
pull_request: ~ | ||
push: ~ | ||
schedule: | ||
- cron: '0 */3 * * *' | ||
|
||
jobs: | ||
static-analysis: | ||
name: "static analysis" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "installing PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "7.4" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2, cs2pr | ||
extensions: bcmath, mbstring, intl, sodium, json | ||
|
||
- name: "installing dependencies" | ||
run: "composer update --no-interaction --no-progress" | ||
|
||
- name: "running static analysis ( psalm )" | ||
run: "vendor/bin/psalm --shepherd --stats" |
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,48 @@ | ||
name: "unit tests" | ||
|
||
on: | ||
pull_request: ~ | ||
push: ~ | ||
|
||
jobs: | ||
unit-tests: | ||
name: "unit tests" | ||
|
||
runs-on: ${{ matrix.operating-system }} | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
- "8.0" | ||
operating-system: | ||
- "macos-latest" | ||
- "ubuntu-latest" | ||
- "windows-latest" | ||
|
||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "installing PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
ini-values: memory_limit=-1 | ||
tools: composer:v2, cs2pr | ||
extensions: bcmath, mbstring, intl, sodium, json | ||
|
||
- name: "caching dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: | | ||
~/.composer/cache | ||
vendor | ||
key: "php-${{ matrix.php-version }}" | ||
restore-keys: "php-${{ matrix.php-version }}" | ||
|
||
- name: "installing dependencies" | ||
run: "composer install --no-interaction --no-progress --ignore-platform-req php" | ||
|
||
- name: "running unit tests ( phpunit )" | ||
run: "php vendor/bin/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,23 @@ | ||
# phpstorm project files | ||
.idea | ||
|
||
# vs code project files | ||
.vscode | ||
|
||
# composer vendor dir | ||
/vendor/ | ||
|
||
# composer lock file | ||
/composer.lock | ||
|
||
# Mac DS_Store files | ||
.DS_Store | ||
|
||
# php-cs-fixer cache | ||
.php_cs.cache | ||
|
||
# phpunit cache | ||
.phpunit.result.cache | ||
|
||
# test logs | ||
/tests/logs/* |
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,82 @@ | ||
<?php | ||
|
||
return PhpCsFixer\Config::create() | ||
->setFinder( | ||
\Symfony\Component\Finder\Finder::create() | ||
->in([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]) | ||
) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'align_multiline_comment' => true, | ||
'array_indentation' => true, | ||
'declare_strict_types' => true, | ||
// Currently it is not possible to mark all classes as final (exceptions etc.) | ||
// We can run this fixer periodically on the tests folder only. | ||
// 'final_class' => true, | ||
'global_namespace_import' => [ | ||
'import_classes' => true, | ||
'import_constants' => true, | ||
'import_functions' => true, | ||
], | ||
'list_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'lowercase_constants' => true, | ||
'multiline_comment_opening_closing' => true, | ||
'native_function_casing' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_leading_import_slash' => true, | ||
'no_superfluous_phpdoc_tags' => [ | ||
'allow_mixed' => true, | ||
], | ||
'no_unused_imports' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_imports' => [ | ||
'imports_order' => ['class', 'function', 'const'], | ||
], | ||
'ordered_interfaces' => true, | ||
'php_unit_test_annotation' => true, | ||
'php_unit_test_case_static_method_calls' => [ | ||
'call_type' => 'static', | ||
], | ||
'single_import_per_statement' => true, | ||
'single_trait_insert_per_statement' => true, | ||
'static_lambda' => true, | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
'no_blank_lines_after_phpdoc' => true, | ||
'no_empty_phpdoc' => true, | ||
'phpdoc_align' => [ | ||
'align' => 'left', | ||
], | ||
'phpdoc_indent' => true, | ||
'phpdoc_line_span' => [ | ||
'const' => 'multi', | ||
'property' => 'multi', | ||
'method' => 'multi', | ||
], | ||
'phpdoc_no_alias_tag' => [ | ||
'replacements' => [ | ||
'psalm-var' => 'var', | ||
'psalm-template' => 'template', | ||
'psalm-param' => 'param', | ||
'psalm-return' => 'return', | ||
] | ||
], | ||
'phpdoc_order' => true, | ||
'phpdoc_scalar' => true, | ||
'phpdoc_separation' => true, | ||
'phpdoc_summary' => true, | ||
'phpdoc_tag_casing' => true, | ||
'phpdoc_trim' => true, | ||
'phpdoc_trim_consecutive_blank_line_separation' => true, | ||
'no_empty_statement' => true, | ||
'semicolon_after_instruction' => true, | ||
'declare_strict_types' => true, | ||
'strict_param' => true, | ||
]) | ||
; |
Oops, something went wrong.