Skip to content

Commit 7d91339

Browse files
Merge branch 'release/5.0.0'
2 parents c99cd52 + 5321d44 commit 7d91339

16 files changed

+445
-65
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ end_of_line = lf
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

14-
[*.yml]
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.{yml,yaml}]
1518
indent_size = 2

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
/.editorconfig export-ignore
44
/.gitattributes export-ignore
5-
/.github export-ignore
5+
/.github export-ignore
66
/.gitignore export-ignore
7-
/CODE_OF_CONDUCT.md export-ignore
8-
/CONTRIBUTING.md export-ignore
7+
/.php_cs.dist.php export-ignore
8+
/CODE_OF_CONDUCT.md export-ignore
9+
/CONTRIBUTING.md export-ignore
910
/phpunit.xml.dist export-ignore
1011
/tests export-ignore

.github/ISSUE_TEMPLATE/BUG_REPORT.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@ assignees: sebastiaanluca
1212

1313
### Steps to reproduce
1414

15-
1.
16-
2.
17-
3.
15+
Please provide a fully working repository that reproduces the bug.
1816

19-
### Traces
17+
### Additional info
2018

21-
Logs, error output, etc.
22-
23-
### Environment information
24-
25-
Setup, environment, packages, versions, etc.
19+
Logs, error output, setup, environment, packages, versions, etc.

.github/workflows/test.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
1-
name: test
1+
name: Check code
22

33
on:
44
push:
55
pull_request:
6-
schedule:
7-
- cron: '0 12 15 * *'
86

97
jobs:
10-
test:
8+
9+
check:
10+
name: Run checks - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php: [8.0]
15+
php: [8.0, 8.1]
1616
dependency-version: [prefer-lowest, prefer-stable]
1717
os: [ubuntu-latest]
1818

19-
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
20-
2119
steps:
2220
- name: Check out code
2321
uses: actions/checkout@v2
2422

25-
- name: Cache dependencies
23+
- name: Cache PHP dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: '**/vendor'
27+
key: ${{ runner.os }}-vendor-cache-${{ hashFiles('**/composer.lock') }}
28+
restore-keys: |
29+
${{ runner.os }}-vendor-cache-
30+
31+
- name: Cache Composer dependencies
2632
uses: actions/cache@v2
2733
with:
2834
path: ~/.composer/cache/files
29-
key: dependencies-${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
35+
key: composer-${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('composer.json') }}
3036

3137
- name: Validate Composer configuration file
3238
run: composer validate --strict
@@ -39,8 +45,10 @@ jobs:
3945
coverage: none
4046

4147
- name: Install dependencies
42-
run: |
43-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
48+
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --optimize-autoloader
49+
50+
- name: Lint code
51+
run: vendor/bin/php-cs-fixer fix --dry-run --diff
4452

45-
- name: Execute tests
53+
- name: Run tests
4654
run: vendor/bin/phpunit

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
.idea
2+
.php-cs-fixer.cache
13
.phpunit.result.cache
2-
/.idea
34
composer.lock
45
composer.phar
56
phpunit.xml
6-
tests/temp/
77
vendor/

