Skip to content

Commit 6137e48

Browse files
committed
Init commit
0 parents  commit 6137e48

File tree

163 files changed

+23443
-0
lines changed

Some content is hidden

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

163 files changed

+23443
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[composer.json]
18+
indent_size = 2

.gitattributes

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
/phpunit.xml export-ignore
4+
/perf export-ignore
5+
/sample export-ignore
6+
/spec export-ignore
7+
/tests export-ignore
8+
/.editorconfig export-ignore
9+
/.gitattributes export-ignore
10+
/.gitignore export-ignore
11+
/.php_cs.dist export-ignore
12+
/.scrutinizer.yml export-ignore
13+
/.travis.yml export-ignore

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea/
2+
.vscode/
3+
build/
4+
5+
vendor/
6+
composer.lock
7+
perf/blackfire.io.env

.php_cs.dist

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
return PhpCsFixer\Config::create()
6+
->setUsingCache(false)
7+
->setRules([
8+
'native_function_invocation' => [
9+
'exclude' => [
10+
'_'
11+
]
12+
],
13+
])
14+
->setRiskyAllowed(true)
15+
->setFinder(
16+
PhpCsFixer\Finder::create()
17+
->in(__DIR__ . '/src')
18+
->append([__FILE__])
19+
)
20+
;

.scrutinizer.yml

