Skip to content

Commit 10b8d81

Browse files
committed
Merge branch 'develop' into feature/FOUR-6179
2 parents 6e0bb43 + 182e6ef commit 10b8d81

693 files changed

Lines changed: 14536 additions & 15011 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.eslintignore‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
test/*
2-
__tests__/*
3-
node_modules/*
1+
test/
2+
__tests__/
3+
node_modules/
4+
vendor/
5+
public/
6+
**/coverage/**
7+
*.php

‎.eslintrc‎

Lines changed: 0 additions & 114 deletions
This file was deleted.

‎.eslintrc.js‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
browser: true,
6+
},
7+
globals: {
8+
Vue: true,
9+
BpmnModdle: true,
10+
Snap: true,
11+
Dispatcher: true,
12+
ProcessMaker: true,
13+
},
14+
extends: ["eslint:recommended", "plugin:vue/recommended", "airbnb-base"],
15+
parserOptions: {
16+
parser: "@babel/eslint-parser",
17+
sourceType: "module",
18+
ecmaVersion: 2020,
19+
babelOptions: {
20+
configFile: "./babel.config.json",
21+
},
22+
},
23+
plugins: [
24+
"vue",
25+
],
26+
rules: {
27+
quotes: ["error", "double"],
28+
"max-len": ["error", {
29+
code: 140,
30+
ignoreComments: true,
31+
}],
32+
},
33+
overrides: [
34+
{
35+
files: [
36+
"tests/**/*.js",
37+
],
38+
plugins: ["jest"],
39+
extends: ["plugin:jest/recommended"],
40+
},
41+
],
42+
};

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ coverage
3737
cypress/screenshots
3838
cypress/videos
3939
cypress/downloads
40+
.php-cs-fixer.cache

