Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiaanluca committed Mar 17, 2022
2 parents c99cd52 + 5321d44 commit 7d91339
Show file tree
Hide file tree
Showing 16 changed files with 445 additions and 65 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.github export-ignore
/.gitignore export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/.php_cs.dist.php export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
12 changes: 3 additions & 9 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ assignees: sebastiaanluca

### Steps to reproduce

1.
2.
3.
Please provide a fully working repository that reproduces the bug.

### Traces
### Additional info

Logs, error output, etc.

### Environment information

Setup, environment, packages, versions, etc.
Logs, error output, setup, environment, packages, versions, etc.
32 changes: 20 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
name: test
name: Check code

on:
push:
pull_request:
schedule:
- cron: '0 12 15 * *'

jobs:
test:

check:
name: Run checks - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [8.0]
php: [8.0, 8.1]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest]

name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Cache dependencies
- name: Cache PHP dependencies
uses: actions/cache@v2
with:
path: '**/vendor'
key: ${{ runner.os }}-vendor-cache-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-vendor-cache-
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
key: composer-${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('composer.json') }}

- name: Validate Composer configuration file
run: composer validate --strict
Expand All @@ -39,8 +45,10 @@ jobs:
coverage: none

- name: Install dependencies
run: |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Lint code
run: vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Execute tests
- name: Run tests
run: vendor/bin/phpunit
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.idea
.php-cs-fixer.cache
.phpunit.result.cache
/.idea
composer.lock
composer.phar
phpunit.xml
tests/temp/
vendor/
242 changes: 242 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
<?php

// Last reviewed: v2.19 (Testament)
// Based on https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'@PSR1' => true,
'@PSR2' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@PHP73Migration' => true,
'@PHPUnit75Migration:risky' => true,
'final_class' => false,
'new_with_braces' => false,
'strict_comparison' => true,
'list_syntax' => ['syntax' => 'short'],
'mb_str_functions' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'throw',
'use',
'use_trait',
'switch',

'case',
'default',
],
],
'no_blank_lines_before_namespace' => false,
'nullable_type_declaration_for_default_null_value' => true,
'increment_style' => ['style' => 'pre'],
'self_static_accessor' => true,
'static_lambda' => false,
'no_empty_phpdoc' => true,
'no_superfluous_phpdoc_tags' => [
'remove_inheritdoc' => true,
],
'phpdoc_line_span' => [
'const' => 'multi',
'method' => 'multi',
'property' => 'multi',
],
'general_phpdoc_tag_rename' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => true],
'phpdoc_align' => ['align' => 'left'],
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_empty_return' => false,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_order_by_value' => false,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_tag_casing' => ['tags' => ['inheritDoc']],
'phpdoc_tag_type' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_types' => ['groups' => ['simple', 'alias']],
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
'php_unit_test_class_requires_covers' => false,
'php_unit_internal_class' => false,
'yoda_style' => false,
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant_public',
'constant_protected',
'constant_private',

'property_static',
'property_public_static',
'property_protected_static',
'property_private_static',

'property',
'property_public',
'property_protected',
'property_private',

'construct',
'destruct',
'magic',

'method_static',
'method_public_abstract_static',
'method_public_static',
'method_protected_abstract_static',
'method_protected_static',
'method_private_static',
'method_public_abstract',
'method_public',
'method_protected_abstract',
'method_protected',
'method_private',
],
],
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'braces' => true,
'cast_spaces' => true,
'concat_space' => [
'spacing' => 'none',
],
'declare_equal_normalize' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true, // added by Shift
'function_declaration' => true,
'function_typehint_space' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'indentation_type' => true,
'linebreak_after_opening_tag' => true,
'line_ending' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true, // added from Symfony
'magic_method_casing' => true, // added from Symfony
'magic_constant_casing' => true,
'method_argument_space' => true,
'native_function_casing' => true,
'no_alias_functions' => false,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => [
'use' => 'echo',
],
'no_multiline_whitespace_around_double_arrow' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_comma_in_list_call' => false,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'self_accessor' => false,
'short_scalar_cast' => true,
'simplified_null_return' => false, // disabled by Shift
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'constant_case' => ['case' => 'lower'],
'psr_autoloading' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'binary_operator_spaces' => [
'default' => 'single_space',
],
'types_spaces' => [
'space' => 'none',
],
'blank_line_before_statement' => [
'statements' => ['return'],
],
'class_definition' => [
'multi_line_extends_each_single_line' => true,
'single_item_single_line' => true,
'single_line' => true,
],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'no_unneeded_control_parentheses' => [
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
],
'no_spaces_around_offset' => [
'positions' => ['inside', 'outside'],
],
'visibility_required' => [
'elements' => ['property', 'method', 'const'],
],
];

$finder = Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new Config)
->setRules($rules)
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(true);
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to `sebastiaanluca/php-pipe-operator` will be documented in

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

## 5.0.0 (2022-03-17)

### Added

- Added support for PHP 8.1
- Added support for first class callable syntax (PHP 8.1)

### Changed

- Cleaned up internals

## 4.0.0 (2021-06-22)

### Added
Expand Down
Loading

0 comments on commit 7d91339

Please sign in to comment.