Skip to content

Commit 25aac38

Browse files
committed
Fully qualify functions
1 parent 4616688 commit 25aac38

19 files changed

+332
-292
lines changed

.php_cs.dist

Lines changed: 149 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,153 @@
11
<?php
2-
3-
$finder = PhpCsFixer\Finder::create()
4-
->in(__DIR__.'/src')
5-
;
6-
2+
/*
3+
* This document has been generated with
4+
* https://mlocati.github.io/php-cs-fixer-configurator/#version:2.17.5|configurator
5+
* you can change this configuration by importing this file.
6+
*/
77
return PhpCsFixer\Config::create()
8-
->setIndent("\t")
9-
->setLineEnding("\r\n")
10-
->setRules([
11-
'array_indentation' => true,
12-
'array_syntax' => ['syntax' => 'short'],
13-
'binary_operator_spaces' => true,
14-
'blank_line_after_namespace' => true,
15-
'blank_line_after_opening_tag' => true,
16-
'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'die', 'do', 'exit', 'for', 'foreach', 'goto', 'if', 'return', 'switch', 'throw', 'try', 'while', 'yield']],
17-
'class_attributes_separation' => true,
18-
'combine_consecutive_issets' => true,
19-
'combine_consecutive_unsets' => true,
20-
'combine_nested_dirname' => true,
21-
'compact_nullable_typehint' => true,
22-
'concat_space' => ['spacing' => 'one'],
23-
'constant_case' => true,
24-
'declare_equal_normalize' => ['space' => 'single'],
25-
'dir_constant' => true,
26-
'elseif' => true,
27-
'ereg_to_preg' => true,
28-
'explicit_indirect_variable' => true,
29-
'explicit_string_variable' => true,
30-
'full_opening_tag' => true,
31-
'function_typehint_space' => true,
32-
'is_null' => true,
33-
'linebreak_after_opening_tag' => true,
34-
'list_syntax' => ['syntax' => 'short'],
35-
'logical_operators' => true,
36-
'lowercase_cast' => true,
37-
'lowercase_constants' => true,
38-
'lowercase_keywords' => true,
39-
'lowercase_static_reference' => true,
40-
'magic_constant_casing' => true,
41-
'magic_method_casing' => true,
42-
'method_chaining_indentation' => true,
43-
'modernize_types_casting' => true,
44-
'native_function_casing' => true,
45-
'native_function_invocation' => [],
46-
'new_with_braces' => true,
47-
'no_alias_functions' => ['sets' => ['@all']],
48-
'no_alternative_syntax' => true,
49-
'no_blank_lines_after_phpdoc' => true,
50-
'no_break_comment' => ['comment_text' => 'Intentionally fall through'],
51-
'no_closing_tag' => true,
52-
'no_empty_comment' => true,
53-
'no_empty_statement' => true,
54-
'no_leading_namespace_whitespace' => true,
55-
'no_spaces_inside_parenthesis' => true,
56-
'no_superfluous_phpdoc_tags' => true,
57-
'no_trailing_whitespace' => true,
58-
'no_trailing_whitespace_in_comment' => true,
59-
'no_unneeded_control_parentheses' => true,
60-
'no_unneeded_final_method' => true,
61-
'no_unreachable_default_argument_value' => true,
62-
'no_unset_cast' => true,
63-
'no_useless_return' => true,
64-
'no_whitespace_before_comma_in_array' => true,
65-
'no_whitespace_in_blank_line' => true,
66-
'non_printable_character' => ['use_escape_sequences_in_strings' => true],
67-
'normalize_index_brace' => true,
68-
'not_operator_with_successor_space' => true,
69-
'ordered_class_elements' => true,
70-
'protected_to_private' => true,
71-
'psr_autoloading' => true,
72-
'return_type_declaration' => ['space_before' => 'one',],
73-
'semicolon_after_instruction' => true,
74-
'set_type_to_cast' => true,
75-
'short_scalar_cast' => true,
76-
'simple_to_complex_string_variable' => true,
77-
'simple_to_complex_string_variable' => true,
78-
'simplified_if_return' => true,
79-
'simplified_null_return' => true,
80-
'simplified_null_return' => true,
81-
'single_blank_line_at_eof' => true,
82-
'single_blank_line_at_eof' => true,
83-
'single_blank_line_before_namespace' => true,
84-
'single_class_element_per_statement' => true,
85-
'single_import_per_statement' => true,
86-
'single_line_after_imports' => true,
87-
'single_line_comment_style' => true,
88-
'single_quote' => true,
89-
'single_trait_insert_per_statement' => true,
90-
'standardize_not_equals' => true,
91-
'static_lambda' => true,
92-
'string_line_ending' => true,
93-
'switch_case_semicolon_to_colon' => true,
94-
'switch_case_space' => true,
95-
'switch_continue_to_break' => true,
96-
'ternary_operator_spaces' => true,
97-
'ternary_to_elvis_operator' => true,
98-
'ternary_to_null_coalescing' => true,
99-
'trailing_comma_in_multiline_array' => true,
100-
'trim_array_spaces' => true,
101-
'unary_operator_spaces' => true,
102-
'visibility_required' => ['property', 'method', 'const', ],
103-
'void_return' => true,
104-
'whitespace_after_comma_in_array' => true,
105-
'yoda_style' => true,
106-
// 'braces' => ['position_after_control_structures' => 'next', 'position_after_functions_and_oop_constructs' => 'next', 'position_after_anonymous_constructs' => 'next',],
107-
// 'no_unneeded_curly_braces' => true,
8+
->setRiskyAllowed(true)
9+
->setIndent("\t")
10+
->setLineEnding("\r\n")
11+
->setRules([
12+
'align_multiline_comment' => ['comment_type'=>'all_multiline'],
13+
'array_indentation' => true,
14+
'array_push' => true,
15+
'array_syntax' => ['syntax'=>'short'],
16+
'backtick_to_shell_exec' => true,
17+
'binary_operator_spaces' => true,
18+
'blank_line_after_namespace' => true,
19+
'blank_line_after_opening_tag' => true,
20+
'blank_line_before_statement' => true,
21+
// 'braces' => ['position_after_anonymous_constructs'=>'next','position_after_control_structures'=>'next'],
22+
'cast_spaces' => ['space'=>'none'],
23+
'class_attributes_separation' => true,
24+
'class_definition' => true,
25+
'clean_namespace' => true,
26+
'combine_consecutive_issets' => true,
27+
'combine_consecutive_unsets' => true,
28+
'combine_nested_dirname' => true,
29+
'comment_to_phpdoc' => true,
30+
'compact_nullable_typehint' => true,
31+
'concat_space' => ['spacing'=>'one'],
32+
'constant_case' => true,
33+
'declare_equal_normalize' => true,
34+
'dir_constant' => true,
35+
'elseif' => true,
36+
'encoding' => true,
37+
'ereg_to_preg' => true,
38+
'explicit_indirect_variable' => true,
39+
'explicit_string_variable' => true,
40+
'fopen_flag_order' => true,
41+
'full_opening_tag' => true,
42+
'function_declaration' => ['closure_function_spacing'=>'none'],
43+
'function_to_constant' => true,
44+
'function_typehint_space' => true,
45+
'general_phpdoc_tag_rename' => true,
46+
'hash_to_slash_comment' => true,
47+
'implode_call' => true,
48+
'include' => true,
49+
'indentation_type' => true,
50+
'is_null' => true,
51+
'line_ending' => true,
52+
'linebreak_after_opening_tag' => true,
53+
'list_syntax' => ['syntax'=>'short'],
54+
'logical_operators' => true,
55+
'lowercase_cast' => true,
56+
'lowercase_constants' => true,
57+
'lowercase_keywords' => true,
58+
'lowercase_static_reference' => true,
59+
'magic_constant_casing' => true,
60+
'magic_method_casing' => true,
61+
'method_argument_space' => true,
62+
'method_chaining_indentation' => true,
63+
'modernize_types_casting' => true,
64+
'multiline_whitespace_before_semicolons' => true,
65+
'native_function_casing' => true,
66+
'native_function_invocation' => true,
67+
'native_function_type_declaration_casing' => true,
68+
'new_with_braces' => true,
69+
'no_alias_functions' => true,
70+
'no_alias_language_construct_call' => true,
71+
'no_alternative_syntax' => true,
72+
'no_blank_lines_after_phpdoc' => true,
73+
'no_break_comment' => ['comment_text'=>'Intentionally fall through'],
74+
'no_closing_tag' => true,
75+
'no_empty_comment' => true,
76+
'no_empty_phpdoc' => true,
77+
'no_empty_statement' => true,
78+
'no_homoglyph_names' => true,
79+
'no_leading_import_slash' => true,
80+
'no_leading_namespace_whitespace' => true,
81+
'no_mixed_echo_print' => true,
82+
'no_multiline_whitespace_around_double_arrow' => true,
83+
'no_multiline_whitespace_before_semicolons' => true,
84+
'no_php4_constructor' => true,
85+
'no_short_bool_cast' => true,
86+
'no_spaces_after_function_name' => true,
87+
'no_spaces_inside_parenthesis' => true,
88+
'no_superfluous_phpdoc_tags' => true,
89+
'no_trailing_whitespace' => true,
90+
'no_trailing_whitespace_in_comment' => true,
91+
'no_unneeded_control_parentheses' => true,
92+
'no_unneeded_final_method' => true,
93+
'no_unreachable_default_argument_value' => true,
94+
'no_unset_cast' => true,
95+
'no_unset_on_property' => true,
96+
'no_unused_imports' => true,
97+
'no_useless_else' => true,
98+
'no_useless_return' => true,
99+
'no_useless_sprintf' => true,
100+
'no_whitespace_before_comma_in_array' => true,
101+
'no_whitespace_in_blank_line' => true,
102+
'non_printable_character' => ['use_escape_sequences_in_strings'=>true],
103+
'normalize_index_brace' => true,
104+
'not_operator_with_successor_space' => true,
105+
'nullable_type_declaration_for_default_null_value' => true,
106+
'object_operator_without_whitespace' => true,
107+
'ordered_class_elements' => true,
108+
'ordered_imports' => true,
109+
'ordered_interfaces' => true,
110+
'ordered_traits' => true,
111+
'phpdoc_no_useless_inheritdoc' => true,
112+
'phpdoc_order' => true,
113+
'phpdoc_return_self_reference' => true,
114+
'phpdoc_scalar' => true,
115+
'phpdoc_tag_casing' => true,
116+
'protected_to_private' => true,
117+
'psr_autoloading' => true,
118+
'return_type_declaration' => ['space_before'=>'one'],
119+
'semicolon_after_instruction' => true,
120+
'set_type_to_cast' => true,
121+
'short_scalar_cast' => true,
122+
'simple_to_complex_string_variable' => true,
123+
'simplified_if_return' => true,
124+
'simplified_null_return' => true,
125+
'single_blank_line_at_eof' => true,
126+
'single_blank_line_before_namespace' => true,
127+
'single_class_element_per_statement' => true,
128+
'single_import_per_statement' => true,
129+
'single_line_after_imports' => true,
130+
'single_line_comment_style' => true,
131+
'single_quote' => true,
132+
'single_trait_insert_per_statement' => true,
133+
'standardize_not_equals' => true,
134+
'static_lambda' => true,
135+
'string_line_ending' => true,
136+
'switch_case_semicolon_to_colon' => true,
137+
'switch_case_space' => true,
138+
'switch_continue_to_break' => true,
139+
'ternary_operator_spaces' => true,
140+
'ternary_to_elvis_operator' => true,
141+
'ternary_to_null_coalescing' => true,
142+
'trailing_comma_in_multiline_array' => true,
143+
'trim_array_spaces' => true,
144+
'unary_operator_spaces' => true,
145+
'visibility_required' => true,
146+
'void_return' => true,
147+
'whitespace_after_comma_in_array' => true,
148+
'yoda_style' => true,
108149
])
109-
->setFinder($finder)
110-
;
150+
->setFinder(PhpCsFixer\Finder::create()
151+
->in(__DIR__.'\src')
152+
);
111153

src/PHPFUI/InstaDoc/CSSSelector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ public function __construct(\PHPFUI\Page $page, string $current = '')
88
{
99
parent::__construct('CSS');
1010

11-
foreach (glob($_SERVER['DOCUMENT_ROOT'] . $page->getResourcePath() . 'highlighter/styles/*.css') as $file)
11+
foreach (\glob($_SERVER['DOCUMENT_ROOT'] . $page->getResourcePath() . 'highlighter/styles/*.css') as $file)
1212
{
13-
$value = substr($file, strrpos($file, '/') + 1);
14-
$value = substr($value, 0, strlen($value) - 4);
15-
$name = ucwords(str_replace(['-', '_'], ' ', $value));
13+
$value = \substr($file, \strrpos($file, '/') + 1);
14+
$value = \substr($value, 0, \strlen($value) - 4);
15+
$name = \ucwords(\str_replace(['-', '_'], ' ', $value));
1616

1717
$this->addOption($name, $value, $current == $value);
1818
}

src/PHPFUI/InstaDoc/ChildClasses.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ChildClasses
99
{
1010
/**
1111
* @var array indexed by fqn of class containing array of fqn of children
12-
*/
12+
*/
1313
private static $children = [];
1414

1515
/**
@@ -59,15 +59,15 @@ public static function getChildClasses(string $fqn) : array
5959
*/
6060
public static function load(string $file = '../ChildClasses.serial') : bool
6161
{
62-
if (! file_exists($file))
62+
if (! \file_exists($file))
6363
{
6464
self::generate();
6565

6666
return self::save($file);
6767
}
6868

69-
$contents = file_get_contents($file);
70-
$temp = unserialize($contents);
69+
$contents = \file_get_contents($file);
70+
$temp = \unserialize($contents);
7171

7272
if (! $temp)
7373
{
@@ -86,9 +86,9 @@ public static function save(string $file = '../ChildClasses.serial') : bool
8686
{
8787
foreach (self::$children as &$childClasses)
8888
{
89-
sort($childClasses);
89+
\sort($childClasses);
9090
}
9191

92-
return file_put_contents($file, serialize(self::$children)) > 0;
92+
return \file_put_contents($file, \serialize(self::$children)) > 0;
9393
}
9494
}

0 commit comments

Comments
 (0)