Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQONE-699]: PHP 7.4+ support #129

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
root = true

# Base styles from WordPress Coding Standards
# https://github.com/WordPress/wordpress-develop/blob/master/.editorconfig

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

# Indentation override for all JS
[*.js]
indent_style = tab

[*.json]
indent_style = space
tab_width = 4

[*.php]
indent_style = tab
indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = false
ij_php_align_assignments = true
ij_php_align_class_constants = true
ij_php_align_group_field_declarations = false
ij_php_align_inline_comments = false
ij_php_align_key_value_pairs = true
ij_php_align_multiline_array_initializer_expression = true
ij_php_align_phpdoc_comments = true
ij_php_align_phpdoc_param_names = true
ij_smart_tabs = true
ij_php_array_initializer_new_line_after_left_brace = true
ij_php_array_initializer_right_brace_on_new_line = true
ij_php_array_initializer_wrap = on_every_item
ij_php_blank_lines_after_class_header = 0
ij_php_blank_lines_after_function = 1
ij_php_blank_lines_after_imports = 1
ij_php_blank_lines_after_opening_tag = 0
ij_php_blank_lines_after_package = 0
ij_php_blank_lines_around_class = 1
ij_php_blank_lines_around_constants = 0
ij_php_blank_lines_around_field = 0
ij_php_blank_lines_around_method = 1
ij_php_blank_lines_before_class_end = 0
ij_php_blank_lines_before_imports = 1
ij_php_blank_lines_before_method_body = 0
ij_php_blank_lines_before_package = 1
ij_php_blank_lines_before_return_statement = 1
ij_php_block_brace_style = end_of_line
ij_php_class_brace_style = end_of_line
ij_php_comma_after_last_array_element = true
ij_php_concat_spaces = true
ij_php_do_while_brace_force = always
ij_php_else_on_new_line = false
ij_php_fields_default_visibility = private
ij_php_finally_on_new_line = false
ij_php_for_brace_force = always
ij_php_force_short_declaration_array_style = true
ij_php_group_use_wrap = on_every_item
ij_php_if_brace_force = always
ij_php_import_sorting = alphabetic
ij_php_indent_break_from_case = true
ij_php_indent_case_from_switch = true
ij_php_indent_code_in_php_tags = false
ij_php_keep_blank_lines_after_lbrace = 1
ij_php_keep_blank_lines_before_right_brace = 1
ij_php_keep_blank_lines_in_code = 2
ij_php_keep_blank_lines_in_declarations = 2
ij_php_keep_indents_on_empty_lines = false
ij_php_keep_line_breaks = true
ij_php_keep_rparen_and_lbrace_on_one_line = true
ij_php_keep_simple_methods_in_one_line = false
ij_php_lambda_brace_style = end_of_line
ij_php_lower_case_boolean_const = true
ij_php_lower_case_null_const = true
ij_php_method_brace_style = end_of_line
ij_php_namespace_brace_style = 1
ij_php_phpdoc_blank_line_before_tags = true
ij_php_phpdoc_blank_lines_around_parameters = true
ij_php_phpdoc_keep_blank_lines = true
ij_php_phpdoc_param_spaces_between_name_and_description = 1
ij_php_phpdoc_param_spaces_between_tag_and_type = 1
ij_php_phpdoc_param_spaces_between_type_and_name = 1
ij_php_phpdoc_use_fqcn = true
ij_php_phpdoc_wrap_long_lines = true
ij_php_space_after_colon = true
ij_php_space_after_colon_in_return_type = true
ij_php_space_after_comma = true
ij_php_space_after_for_semicolon = true
ij_php_space_after_quest = true
ij_php_space_after_type_cast = true
ij_php_space_after_unary_not = true
ij_php_space_before_array_initializer_left_brace = false
ij_php_space_before_catch_keyword = true
ij_php_space_before_catch_left_brace = true
ij_php_space_before_catch_parentheses = true
ij_php_space_before_class_left_brace = true
ij_php_space_before_closure_left_parenthesis = true
ij_php_space_before_colon = true
ij_php_space_before_colon_in_return_type = false
ij_php_space_before_comma = false
ij_php_space_before_do_left_brace = true
ij_php_space_before_else_keyword = true
ij_php_space_before_else_left_brace = true
ij_php_space_before_finally_keyword = true
ij_php_space_before_finally_left_brace = true
ij_php_space_before_for_left_brace = true
ij_php_space_before_for_parentheses = true
ij_php_space_before_for_semicolon = false
ij_php_space_before_if_left_brace = true
ij_php_space_before_if_parentheses = true
ij_php_space_before_method_call_parentheses = false
ij_php_space_before_method_left_brace = true
ij_php_space_before_method_parentheses = false
ij_php_space_before_quest = true
ij_php_space_before_switch_left_brace = true
ij_php_space_before_switch_parentheses = true
ij_php_space_before_try_left_brace = true
ij_php_space_before_unary_not = true
ij_php_space_before_while_keyword = true
ij_php_space_before_while_left_brace = true
ij_php_space_before_while_parentheses = true
ij_php_space_between_ternary_quest_and_colon = false
ij_php_spaces_around_additive_operators = true
ij_php_spaces_around_arrow = false
ij_php_spaces_around_assignment_in_declare = false
ij_php_spaces_around_assignment_operators = true
ij_php_spaces_around_bitwise_operators = true
ij_php_spaces_around_equality_operators = true
ij_php_spaces_around_logical_operators = true
ij_php_spaces_around_multiplicative_operators = true
ij_php_spaces_around_null_coalesce_operator = true
ij_php_spaces_around_relational_operators = true
ij_php_spaces_around_shift_operators = true
ij_php_spaces_around_unary_operator = true
ij_php_spaces_around_var_within_brackets = true
ij_php_spaces_within_array_initializer_braces = true
ij_php_spaces_within_brackets = false
ij_php_spaces_within_catch_parentheses = true
ij_php_spaces_within_for_parentheses = true
ij_php_spaces_within_if_parentheses = true
ij_php_spaces_within_method_call_parentheses = true
ij_php_spaces_within_method_parentheses = true
ij_php_spaces_within_parentheses = true
ij_php_spaces_within_short_echo_tags = true
ij_php_spaces_within_switch_parentheses = true
ij_php_spaces_within_while_parentheses = true
ij_php_special_else_if_treatment = true
ij_php_ternary_operation_signs_on_next_line = false
ij_php_ternary_operation_wrap = off
ij_php_upper_case_boolean_const = false
ij_php_upper_case_null_const = false
ij_php_variable_naming_style = snake_case
ij_php_while_brace_force = always
ij_php_while_on_new_line = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.editorconfig export-ignore
/monorepo.sh export-ignore
/monorepo-builder.php export-ignore
/tests export-ignore
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: PHP Code Sniffer and Static Analysis

