Skip to content

Commit 924f422

Browse files
Updated php-starter library
1 parent 31c959c commit 924f422

8 files changed

+137
-346
lines changed

.editorconfig

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# EditorConfig http://EditorConfig.org
2-
3-
# top-most EditorConfig file
1+
# Coding styles between different editors and IDEs: editorconfig.org
42
root = true
53

6-
# All files.
74
[*]
85
end_of_line = LF
96
indent_style = space
@@ -12,5 +9,9 @@ charset = utf-8
129
trim_trailing_whitespace = true
1310
insert_final_newline = true
1411

15-
[*.{yml,yaml}]
12+
[*.{yml,yaml,json}]
13+
indent_style = space
1614
indent_size = 2
15+
16+
[*.md]
17+
max_line_length = 80

.github/stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Number of days of inactivity before an issue becomes stale
2-
daysUntilStale: 60
2+
daysUntilStale: 240
33
# Number of days of inactivity before a stale issue is closed
4-
daysUntilClose: 21
4+
daysUntilClose: 120
55
# Issues with these labels will never be considered stale
66
exemptLabels:
77
- pinned

.github/workflows/continuous-integration.yml

+13-30
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33
name: build
44
on: [push, pull_request]
55

6-
#env:
7-
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
8-
96
jobs:
107
build:
118
strategy:
12-
fail-fast: false
139
matrix:
1410
operating-system: [ubuntu-latest, windows-latest, macos-latest]
15-
php-versions: ['7.4', '8.0', '8.1']
11+
php-versions: ['8.0', '8.1', '8.2']
1612

1713
runs-on: ${{ matrix.operating-system }}
1814

@@ -24,7 +20,7 @@ jobs:
2420
git config --global core.eol lf
2521
2622
- name: Checkout
27-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2824

2925
- name: Setup PHP, with composer and extensions
3026
uses: shivammathur/setup-php@v2
@@ -46,40 +42,27 @@ jobs:
4642
restore-keys: ${{ runner.os }}-composer-
4743

4844
- name: Install dependencies
49-
shell: bash
50-
run: |
51-
composer_flags=""
52-
if [ ${{ matrix.php-versions }} == 8.1 ]; then composer_flags="--ignore-platform-req=php"; fi;
53-
54-
composer install --no-progress --optimize-autoloader $composer_flags
55-
56-
#- name: Setup Code Climate test-reporter
57-
# if: matrix.operating-system == 'ubuntu-latest' && matrix.php-versions == 8.0
58-
# run: |
59-
# curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
60-
# chmod +x ./cc-test-reporter
61-
# ./cc-test-reporter before-build
45+
run: composer install --no-progress --optimize-autoloader ${{ 8.2 == matrix.php-versions && '--ignore-platform-reqs' || '' }}
6246

6347
- name: Check coding standards (PHP_CodeSniffer)
6448
run: vendor/bin/phpcs
6549

