Skip to content

Commit 4a023a5

Browse files
authored
Merge pull request #1 from phpfui/Update_dependencies
Update dependencies
2 parents 4e01a43 + c680b81 commit 4a023a5

34 files changed

+328
-328
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ infection.log
55
.idea/
66
.php_cs.cache
77
*.swp
8+
.phpunit.result.cache
9+
.php-cs-fixer.cache

.phan/config.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
4444
// (See `backward_compatibility_checks` for additional options)
4545
// Automatically inferred from composer.json requirement for "php" of ">=7.1"
46-
'target_php_version' => '7.1',
46+
'target_php_version' => '7.3',
4747

4848
// If enabled, missing properties will be created when
4949
// they are first seen. If false, we'll report an
@@ -367,12 +367,11 @@
367367
// your application should be included in this list.
368368
'directory_list' => [
369369
'src/PHPHtmlParser',
370-
'vendor/infection/infection/src',
371-
'vendor/mockery/mockery/library',
370+
'vendor/myclabs/php-enum/src',
372371
'vendor/paquettg/string-encode/src',
373-
'vendor/phan/phan/src/Phan',
374-
'vendor/php-coveralls/php-coveralls/src',
375-
'vendor/phpunit/phpunit/src',
372+
'vendor/guzzlehttp/psr7/src',
373+
'vendor/guzzlehttp/guzzle/src',
374+
'vendor/psr/http-client/src',
376375
],
377376