‎.php-cs-fixer.php‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$rules = [
7+
'array_indentation' => true,
8+
'array_syntax' => ['syntax' => 'short'],
9+
'binary_operator_spaces' => [
10+
'default' => 'single_space',
11+
'operators' => ['=>' => null],
12+
],
13+
'blank_line_after_namespace' => true,
14+
'blank_line_after_opening_tag' => true,
15+
'blank_line_before_statement' => [
16+
'statements' => ['return'],
17+
],
18+
'braces' => true,
19+
'cast_spaces' => true,
20+
'class_attributes_separation' => [
21+
'elements' => [
22+
'const' => 'one',
23+
'method' => 'one',
24+
'property' => 'one',
25+
'trait_import' => 'none',
26+
],
27+
],
28+
'class_definition' => [
29+
'multi_line_extends_each_single_line' => true,
30+
'single_item_single_line' => true,
31+
'single_line' => true,
32+
],
33+
'concat_space' => [
34+
'spacing' => 'one',
35+
],
36+
'constant_case' => ['case' => 'lower'],
37+
'declare_equal_normalize' => true,
38+
'elseif' => true,
39+
'encoding' => true,
40+
'full_opening_tag' => true,
41+
'fully_qualified_strict_types' => true, // added by Shift
42+
'function_declaration' => true,
43+
'function_typehint_space' => true,
44+
'general_phpdoc_tag_rename' => true,
45+
'heredoc_to_nowdoc' => true,
46+
'include' => true,
47+
'increment_style' => ['style' => 'post'],
48+
'indentation_type' => true,
49+
'linebreak_after_opening_tag' => true,
50+
'line_ending' => true,
51+
'lowercase_cast' => true,
52+
'lowercase_keywords' => true,
53+
'lowercase_static_reference' => true, // added from Symfony
54+
'magic_method_casing' => true, // added from Symfony
55+
'magic_constant_casing' => true,
56+
'method_argument_space' => [
57+
'on_multiline' => 'ignore',
58+
],
59+
'multiline_whitespace_before_semicolons' => [
60+
'strategy' => 'no_multi_line',
61+
],
62+
'native_function_casing' => true,
63+
'no_alias_functions' => true,
64+
'no_extra_blank_lines' => [
65+
'tokens' => [
66+
'extra',
67+
'throw',
68+
'use',
69+
],
70+
],
71+
'no_blank_lines_after_class_opening' => true,
72+
'no_blank_lines_after_phpdoc' => true,
73+
'no_closing_tag' => true,
74+
'no_empty_phpdoc' => true,
75+
'no_empty_statement' => true,
76+
'no_leading_import_slash' => true,
77+
'no_leading_namespace_whitespace' => true,
78+
'no_mixed_echo_print' => [
79+
'use' => 'echo',
80+
],
81+
'no_multiline_whitespace_around_double_arrow' => true,
82+
'no_short_bool_cast' => true,
83+
'no_singleline_whitespace_before_semicolons' => true,
84+
'no_spaces_after_function_name' => true,
85+
'no_spaces_around_offset' => [
86+
'positions' => ['inside', 'outside'],
87+
],
88+
'no_spaces_inside_parenthesis' => true,
89+
'no_trailing_comma_in_list_call' => true,
90+
'no_trailing_comma_in_singleline_array' => true,
91+
'no_trailing_whitespace' => true,
92+
'no_trailing_whitespace_in_comment' => true,
93+
'no_unneeded_control_parentheses' => [
94+
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
95+
],
96+
'no_unreachable_default_argument_value' => true,
97+
'no_useless_return' => true,
98+
'no_whitespace_before_comma_in_array' => true,
99+
'no_whitespace_in_blank_line' => true,
100+
'normalize_index_brace' => true,
101+
'object_operator_without_whitespace' => true,
102+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
103+
'psr_autoloading' => true,
104+
'phpdoc_indent' => true,
105+
'phpdoc_inline_tag_normalizer' => true,
106+
'phpdoc_no_access' => true,
107+
'phpdoc_no_package' => true,
108+
'phpdoc_no_useless_inheritdoc' => true,
109+
'phpdoc_scalar' => true,
110+
'phpdoc_single_line_var_spacing' => true,
111+
'phpdoc_summary' => false,
112+
'phpdoc_to_comment' => false, // override to preserve user preference
113+
'phpdoc_tag_type' => true,
114+
'phpdoc_trim' => true,
115+
'phpdoc_types' => true,
116+
'phpdoc_var_without_name' => true,
117+
'self_accessor' => true,
118+
'short_scalar_cast' => true,
119+
'simplified_null_return' => false, // disabled as "risky"
120+
'single_blank_line_at_eof' => true,
121+
'single_blank_line_before_namespace' => true,
122+
'single_class_element_per_statement' => [
123+
'elements' => ['const', 'property'],
124+
],
125+
'single_import_per_statement' => true,
126+
'single_line_after_imports' => true,
127+
'single_line_comment_style' => [
128+
'comment_types' => ['hash'],
129+
],
130+
'single_quote' => true,
131+
'space_after_semicolon' => true,
132+
'standardize_not_equals' => true,
133+
'switch_case_semicolon_to_colon' => true,
134+
'switch_case_space' => true,
135+
'ternary_operator_spaces' => true,
136+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
137+
'trim_array_spaces' => true,
138+
'unary_operator_spaces' => true,
139+
'visibility_required' => [
140+
'elements' => ['method', 'property'],
141+
],
142+
'whitespace_after_comma_in_array' => true,
143+
];
144+
145+
$directoriesToCheck = [
146+
'ProcessMaker',
147+
'config',
148+
'database',
149+
'resources',
150+
'routes',
151+
'tests',
152+
'src', // packages
153+
];
154+
155+
$directories = [];
156+
foreach ($directoriesToCheck as $dir) {
157+
if (is_dir($dir)) {
158+
$directories[] = $dir;
159+
}
160+
}
161+
162+
$finder = Finder::create()
163+
->in($directories)
164+
->name('*.php')
165+
->notName('*.blade.php')
166+
->ignoreDotFiles(true)
167+
->ignoreVCS(true);
168+
169+
return (new Config)
170+
->setFinder($finder)
171+
->setRules($rules)
172+
->setRiskyAllowed(true)
173+
->setUsingCache(true);

‎.pre-commit‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
export PATH="$PATH:$HOME/.composer/vendor/bin"
4+
5+
if ! command -v php-cs-fixer &> /dev/null; then
6+
echo "php-cs-fixer could not be found"
7+
echo "It must be installed globally with composer: composer global require friendsofphp/php-cs-fixer"
8+
echo "Make sure it's in your \$PATH"
9+
exit 1
10+
fi
11+
12+
13+
pm4dir="$(dirname "$(readlink -f "$0")")"
14+
files=$(git status --porcelain=v2 | grep -E '^\d [AM].*\.php$' | cut -d ' ' -f 9)
15+
errors=()
16+
if [ -n "$files" ]; then
17+
while read file; do
18+
echo "Checking $file"
19+
php-cs-fixer fix --dry-run --verbose "$file" 2> /dev/null
20+
if [ $? -ne 0 ]; then
21+
errors+=("$file")
22+
fi
23+
done <<< "$files"
24+
fi
25+
26+
27+
if [ ${#errors[@]} -gt 0 ]; then
28+
echo ""
29+
echo "php-cs-fixer failed for files: ${errors[@]}"
30+
echo ""
31+
echo "You can attempt to fix these automatically by running 'php-cs-fixer fix [file]'"
32+
echo ""
33+
exit 1
34+
fi

0 commit comments

Comments
 (0)