66-
- name: Run unit tests (PHPUnit)
67-
continue-on-error: ${{ matrix.php-versions == 8.1 }}
68-
run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
69-
70-
- name: Publish coverage report to Codecov
71-
if: matrix.operating-system == 'ubuntu-latest'
72-
run: |
73-
bash <(curl -s https://codecov.io/bash) -f clover.xml
74-
if [ ${{ matrix.php-versions }} == 8.0 && -v CC_TEST_REPORTER_ID ]; then ./cc-test-reporter after-build --coverage-input-type clover; fi;
75-
7650
- name: "Statically analyze code (PHPStan)"
7751
run: vendor/bin/phpstan analyse
7852

7953
- name: Statically analyze code (Psalm)
8054
run: vendor/bin/psalm --output-format=github --taint-analysis --report=build/logs/psalm.sarif
8155

8256
- name: "Upload security analysis results to GitHub"
83-
uses: "github/codeql-action/upload-sarif@v1"
57+
uses: "github/codeql-action/upload-sarif@v2"
8458
with:
8559
sarif_file: "build/logs/psalm.sarif"
60+
61+
- name: Run unit tests (PHPUnit)
62+
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
63+
64+
- name: "Upload coverage report to Codecov"
65+
uses: codecov/codecov-action@v2
66+
continue-on-error: true
67+
with:
68+
files: ./coverage.clover

.php_cs.dist.php

+46-167
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

3-
declare(strict_types=1);
3+
/*
4+
* This file is part of Biurad opensource projects.
5+
*
6+
* @copyright 2020 Biurad Group (https://biurad.com/)
7+
* @license https://opensource.org/licenses/BSD-3-Clause License
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
412

513
$header = <<<'EOF'
6-
This file is part of BiuradPHP opensource projects.
14+
This file is part of Biurad opensource projects.
715
8-
PHP version 7.4 and above required
9-
10-
@author Divine Niiquaye Ibok <[email protected]>
11-
@copyright 2019 Biurad Group (https://biurad.com/)
16+
@copyright 2020 Biurad Group (https://biurad.com/)
1217
@license https://opensource.org/licenses/BSD-3-Clause License
1318
1419
For the full copyright and license information, please view the LICENSE
@@ -17,173 +22,47 @@
1722

1823
return (new PhpCsFixer\Config())
1924
->setRiskyAllowed(true)
20-
->setFinder((new PhpCsFixer\Finder())->append([__FILE__]))
25+
->setFinder(
26+
(new PhpCsFixer\Finder())
27+
->in(__DIR__)
28+
->append([__FILE__])
29+
->notPath('#/Fixtures/#')
30+
->exclude([
31+
'vendor/',
32+
'packages/*/vendor/',
33+
])
34+
)
2135
->setRules([
22-
'@PSR12' => true,
23-
//'DoctrineAnnotation' => true,
24-
'header_comment' => ['header' => $header],
25-
'general_phpdoc_tag_rename' => [
26-
'replacements' => [
27-
'inheritDocs' => 'inheritDoc',
28-
'inheritDoc' => 'inheritdoc',
29-
],
30-
],
31-
'backtick_to_shell_exec' => true,
32-
'no_mixed_echo_print' => true,
33-
'array_syntax' => ['syntax' => 'short'],
34-
'no_multiline_whitespace_around_double_arrow' => true,
35-
'no_trailing_comma_in_singleline_array' => true,
36-
'no_whitespace_before_comma_in_array' => true,
37-
'normalize_index_brace' => true,
38-
'trailing_comma_in_multiline' => true,
39-
'trim_array_spaces' => true,
40-
'whitespace_after_comma_in_array' => true,
41-
'native_function_type_declaration_casing' => true,
42-
'braces' => [
43-
'allow_single_line_anonymous_class_with_empty_body' => true,
44-
'allow_single_line_closure' => true,
45-
],
46-
'magic_constant_casing' => true,
47-
'magic_method_casing' => true,
48-
'native_function_casing' => true,
49-
'cast_spaces' => true,
50-
'no_short_bool_cast' => true,
51-
'no_unset_cast' => true,
52-
'short_scalar_cast' => true,
53-
'class_attributes_separation' => true,
36+
'@Symfony' => true,
37+
'@Symfony:risky' => true,
38+
'@PHP80Migration:risky' => true,
39+
'@PHPUnit84Migration:risky' => true,
5440
'protected_to_private' => false,
55-
'no_empty_comment' => true,
56-
'single_line_comment_style' => true,
41+
'single_import_per_statement' => false,
42+
'blank_line_after_opening_tag' => false,
43+
'linebreak_after_opening_tag' => false,
44+
'single_class_element_per_statement' => false,
45+
'single_trait_insert_per_statement' => false,
46+
//'group_import' => true,
5747
'native_constant_invocation' => true,
58-
'include' => true,
59-
'no_alternative_syntax' => true,
60-
'no_superfluous_elseif' => true,
61-
'no_trailing_comma_in_list_call' => true,
62-
'no_unneeded_control_parentheses' => true,
63-
'no_unneeded_curly_braces' => true,
64-
'no_useless_else' => true,
65-
//'switch_continue_to_break' => true,
66-
'yoda_style' => true,
67-
'combine_nested_dirname' => true,
68-
'function_typehint_space' => true,
69-
'lambda_not_used_import' => true,
48+
'comment_to_phpdoc' => true,
49+
'strict_param' => true,
50+
'no_unset_on_property' => true,
51+
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
52+
'ordered_imports' => ['imports_order' => ['class', 'const', 'function'], 'sort_algorithm' => 'alpha'],
53+
'header_comment' => ['header' => $header],
7054
'native_function_invocation' => [
71-
'include' => ['@compiler_optimized', '@all'],
72-
'scope' => 'namespaced',
55+
'include' => ['@compiler_optimized', '@internal'],
7356
'strict' => true,
7457
],
75-
//'single_line_throw' => true,
76-
//'use_arrow_functions' => true,
77-
'void_return' => true,
78-
//'global_namespace_import' => true,
79-
'no_unused_imports' => true,
80-
'single_import_per_statement' => false,
81-
'combine_consecutive_issets' => true,
82-
'combine_consecutive_unsets' => true,
83-
'dir_constant' => true,
84-
'function_to_constant' => true,
85-
'is_null' => true,
86-
'no_unset_on_property' => true,
87-
'single_space_after_construct' => true,
88-
'clean_namespace' => true,
89-
'no_leading_namespace_whitespace' => true,
90-
'binary_operator_spaces' => true,
91-
'concat_space' => ['spacing' => 'one'],
92-
'increment_style' => true,
93-
'object_operator_without_whitespace' => true,
94-
'standardize_increment' => true,
95-
'standardize_not_equals' => true,
96-
'ternary_to_null_coalescing' => true,
97-
'unary_operator_spaces' => true,
98-
'echo_tag_syntax' => true,
99-
'linebreak_after_opening_tag' => true,
100-
'align_multiline_comment' => true,
101-
'no_blank_lines_after_phpdoc' => true,
102-
'php_unit_construct' => true,
103-
'php_unit_fqcn_annotation' => true,
104-
'php_unit_method_casing' => true,
105-
'@PHPUnit84Migration:risky' => true,
106-
'no_empty_phpdoc' => true,
107-
'no_superfluous_phpdoc_tags' => [
108-
'allow_mixed' => true,
109-
'allow_unused_params' => true,
110-
],
111-
'phpdoc_align' => true,
112-
'phpdoc_annotation_without_dot' => true,
113-
'phpdoc_indent' => true,
114-
'phpdoc_inline_tag_normalizer' => true,
115-
'phpdoc_no_access' => true,
116-
'phpdoc_no_empty_return' => true,
117-
'phpdoc_no_package' => true,
118-
'phpdoc_no_useless_inheritdoc' => true,
119-
'phpdoc_order' => true,
120-
'phpdoc_return_self_reference' => true,
121-
'phpdoc_scalar' => true,
122-
'phpdoc_separation' => true,
123-
'phpdoc_single_line_var_spacing' => true,
124-
'phpdoc_summary' => true,
125-
'phpdoc_tag_type' => [
126-
'tags' => [
127-
'inheritdoc' => 'inline',
58+
'general_phpdoc_tag_rename' => [
59+
'replacements' => [
60+
'inheritDocs' => 'inheritdoc',
61+
'inheritDoc' => 'inheritdoc',
12862
],
12963
],
130-
'phpdoc_to_comment' => true,
131-
'phpdoc_trim' => true,
132-
'phpdoc_types' => true,
133-
'phpdoc_trim_consecutive_blank_line_separation' => true,
134-
'phpdoc_types_order' => [
135-
'null_adjustment' => 'always_last',
136-
'sort_algorithm' => 'none',
137-
],
138-
'phpdoc_var_without_name' => true,
139-
'return_assignment' => true,
140-
//'simplified_null_return' => true,
141-
//'no_empty_statement' => true,
142-
//'no_singleline_whitespace_before_semicolons' => true,
143-
'semicolon_after_instruction' => true,
144-
'space_after_semicolon' => [
145-
'remove_in_empty_for_expressions' => true,
146-
],
147-
'declare_strict_types' => true,
148-
'single_quote' => true,
149-
'array_indentation' => true,
15064
'blank_line_before_statement' => [
151-
'statements' => [
152-
'break',
153-
'continue',
154-
'declare',
155-
'do',
156-
'for',
157-
'foreach',
158-
'if',
159-
'include',
160-
'include_once',
161-
'require',
162-
'require_once',
163-
'return',
164-
'switch',
165-
'throw',
166-
'try',
167-
'while',
168-
'yield',
169-
],
65+
'statements' => [],
17066
],
171-
'no_extra_blank_lines' => true,
172-
'no_spaces_around_offset' => true,
173-
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false],
174-
175-
// Risky standard
176-
//'@PSR12:risky' => true,
177-
//'group_import' => true,
178-
//'ordered_traits' => true,
179-
//'self_accessor' => true,
180-
//'array_push' => true,
181-
//'logical_operators' => true,
182-
//'set_type_to_cast' => true,
183-
//'modernize_types_casting' => true,
184-
//'no_null_property_initialization' => true,
185-
//'no_php4_constructor' => true,
186-
//'no_unneeded_final_method' => true,
187-
//'psr_autoloading' => true,
188-
//'non_printable_character' => ['use_escape_sequences_in_strings' => true]
189-
]);
67+
])
68+
;

.travis.yml

-26
This file was deleted.

CHANGELOG.md

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
# Change Log
2-
All notable changes to this project will be documented in this file.
3-
Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
4-
5-
## [Unreleased][unreleased]
6-
7-
### Added
8-
9-
### Changed
10-
11-
### Fixed
12-
13-
### Removed
14-
15-
[unreleased]: https://github.com/biurad/php-starter/compare/v0.19.20...master
1+
CHANGELOG
2+
=========

0 commit comments

Comments
 (0)