.php-cs-fixer.dist.php

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
<?php
2+
3+
// Last reviewed: v2.19 (Testament)
4+
// Based on https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
5+
6+
use PhpCsFixer\Config;
7+
use PhpCsFixer\Finder;
8+
9+
$rules = [
10+
'@PSR1' => true,
11+
'@PSR2' => true,
12+
'@PhpCsFixer' => true,
13+
'@Symfony' => true,
14+
'@PHP70Migration' => true,
15+
'@PHP70Migration:risky' => true,
16+
'@PHP71Migration' => true,
17+
'@PHP71Migration:risky' => true,
18+
'@PHP73Migration' => true,
19+
'@PHPUnit75Migration:risky' => true,
20+
'final_class' => false,
21+
'new_with_braces' => false,
22+
'strict_comparison' => true,
23+
'list_syntax' => ['syntax' => 'short'],
24+
'mb_str_functions' => true,
25+
'class_attributes_separation' => [
26+
'elements' => [
27+
'method' => 'one',
28+
],
29+
],
30+
'no_extra_blank_lines' => [
31+
'tokens' => [
32+
'break',
33+
'continue',
34+
'curly_brace_block',
35+
'extra',
36+
'parenthesis_brace_block',
37+
'return',
38+
'square_brace_block',
39+
'throw',
40+
'use',
41+
'use_trait',
42+
'switch',
43+
44+
'case',
45+
'default',
46+
],
47+
],
48+
'no_blank_lines_before_namespace' => false,
49+
'nullable_type_declaration_for_default_null_value' => true,
50+
'increment_style' => ['style' => 'pre'],
51+
'self_static_accessor' => true,
52+
'static_lambda' => false,
53+
'no_empty_phpdoc' => true,
54+
'no_superfluous_phpdoc_tags' => [
55+
'remove_inheritdoc' => true,
56+
],
57+
'phpdoc_line_span' => [
58+
'const' => 'multi',
59+
'method' => 'multi',
60+
'property' => 'multi',
61+
],
62+
'general_phpdoc_tag_rename' => true,
63+
'phpdoc_add_missing_param_annotation' => ['only_untyped' => true],
64+
'phpdoc_align' => ['align' => 'left'],
65+
'phpdoc_indent' => true,
66+
'phpdoc_inline_tag_normalizer' => true,
67+
'phpdoc_no_access' => true,
68+
'phpdoc_no_empty_return' => false,
69+
'phpdoc_no_package' => true,
70+
'phpdoc_no_useless_inheritdoc' => true,
71+
'phpdoc_order' => true,
72+
'phpdoc_order_by_value' => false,
73+
'phpdoc_scalar' => true,
74+
'phpdoc_single_line_var_spacing' => true,
75+
'phpdoc_summary' => true,
76+
'phpdoc_tag_casing' => ['tags' => ['inheritDoc']],
77+
'phpdoc_tag_type' => true,
78+
'phpdoc_to_comment' => true,
79+
'phpdoc_trim' => true,
80+
'phpdoc_types' => ['groups' => ['simple', 'alias']],
81+
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
82+
'phpdoc_var_annotation_correct_order' => true,
83+
'phpdoc_var_without_name' => true,
84+
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
85+
'php_unit_test_class_requires_covers' => false,
86+
'php_unit_internal_class' => false,
87+
'yoda_style' => false,
88+
'ordered_class_elements' => [
89+
'order' => [
90+
'use_trait',
91+
'constant_public',
92+
'constant_protected',
93+
'constant_private',
94+
95+
'property_static',
96+
'property_public_static',
97+
'property_protected_static',
98+
'property_private_static',
99+
100+
'property',
101+
'property_public',
102+
'property_protected',
103+
'property_private',
104+
105+
'construct',
106+
'destruct',
107+
'magic',
108+
109+
'method_static',
110+
'method_public_abstract_static',
111+
'method_public_static',
112+
'method_protected_abstract_static',
113+
'method_protected_static',
114+
'method_private_static',
115+
'method_public_abstract',
116+
'method_public',
117+
'method_protected_abstract',
118+
'method_protected',
119+
'method_private',
120+
],
121+
],
122+
'array_syntax' => ['syntax' => 'short'],
123+
'blank_line_after_namespace' => true,
124+
'blank_line_after_opening_tag' => true,
125+
'braces' => true,
126+
'cast_spaces' => true,
127+
'concat_space' => [
128+
'spacing' => 'none',
129+
],
130+
'declare_equal_normalize' => true,
131+
'elseif' => true,
132+
'encoding' => true,
133+
'full_opening_tag' => true,
134+
'fully_qualified_strict_types' => true, // added by Shift
135+
'function_declaration' => true,
136+
'function_typehint_space' => true,
137+
'heredoc_to_nowdoc' => true,
138+
'include' => true,
139+
'indentation_type' => true,
140+
'linebreak_after_opening_tag' => true,
141+
'line_ending' => true,
142+
'lowercase_cast' => true,
143+
'lowercase_keywords' => true,
144+
'lowercase_static_reference' => true, // added from Symfony
145+
'magic_method_casing' => true, // added from Symfony
146+
'magic_constant_casing' => true,
147+
'method_argument_space' => true,
148+
'native_function_casing' => true,
149+
'no_alias_functions' => false,
150+
'no_blank_lines_after_class_opening' => true,
151+
'no_blank_lines_after_phpdoc' => true,
152+
'no_closing_tag' => true,
153+
'no_empty_statement' => true,
154+
'no_leading_import_slash' => true,
155+
'no_leading_namespace_whitespace' => true,
156+
'no_mixed_echo_print' => [
157+
'use' => 'echo',
158+
],
159+
'no_multiline_whitespace_around_double_arrow' => true,
160+
'multiline_whitespace_before_semicolons' => [
161+
'strategy' => 'no_multi_line',
162+
],
163+
'no_short_bool_cast' => true,
164+
'no_singleline_whitespace_before_semicolons' => true,
165+
'no_spaces_after_function_name' => true,
166+
'no_spaces_inside_parenthesis' => true,
167+
'no_trailing_comma_in_list_call' => false,
168+
'no_trailing_comma_in_singleline_array' => true,
169+
'no_trailing_whitespace' => true,
170+
'no_trailing_whitespace_in_comment' => true,
171+
'no_unreachable_default_argument_value' => true,
172+
'no_useless_return' => true,
173+
'no_whitespace_before_comma_in_array' => true,
174+
'no_whitespace_in_blank_line' => true,
175+
'normalize_index_brace' => true,
176+
'not_operator_with_successor_space' => true,
177+
'object_operator_without_whitespace' => true,
178+
'self_accessor' => false,
179+
'short_scalar_cast' => true,
180+
'simplified_null_return' => false, // disabled by Shift
181+
'single_blank_line_at_eof' => true,
182+
'single_blank_line_before_namespace' => true,
183+
'single_import_per_statement' => true,
184+
'single_line_after_imports' => true,
185+
'single_line_comment_style' => [
186+
'comment_types' => ['hash'],
187+
],
188+
'single_quote' => true,
189+
'space_after_semicolon' => true,
190+
'standardize_not_equals' => true,
191+
'switch_case_semicolon_to_colon' => true,
192+
'switch_case_space' => true,
193+
'ternary_operator_spaces' => true,
194+
'trim_array_spaces' => true,
195+
'unary_operator_spaces' => true,
196+
'whitespace_after_comma_in_array' => true,
197+
'constant_case' => ['case' => 'lower'],
198+
'psr_autoloading' => true,
199+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
200+
'binary_operator_spaces' => [
201+
'default' => 'single_space',
202+
],
203+
'types_spaces' => [
204+
'space' => 'none',
205+
],
206+
'blank_line_before_statement' => [
207+
'statements' => ['return'],
208+
],
209+
'class_definition' => [
210+
'multi_line_extends_each_single_line' => true,
211+
'single_item_single_line' => true,
212+
'single_line' => true,
213+
],
214+
'ordered_imports' => [
215+
'sort_algorithm' => 'alpha',
216+
],
217+
'no_unneeded_control_parentheses' => [
218+
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
219+
],
220+
'no_spaces_around_offset' => [
221+
'positions' => ['inside', 'outside'],
222+
],
223+
'visibility_required' => [
224+
'elements' => ['property', 'method', 'const'],
225+
],
226+
];
227+
228+
$finder = Finder::create()
229+
->in([
230+
__DIR__.'/src',
231+
__DIR__.'/tests',
232+
])
233+
->name('*.php')
234+
->notName('*.blade.php')
235+
->ignoreDotFiles(true)
236+
->ignoreVCS(true);
237+
238+
return (new Config)
239+
->setRules($rules)
240+
->setFinder($finder)
241+
->setRiskyAllowed(true)
242+
->setUsingCache(true);

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to `sebastiaanluca/php-pipe-operator` will be documented in
44

55
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

7+
## 5.0.0 (2022-03-17)
8+
9+
### Added
10+
11+
- Added support for PHP 8.1
12+
- Added support for first class callable syntax (PHP 8.1)
13+
14+
### Changed
15+
16+
- Cleaned up internals
17+
718
## 4.0.0 (2021-06-22)
819

920
### Added

0 commit comments

Comments
 (0)