Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 12 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
composer.lock
/vendor/*
.idea
locale.pot
frontend-dev/yarn.lock
vendor/
assets
assets/
languages/
frontend-dev/.eslintrc.js
.vscode/settings.json
.idea
frontend-dev/package-lock.json
frontend-dev/yarn-error.log

vendor/
node_modules
yarn.lock
.npmrc

composer.lock
package-lock.json
build-hash.txt
pnpm-lock.yaml
yarn.lock
yarn-error.log

.php-cs-fixer.cache
build-hash.txt
156 changes: 156 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude([
__DIR__ . '/vendor',
])
->in([
__DIR__ . '/includes',
__DIR__ . '/views',
])
->ignoreVCSIgnored(true);

$config = new PhpCsFixer\Config();

return $config
->setRiskyAllowed(true)
->setIndent(str_pad('', 4))
->setRules([
'@PSR2' => true,
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
'array_indentation' => true,
'array_push' => true,
'array_syntax' => true,
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align_single_space_minimal',
// '=' => 'align_single_space_minimal',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => false,
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => true,
'blank_line_between_import_groups' => true,
'braces' => ['allow_single_line_anonymous_class_with_empty_body' => true],
'cast_spaces' => true,
'class_attributes_separation' => true,
'class_definition' => true,
'class_reference_name_casing' => true,
'clean_namespace' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'comment_to_phpdoc' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'curly_braces_position' => true,
'dir_constant' => true,
'elseif' => true,
'empty_loop_body' => true,
'empty_loop_condition' => true,
'encoding' => true,
'ereg_to_preg' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'function_declaration' => true,
'function_to_constant' => true,
'global_namespace_import' => ['import_constants' => false, 'import_functions' => false, 'import_classes' => true],
'group_import' => false,
'include' => true,
'indentation_type' => true,
'integer_literal_case' => true,
'line_ending' => true,
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_chaining_indentation' => true,
'visibility_required' => true,
'whitespace_after_comma_in_array' => true,
'space_after_semicolon' => true,
'trim_array_spaces' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => false,
'no_whitespace_before_comma_in_array' => true,
'native_function_casing' => true,
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
'new_with_braces' => 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_break_comment' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_multiple_statements_per_line' => true,
'no_null_property_initialization' => 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_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_in_blank_line' => true,
'no_spaces_inside_parenthesis' => true,
'object_operator_without_whitespace' => true,
'operator_linebreak' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_internal_class' => true,
'php_unit_method_casing' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_line_span' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true,
'random_api_migration' => true,
'return_assignment' => true,
'simplified_if_return' => true,
'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_spacing' => true,
'single_line_comment_style' => true,
'single_line_throw' => true,
'single_quote' => true,
'single_space_after_construct' => true,
'standardize_increment' => true,
'standardize_not_equals' => true,
'statement_indentation' => true,
'switch_continue_to_break' => true,
'ternary_operator_spaces' => true,
])
->setFinder($finder);
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"junstyle.php-cs-fixer",
"bmewburn.vscode-intelephense-client",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"cipchk.cssrem"
]
}
84 changes: 84 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"php-cs-fixer.onsave": true,
"php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer",
"php-cs-fixer.documentFormattingProvider": true,
"php-cs-fixer.executablePathWindows": "${workspaceFolder}\\vendor\\bin\\php-cs-fixer.bat",
"php-cs-fixer.config": ".php-cs-fixer.php",
"search.useGlobalIgnoreFiles": false,
"search.useParentIgnoreFiles": false,
"prettier.enable": true,
"prettier.prettierPath": "frontend-dev/node_modules/prettier/index.cjs",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"stylelint.snippet": [
"css",
"scss"
],
"stylelint.validate": [
"css",
"scss",
"postcss"
],
"files.eol": "\n",
"search.exclude": {
"**/.git": true,
"**/.github": true,
"**/.nuxt": true,
"**/.output": true,
"**/.pnpm": true,
"**/.vscode": true,
"**/.yarn": true,
"**/bower_components": true,
"**/dist/**": true,
"**/logs": true,
"**/node_modules": true,
"**/out/**": true,
"**/package-lock.json": true,
"**/pnpm-lock.yaml": true,
"**/tmp": true,
"**/yarn.lock": true,
"**/vendor": true,
"**/tests/__libs": true,
},
"typescript.tsdk": "frontend-dev\\node_modules\\typescript\\lib",
"css.lint.validProperties": [
"composes"
],
"cSpell.words": [
"ABSPATH",
"antd",
"autoload",
"bitapps",
"bitappspi",
"commitlint",
"compat",
"cssinjs",
"dealerdirect",
"friendsofphp",
"immer",
"incstr",
"intelephense",
"lefthook",
"Lucide",
"phpcodesniffer",
"phpcompatibility",
"phpcs",
"phpunit",
"pnpm",
"Popconfirm",
"Sider",
"sirbrillig",
"stylelint",
"testdox",
"yoast"
],
"[typescript, javascript, typescriptreact, json, css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer"
},
}
1 change: 0 additions & 1 deletion build-hash.txt

This file was deleted.

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"require-dev": {
"phpcompatibility/phpcompatibility-wp": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"friendsofphp/php-cs-fixer": "^3.54"
},
"scripts": {
"version-checker": "phpcs -p --standard=PHPCompatibilityWP --runtime-set testVersion 5.6- includes"
Expand Down
Loading