Skip to content

Commit

Permalink
Resurrect, start from scratch, radically reduce feature set
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 12, 2023
1 parent 0797c79 commit c9e1263
Show file tree
Hide file tree
Showing 72 changed files with 53,023 additions and 56,174 deletions.
71 changes: 41 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,79 @@ on:

name: "CI"

env:
COMPOSER_ROOT_VERSION: "8.0-dev"

permissions:
contents: read

jobs:
coding-guidelines:
name: "Coding Guidelines"
name: Coding Guidelines

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: Checkout
uses: actions/checkout@v3

- name: "Run friendsofphp/php-cs-fixer"
run: "./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none

- name: Run PHP-CS-Fixer
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose

type-checker:
name: "Type Checker"
name: Type Checker

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: Checkout
uses: actions/checkout@v3

- name: "Update dependencies with composer"
run: "./tools/composer update --no-ansi --no-interaction --no-progress"
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none

- name: Install dependencies with Composer
run: ./tools/composer update --no-interaction --no-ansi --no-progress

- name: "Run vimeo/psalm"
run: "./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats"
- name: Run Psalm
run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats

tests:
name: "Tests"
name: Tests

runs-on: "ubuntu-latest"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install dependencies with composer"
- name: "Install dependencies with Composer"
run: "./tools/composer update --no-ansi --no-interaction --no-progress"

- name: "Run tests with phpunit/phpunit"
- name: "Run tests with PHPUnit"
run: "./tools/phpunit --coverage-clover=coverage.xml"

- name: "Send code coverage report to Codecov.io"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/.php-cs-fixer.php
/.php-cs-fixer.cache
/.phpunit.cache
/.psalm/cache
10 changes: 5 additions & 5 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="^1.26" installed="1.27.1" location="./tools/phpab" copy="true"/>
<phar name="phpunit" version="^9.5" installed="9.5.27" location="./tools/phpunit" copy="true"/>
<phar name="php-cs-fixer" version="^3.2" installed="3.13.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^4.11" installed="4.30.0" location="./tools/psalm" copy="true"/>
<phar name="composer" version="^2.1" installed="2.5.1" location="./tools/composer" copy="true"/>
<phar name="phpab" version="^1.28" installed="1.28.0" location="./tools/phpab" copy="true"/>
<phar name="phpunit" version="^10.3" installed="10.3.3" location="./tools/phpunit" copy="true"/>
<phar name="php-cs-fixer" version="^3.26" installed="3.26.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.15" installed="5.15.0" location="./tools/psalm" copy="true"/>
<phar name="composer" version="^2.6" installed="2.6.2" location="./tools/composer" copy="true"/>
</phive>
82 changes: 62 additions & 20 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@
'binary_operator_spaces' => [
'operators' => [
'=' => 'align_single_space_minimal',
'+=' => 'align_single_space_minimal',
'-=' => 'align_single_space_minimal',
'*=' => 'align_single_space_minimal',
'/=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
],
],
'blank_line_after_namespace' => true,
'blank_lines_before_namespace' => [
'max_line_breaks' => 1,
'min_line_breaks' => 0,
],
'blank_line_before_statement' => [
'statements' => [
'break',
'case',
'continue',
'declare',
'default',
Expand All @@ -43,6 +52,7 @@
'if',
'include',
'include_once',
'phpdoc',
'require',
'require_once',
'return',
Expand All @@ -51,17 +61,15 @@
'try',
'while',
'yield',
'yield_from',
],
],
'braces' => [
'position_after_anonymous_constructs' => 'next',
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'const' => 'none',
'method' => 'one',
'property' => 'one'
'property' => 'only_if_meta'
]
],
'class_definition' => true,
Expand All @@ -72,7 +80,14 @@
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'curly_braces_position' => [
'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'declare_strict_types' => true,
'dir_constant' => true,
'echo_tag_syntax' => true,
Expand All @@ -87,6 +102,7 @@
'function_declaration' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'get_class_to_class_keyword' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
Expand All @@ -97,9 +113,10 @@
'implode_call' => true,
'include' => true,
'increment_style' => [
'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST,
'style' => 'post',
],
'indentation_type' => true,
'integer_literal_case' => true,
'is_null' => true,
'lambda_not_used_import' => true,
'line_ending' => true,
Expand All @@ -113,21 +130,29 @@
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'method_chaining_indentation' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_constant_invocation' => false,
'native_function_casing' => false,
'native_function_invocation' => false,
'native_function_invocation' => [
'include' => [
'@internal',
],
],
'native_function_type_declaration_casing' => true,
'new_with_braces' => false,
'new_with_braces' => [
'named_class' => false,
'anonymous_class' => false,
],
'no_alias_functions' => true,
'no_alias_language_construct_call' => true,
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => true,
'no_break_comment' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
Expand All @@ -139,37 +164,41 @@
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ['use' => 'print'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiple_statements_per_line' => true,
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_space_around_double_colon' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_trailing_whitespace_in_string' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unneeded_import_alias' => true,
'no_unreachable_default_argument_value' => true,
'no_unset_cast' => true,
'no_unset_on_property' => true,
'no_unused_imports' => true,
'no_useless_concat_operator' => true,
'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'no_useless_return' => true,
'no_useless_sprintf' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'non_printable_character' => true,
'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
'octal_notation' => true,
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'end',
Expand Down Expand Up @@ -200,16 +229,17 @@
],
'ordered_imports' => [
'imports_order' => [
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST,
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION,
PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS,
'const',
'function',
'class',
]
],
'ordered_interfaces' => [
'direction' => 'ascend',
'order' => 'alpha',
],
'ordered_traits' => true,
'ordered_types' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
Expand All @@ -233,14 +263,15 @@
'uses',
],
],
'phpdoc_param_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true,
'phpdoc_to_comment' => true,
'phpdoc_to_comment' => false,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => ['groups' => ['simple', 'meta']],
Expand All @@ -262,14 +293,20 @@
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_spacing' => true,
'single_quote' => true,
'single_space_after_construct' => true,
'single_space_around_construct' => true,
'single_trait_insert_per_statement' => true,
'space_after_semicolon' => true,
'spaces_inside_parentheses' => [
'space' => 'none',
],
'standardize_increment' => true,
'standardize_not_equals' => true,
'statement_indentation' => true,
'static_lambda' => true,
'strict_param' => true,
'string_length_to_empty'=> true,
'string_line_ending' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
Expand All @@ -279,13 +316,18 @@
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline' => [
'elements' => [
'arrays'
'arguments',
'arrays',
'match',
]
],
'trim_array_spaces' => true,
'types_spaces' => [
'space' => 'none',
'type_declaration_spaces' => [
'elements' => [
'function',
],
],
'types_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
Expand Down
Loading

0 comments on commit c9e1263

Please sign in to comment.