+258
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
filter:
2+
excluded_paths:
3+
- 'tests/*'
4+
- 'sample/*'
5+
6+
tools:
7+
php_sim: true
8+
php_pdepend: true
9+
php_analyzer: true
10+
external_code_coverage: true
11+
12+
coding_style:
13+
php:
14+
indentation:
15+
general:
16+
use_tabs: false
17+
size: 4
18+
switch:
19+
indent_case: true
20+
spaces:
21+
before_parentheses:
22+
function_declaration: false
23+
closure_definition: false
24+
function_call: false
25+
if: true
26+
for: true
27+
while: true
28+
switch: true
29+
catch: true
30+
array_initializer: false
31+
around_operators:
32+
assignment: true
33+
logical: true
34+
equality: true
35+
relational: true
36+
bitwise: true
37+
additive: true
38+
multiplicative: true
39+
shift: true
40+
unary_additive: false
41+
concatenation: false
42+
negation: false
43+
before_left_brace:
44+
class: true
45+
function: true
46+
if: true
47+
else: true
48+
for: true
49+
while: true
50+
do: true
51+
switch: true
52+
try: true
53+
catch: true
54+
finally: true
55+
before_keywords:
56+
else: true
57+
while: true
58+
catch: true
59+
finally: true
60+
within:
61+
brackets: false
62+
array_initializer: false
63+
grouping: false
64+
function_call: false
65+
function_declaration: false
66+
if: false
67+
for: false
68+
while: false
69+
switch: false
70+
catch: false
71+
type_cast: false
72+
ternary_operator:
73+
before_condition: true
74+
after_condition: true
75+
before_alternative: true
76+
after_alternative: true
77+
in_short_version: false
78+
other:
79+
before_comma: false
80+
after_comma: true
81+
before_semicolon: false
82+
after_semicolon: true
83+
after_type_cast: false
84+
braces:
85+
classes_functions:
86+
class: new-line
87+
function: new-line
88+
closure: end-of-line
89+
if:
90+
opening: end-of-line
91+
always: true
92+
else_on_new_line: false
93+
for:
94+
opening: end-of-line
95+
always: true
96+
while:
97+
opening: end-of-line
98+
always: true
99+
do_while:
100+
opening: end-of-line
101+
always: true
102+
while_on_new_line: false
103+
switch:
104+
opening: end-of-line
105+
try:
106+
opening: end-of-line
107+
catch_on_new_line: false
108+
finally_on_new_line: false
109+
110+
checks:
111+
php:
112+
uppercase_constants: true
113+
code_rating: true
114+
duplication: true
115+
variable_existence: true
116+
useless_calls: true
117+
use_statement_alias_conflict: true
118+
unused_variables: true
119+
unused_properties: true
120+
unused_parameters: true
121+
unused_methods: true
122+
unreachable_code: true
123+
sql_injection_vulnerabilities: true
124+
security_vulnerabilities: true
125+
precedence_mistakes: true
126+
precedence_in_conditions: true
127+
parameter_non_unique: true
128+
no_property_on_interface: true
129+
no_non_implemented_abstract_methods: true
130+
deprecated_code_usage: true
131+
closure_use_not_conflicting: true
132+
closure_use_modifiable: true
133+
avoid_useless_overridden_methods: true
134+
avoid_conflicting_incrementers: true
135+
assignment_of_null_return: true
136+
single_namespace_per_use: true
137+
verify_property_names: true
138+
verify_argument_usable_as_reference: true
139+
verify_access_scope_valid: true
140+
use_self_instead_of_fqcn: true
141+
too_many_arguments: true
142+
symfony_request_injection: true
143+
switch_fallthrough_commented: true
144+
spacing_of_function_arguments: true
145+
spacing_around_non_conditional_operators: true
146+
spacing_around_conditional_operators: true
147+
simplify_boolean_return: true
148+
side_effects_or_types: true
149+
return_doc_comments: true
150+
return_doc_comment_if_not_inferrable: true
151+
require_scope_for_properties: true
152+
require_scope_for_methods: true
153+
require_php_tag_first: true
154+
require_braces_around_control_structures: true
155+
remove_trailing_whitespace: true
156+
remove_php_closing_tag: true
157+
remove_extra_empty_lines: true
158+
psr2_switch_declaration: true
159+
psr2_control_structure_declaration: true
160+
psr2_class_declaration: true
161+
property_assignments: true
162+
properties_in_camelcaps: true
163+
prefer_while_loop_over_for_loop: true
164+
prefer_unix_line_ending: true
165+
prefer_sapi_constant: true
166+
phpunit_assertions: true
167+
php5_style_constructor: true
168+
parameters_in_camelcaps: true
169+
parameter_doc_comments: true
170+
param_doc_comment_if_not_inferrable: true
171+
overriding_private_members: true
172+
one_class_per_file: true
173+
optional_parameters_at_the_end: true
174+
non_commented_empty_catch_block: true
175+
no_unnecessary_if: true
176+
no_unnecessary_function_call_in_for_loop: true
177+
no_unnecessary_final_modifier: true
178+
no_underscore_prefix_in_properties: true
179+
no_underscore_prefix_in_methods: true
180+
no_trait_type_hints: true
181+
no_trailing_whitespace: true
182+
no_space_inside_cast_operator: true
183+
no_space_before_semicolon: true
184+
no_space_around_object_operator: true
185+
no_space_after_cast: true
186+
no_short_variable_names:
187+
minimum: '3'
188+
no_short_open_tag: true
189+
no_mixed_inline_html: true
190+
no_long_variable_names:
191+
maximum: '20'
192+
no_goto: true
193+
no_global_keyword: true
194+
no_exit: true
195+
no_eval: true
196+
no_error_suppression: true
197+
no_empty_statements: true
198+
no_else_if_statements: true
199+
no_duplicate_arguments: true
200+
no_debug_code: true
201+
no_commented_out_code: true
202+
newline_at_end_of_file: true
203+
naming_conventions:
204+
local_variable: '^[a-z][a-zA-Z0-9]*$'
205+
abstract_class_name: ^Abstract|Factory$
206+
utility_class_name: 'Utils?$'
207+
constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$'
208+
property_name: '^[a-z][a-zA-Z0-9]*$'
209+
method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$'
210+
parameter_name: '^[a-z][a-zA-Z0-9]*$'
211+
interface_name: '^[A-Z][a-zA-Z0-9]*Interface$'
212+
type_name: '^[A-Z][a-zA-Z0-9]*$'
213+
exception_name: '^[A-Z][a-zA-Z0-9]*Exception$'
214+
isser_method_name: '^(?:is|has|should|may|supports)'
215+
more_specific_types_in_doc_comments: true
216+
missing_arguments: true
217+
method_calls_on_non_object: true
218+
lowercase_php_keywords: true
219+
lowercase_basic_constants: true
220+
line_length:
221+
max_length: '1000'
222+
instanceof_class_exists: true
223+
function_in_camel_caps: true
224+
foreach_usable_as_reference: true
225+
foreach_traversable: true
226+
fix_use_statements:
227+
remove_unused: true
228+
preserve_multiple: false
229+
preserve_blanklines: false
230+
order_alphabetically: false
231+
fix_php_opening_tag: true
232+
fix_linefeed: true
233+
fix_identation_4spaces: true
234+
fix_line_ending: true
235+
fix_doc_comments: true
236+
ensure_lower_case_builtin_functions: true
237+
encourage_single_quotes: true
238+
encourage_shallow_comparison: true
239+
encourage_postdec_operator: true
240+
deadlock_detection_in_loops: true
241+
classes_in_camel_caps: true
242+
catch_class_exists: true
243+
blank_line_after_namespace_declaration: true
244+
avoid_todo_comments: true
245+
avoid_tab_indentation: true
246+
avoid_superglobals: true
247+
avoid_perl_style_comments: true
248+
avoid_multiple_statements_on_same_line: true
249+
avoid_length_functions_in_loops: true
250+
avoid_fixme_comments: true
251+
avoid_entity_manager_injection: true
252+
avoid_duplicate_types: true
253+
avoid_corrupting_byteorder_marks: true
254+
avoid_closing_tag: true
255+
avoid_aliased_php_functions: true
256+
argument_type_checks: true
257+
no_short_method_names:
258+
minimum: '3'

.travis.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: php
2+
php:
3+
- 7.1
4+
- 7.2
5+
- 7.3
6+
- 7.4
7+
matrix:
8+
include:
9+
- php: 7.1
10+
script:
11+
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
12+
after_script:
13+
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
14+
- php: 7.3
15+
script:
16+
- composer test-cs
17+
- composer test-md
18+
- composer test-cs-fixer
19+
before_script:
20+
- travis_retry composer self-update
21+
- travis_retry composer install --no-interaction --prefer-dist
22+
script:
23+
- vendor/bin/phpunit
24+
- cd sample/ && composer update && php sample.php > /dev/null
25+
notifications:
26+
webhooks:
27+
urls:
28+
- https://webhooks.gitter.im/e/56fbdc2d0c44773dc740
29+
on_success: always # options: [always|never|change] default: always
30+
on_failure: always # options: [always|never|change] default: always
31+
on_start: true # default: false

0 commit comments

Comments
 (0)