378377
// A list of individual files to include in analysis
Lines changed: 154 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,154 @@
1-
<?php
2-
3-
$finder = PhpCsFixer\Finder::create()
4-
->in('src')
5-
->in('tests')
6-
;
7-
8-
return PhpCsFixer\Config::create()
9-
->setRiskyAllowed(true)
10-
->setRules([
11-
'array_indentation' => true,
12-
'array_syntax' => ['syntax' => 'short'],
13-
'binary_operator_spaces' => ['align_double_arrow'=>true],
14-
'blank_line_after_namespace' => true,
15-
'blank_line_after_opening_tag' => true,
16-
'blank_line_before_statement' => ['statements'=>['return']],
17-
'braces' => ['allow_single_line_closure' => false],
18-
'cast_spaces' => true,
19-
'class_attributes_separation' => ['elements'=>['method']],
20-
'class_definition' => ['single_line'=>true],
21-
'combine_consecutive_issets' => true,
22-
'concat_space' => ['spacing' => 'one'],
23-
'declare_equal_normalize' => true,
24-
'elseif' => true,
25-
'encoding' => true,
26-
'full_opening_tag' => true,
27-
'function_declaration' => true,
28-
'function_typehint_space' => true,
29-
'include' => true,
30-
'increment_style' => true,
31-
'indentation_type' => true,
32-
'line_ending' => true,
33-
'linebreak_after_opening_tag' => true,
34-
'lowercase_cast' => true,
35-
'lowercase_keywords' => true,
36-
'lowercase_static_reference' => true,
37-
'magic_constant_casing' => true,
38-
'magic_method_casing' => true,
39-
'mb_str_functions' => false,
40-
'method_argument_space' => true,
41-
'native_function_casing' => true,
42-
'native_function_invocation' => true,
43-
'native_function_type_declaration_casing' => true,
44-
'new_with_braces' => true,
45-
'no_blank_lines_after_class_opening' => true,
46-
'no_blank_lines_after_phpdoc' => true,
47-
'no_break_comment' => true,
48-
'no_closing_tag' => true,
49-
'no_empty_comment' => true,
50-
'no_empty_phpdoc' => true,
51-
'no_empty_statement' => true,
52-
'no_extra_blank_lines' => ['tokens'=>[
53-
'curly_brace_block',
54-
'extra',
55-
'parenthesis_brace_block',
56-
'square_brace_block',
57-
'throw',
58-
'use',
59-
]],
60-
'no_leading_import_slash' => true,
61-
'no_leading_namespace_whitespace' => true,
62-
'no_mixed_echo_print' => true,
63-
'no_multiline_whitespace_around_double_arrow' => true,
64-
'no_null_property_initialization' => true,
65-
'no_short_bool_cast' => true,
66-
'no_singleline_whitespace_before_semicolons' => true,
67-
'no_superfluous_elseif' => true,
68-
'no_spaces_after_function_name' => true,
69-
'no_spaces_around_offset' => true,
70-
'no_spaces_inside_parenthesis' => true,
71-
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'allow_unused_params' => true],
72-
'no_trailing_comma_in_list_call' => true,
73-
'no_trailing_comma_in_singleline_array' => true,
74-
'no_trailing_whitespace' => true,
75-
'no_trailing_whitespace_in_comment' => true,
76-
'no_unneeded_control_parentheses' => true,
77-
'no_unneeded_curly_braces' => ['namespaces' => true],
78-
'no_unused_imports' => true,
79-
'no_useless_else' => true,
80-
'no_useless_return' => true,
81-
'no_whitespace_before_comma_in_array' => true,
82-
'no_whitespace_in_blank_line' => true,
83-
'normalize_index_brace' => true,
84-
'not_operator_with_space' => false,
85-
'object_operator_without_whitespace' => true,
86-
'ordered_class_elements' => true,
87-
'ordered_imports' => true,
88-
'php_unit_fqcn_annotation' => true,
89-
'phpdoc_align' => ['tags' => [
90-
'method',
91-
'param',
92-
'property',
93-
'property-read',
94-
'return',
95-
'throws',
96-
'type',
97-
'var',
98-
]],
99-
'phpdoc_add_missing_param_annotation' => true,
100-
'phpdoc_annotation_without_dot' => true,
101-
'phpdoc_indent' => true,
102-
'phpdoc_inline_tag' => true,
103-
'phpdoc_no_access' => true,
104-
'phpdoc_no_alias_tag' => false,
105-
'phpdoc_no_package' => true,
106-
'phpdoc_no_useless_inheritdoc' => true,
107-
'phpdoc_order' => true,
108-
'phpdoc_return_self_reference' => true,
109-
'phpdoc_scalar' => true,
110-
'phpdoc_separation' => true,
111-
'phpdoc_single_line_var_spacing' => true,
112-
'phpdoc_summary' => true,
113-
'phpdoc_to_comment' => true,
114-
'phpdoc_trim' => true,
115-
'phpdoc_trim_consecutive_blank_line_separation' => true,
116-
'phpdoc_types' => true,
117-
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
118-
'phpdoc_var_without_name' => true,
119-
'return_assignment' => true,
120-
'return_type_declaration' => true,
121-
'semicolon_after_instruction' => true,
122-
'simplified_null_return' => true,
123-
'short_scalar_cast' => true,
124-
'single_blank_line_at_eof' => true,
125-
'single_blank_line_before_namespace' => true,
126-
'single_class_element_per_statement' => true,
127-
'single_import_per_statement' => true,
128-
'single_line_after_imports' => true,
129-
'single_line_comment_style' => ['comment_types' => ['hash']],
130-
'single_line_throw' => true,
131-
'single_quote' => true,
132-
'single_trait_insert_per_statement' => true,
133-
'space_after_semicolon' => ['remove_in_empty_for_expressions'=>true],
134-
'standardize_increment' => true,
135-
'standardize_not_equals' => true,
136-
'switch_case_semicolon_to_colon' => true,
137-
'switch_case_space' => true,
138-
'ternary_operator_spaces' => true,
139-
'ternary_to_null_coalescing' => true,
140-
'trailing_comma_in_multiline_array' => true,
141-
'trim_array_spaces' => true,
142-
'unary_operator_spaces' => true,
143-
'visibility_required' => true,
144-
'whitespace_after_comma_in_array' => true,
145-
'yoda_style' => false,
146-
])
147-
->setFinder($finder)
148-
->setCacheFile(__DIR__.'/.php_cs.cache')
149-
;
1+
<?php
2+
3+
$config = new PhpCsFixer\Config();
4+
return $config
5+
->setRiskyAllowed(true)
6+
->setRules([
7+
'array_indentation' => true,
8+
'array_syntax' => ['syntax' => 'short'],
9+
'binary_operator_spaces' => true,
10+
'blank_line_after_namespace' => true,
11+
'blank_line_after_opening_tag' => true,
12+
'blank_line_before_statement' => ['statements'=>['return']],
13+
'braces' => ['allow_single_line_closure' => false],
14+
'cast_spaces' => true,
15+
// 'class_attributes_separation' => ['const' => 'one','method' => 'one','property' => 'one','trait_import' => 'none'],
16+
'class_definition' => ['single_line'=>true],
17+
'combine_consecutive_issets' => true,
18+
'concat_space' => ['spacing' => 'one'],
19+
'declare_equal_normalize' => true,
20+
'elseif' => true,
21+
'encoding' => true,
22+
'full_opening_tag' => true,
23+
'function_declaration' => true,
24+
'function_typehint_space' => true,
25+
'include' => true,
26+
'increment_style' => true,
27+
'indentation_type' => true,
28+
'line_ending' => true,
29+
'linebreak_after_opening_tag' => true,
30+
'lowercase_cast' => true,
31+
'lowercase_keywords' => true,
32+
'lowercase_static_reference' => true,
33+
'magic_constant_casing' => true,
34+
'magic_method_casing' => true,
35+
'mb_str_functions' => false,
36+
'method_argument_space' => true,
37+
'native_function_casing' => true,
38+
'native_function_invocation' => ['include'=>['@all']],
39+
'native_function_type_declaration_casing' => true,
40+
'new_with_braces' => true,
41+
'no_blank_lines_after_class_opening' => true,
42+
'no_blank_lines_after_phpdoc' => true,
43+
'no_break_comment' => true,
44+
'no_closing_tag' => true,
45+
'no_empty_comment' => true,
46+
'no_empty_phpdoc' => true,
47+
'no_empty_statement' => true,
48+
'no_extra_blank_lines' =>
49+
['tokens'=>
50+
[
51+
'curly_brace_block',
52+
'extra',
53+
'parenthesis_brace_block',
54+
'square_brace_block',
55+
'throw',
56+
'use',
57+
]
58+
],
59+
'no_leading_import_slash' => true,
60+
'no_leading_namespace_whitespace' => true,
61+
'no_mixed_echo_print' => true,
62+
'no_multiline_whitespace_around_double_arrow' => true,
63+
'no_null_property_initialization' => true,
64+
'no_short_bool_cast' => true,
65+
'no_singleline_whitespace_before_semicolons' => true,
66+
'no_superfluous_elseif' => true,
67+
'no_spaces_after_function_name' => true,
68+
'no_spaces_around_offset' => true,
69+
'no_spaces_inside_parenthesis' => true,
70+
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'allow_unused_params' => true],
71+
'no_trailing_comma_in_list_call' => true,
72+
'no_trailing_comma_in_singleline_array' => true,
73+
'no_trailing_whitespace' => true,
74+
'no_trailing_whitespace_in_comment' => true,
75+
'no_unneeded_control_parentheses' => true,
76+
'no_unneeded_curly_braces' => ['namespaces' => true],
77+
'no_unused_imports' => true,
78+
'no_useless_else' => true,
79+
'no_useless_return' => true,
80+
'no_whitespace_before_comma_in_array' => true,
81+
'no_whitespace_in_blank_line' => true,
82+
'normalize_index_brace' => true,
83+
'not_operator_with_space' => false,
84+
'object_operator_without_whitespace' => true,
85+
'ordered_class_elements' => true,
86+
'ordered_imports' => true,
87+
'php_unit_fqcn_annotation' => true,
88+
'phpdoc_align' =>
89+
['tags' =>
90+
[
91+
'method',
92+
'param',
93+
'property',
94+
'property-read',
95+
'return',
96+
'throws',
97+
'type',
98+
'var',
99+
]
100+
],
101+
'phpdoc_add_missing_param_annotation' => true,
102+
'phpdoc_annotation_without_dot' => true,
103+
'phpdoc_indent' => true,
104+
'phpdoc_inline_tag_normalizer' => true,
105+
'phpdoc_no_access' => true,
106+
'phpdoc_no_alias_tag' => false,
107+
'phpdoc_no_package' => true,
108+
'phpdoc_no_useless_inheritdoc' => true,
109+
'phpdoc_order' => true,
110+
'phpdoc_return_self_reference' => true,
111+
'phpdoc_scalar' => true,
112+
'phpdoc_separation' => true,
113+
'phpdoc_single_line_var_spacing' => true,
114+
'phpdoc_summary' => true,
115+
'phpdoc_to_comment' => true,
116+
'phpdoc_trim' => true,
117+
'phpdoc_trim_consecutive_blank_line_separation' => true,
118+
'phpdoc_types' => true,
119+
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
120+
'phpdoc_var_without_name' => true,
121+
'return_assignment' => true,
122+
'return_type_declaration' => true,
123+
'semicolon_after_instruction' => true,
124+
'simplified_null_return' => true,
125+
'short_scalar_cast' => true,
126+
'single_blank_line_at_eof' => true,
127+
'single_blank_line_before_namespace' => true,
128+
'single_class_element_per_statement' => true,
129+
'single_import_per_statement' => true,
130+
'single_line_after_imports' => true,
131+
'single_line_comment_style' => ['comment_types' => ['hash']],
132+
'single_line_throw' => true,
133+
'single_quote' => true,
134+
'single_trait_insert_per_statement' => true,
135+
'space_after_semicolon' => ['remove_in_empty_for_expressions'=>true],
136+
'standardize_increment' => true,
137+
'standardize_not_equals' => true,
138+
'switch_case_semicolon_to_colon' => true,
139+
'switch_case_space' => true,
140+
'ternary_operator_spaces' => true,
141+
'ternary_to_null_coalescing' => true,
142+
'trailing_comma_in_multiline' => true,
143+
'trim_array_spaces' => true,
144+
'unary_operator_spaces' => true,
145+
'visibility_required' => true,
146+
'whitespace_after_comma_in_array' => true,
147+
'yoda_style' => false,
148+
])
149+
->setFinder(PhpCsFixer\Finder::create()
150+
->exclude('vendor')
151+
->in('src')
152+
->in('tests')
153+
)
154+
;

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@
1313
}
1414
],
1515
"require": {
16-
"php": ">=7.2",
16+
"php": ">=7.3",
1717
"ext-mbstring": "*",
1818
"ext-zlib": "*",
1919
"ext-curl": "*",
20-
"paquettg/string-encode": "~1.0.0",
20+
"paquettg/string-encode": "^2.0",
2121
"php-http/httplug": "^2.1",
2222
"guzzlehttp/guzzle": "^7.0",
23-
"guzzlehttp/psr7": "^1.6",
24-
"myclabs/php-enum": "^1.7"
23+
"guzzlehttp/psr7": "^2.0",
24+
"myclabs/php-enum": "^1.8",
25+
"psr/http-client": "^1.0"
2526
},
2627
"require-dev": {
27-
"phpunit/phpunit": "^7.5.1",
28+
"phpunit/phpunit": "^8.0 || ^9.0",
2829
"mockery/mockery": "^1.2",
29-
"infection/infection": "^0.13.4",
30-
"phan/phan": "^2.4",
31-
"friendsofphp/php-cs-fixer": "^2.16"
30+
"friendsofphp/php-cs-fixer": "^3.0",
31+
"phan/phan": "^5.2"
3232
},
3333
"autoload": {
34-
"psr-4": {
34+
"psr-4": {
3535
"PHPHtmlParser\\": "src/PHPHtmlParser"
3636
}
3737
}

src/PHPHtmlParser/Content.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ public function char(?int $char = null): string
7474

7575
/**
7676
* Gets a string from the current character position.
77-
*
78-
* @param int $length
79-
* @return string
8077
*/
8178
public function string(int $length = 1): string
8279
{
@@ -85,6 +82,7 @@ public function string(int $length = 1): string
8582
do {
8683
$string .= $this->char($position++);
8784
} while ($position < $this->pos + $length);
85+
8886
return $string;
8987
}
9088

0 commit comments

Comments
 (0)