on:
workflow_dispatch:
pull_request:
paths:
- 'src/**.php'
Expand All @@ -13,7 +14,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.3' ]
php-versions: [ '7.4' ]

env:
cache_version: 1 # increment to flush all caches
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.3', '7.4' ]
wordpress-version: [ 'latest', '5.3.2' ]
php-versions: [ '7.4', '8.0', '8.1' ]
wordpress-version: [ 'latest', '5.3.12', '5.9.3' ]
exclude:
- php-versions: '8.0'
wordpress-version: '5.3.12'
- php-versions: '8.1'
wordpress-version: '5.3.12'
fail-fast: false

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

env:
cache_version: 1 # increment to flush all caches
php_version: '7.3'
php_version: '7.4'

steps:

Expand Down
28 changes: 13 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,25 @@
}
],
"require": {
"php": "^7.2",
"php": ">=7.4",
"ext-json": "*",
"composer-plugin-api": "^1.0 || ^2.0",
"enshrined/svg-sanitize": "^0.15.4",
"filp/whoops": "^2.2@dev",
"mhcg/monolog-wp-cli": "^1.0",
"monolog/monolog": "^2.0",
"mhcg/monolog-wp-cli": "^1.2",
"monolog/monolog": "^2.5",
"php-di/php-di": "^6.0",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"twig/twig": "^3.0"
},
"require-dev": {
"automattic/phpcs-neutron-standard": "^1.5",
"automattic/vipwpcs": "^2.0.0",
"composer/composer": "^1.0 || ^2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || ^0.7.0",
"lucatume/wp-browser": "^3.0.9",
"phpcompatibility/php-compatibility": "*",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"phpstan/phpstan": "^0.12.25",
"phpunit/phpunit": "^8.0",
"sirbrillig/phpcs-variable-analysis": "^2.0.1",
"squizlabs/php_codesniffer": "^3.4.2",
"moderntribe/coding-standards": "^3.0",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^8.0 || ^9.0 <9.5",
"symplify/monorepo-builder": "^8.2",
"szepeviktor/phpstan-wordpress": "^0.6.0",
"szepeviktor/phpstan-wordpress": "^1.0",
"wp-cli/wp-cli": "^2.5"
},
"autoload": {
Expand Down Expand Up @@ -113,16 +108,19 @@
"moderntribe/square1-whoops": "self.version"
},
"config": {
"sort-packages": true,
"vendor-dir": "vendor",
"preferred-install": "dist",
"platform": {
"php": "7.2.32"
"php": "7.4.7"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"cweagans/composer-patches": true
}
},
"extra": {
"enable-patching": true,
"branch-alias": {
"dev-master": "3.7-dev"
}
Expand Down
Loading