Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit d729771

Browse files
Tidy-up composer.json. Add missing test config and dependencies
1 parent 8f34923 commit d729771

4 files changed

Lines changed: 167 additions & 19 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
bin/
12
vendor/
23
composer.lock

.php_cs

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?php
2+
3+
$finder = \PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests');
6+
7+
return \PhpCsFixer\Config::create()
8+
->setRules(
9+
[
10+
'@PSR2' => true,
11+
'@PHP56Migration' => true,
12+
'@PHP70Migration' => true,
13+
'@PHP71Migration' => true,
14+
'@DoctrineAnnotation' => true,
15+
'array_syntax' => ['syntax' => 'short'],
16+
'binary_operator_spaces' => true,
17+
'blank_line_after_opening_tag' => true,
18+
'blank_line_before_return' => true,
19+
'blank_line_before_statement' => true,
20+
'cast_spaces' => ['space' => 'single'],
21+
'combine_consecutive_issets' => true,
22+
'combine_consecutive_unsets' => true,
23+
'concat_space' => ['spacing' => 'none'],
24+
'declare_equal_normalize' => ['space' => 'none'],
25+
'function_typehint_space' => true,
26+
'include' => true,
27+
'linebreak_after_opening_tag' => true,
28+
'list_syntax' => ['syntax' => 'long'],
29+
'lowercase_cast' => true,
30+
'magic_constant_casing' => true,
31+
'mb_str_functions' => false,
32+
'method_chaining_indentation' => true,
33+
'method_separation' => true,
34+
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
35+
'native_function_casing' => true,
36+
'new_with_braces' => true,
37+
'no_blank_lines_after_class_opening' => true,
38+
'no_blank_lines_after_phpdoc' => true,
39+
'no_empty_comment' => true,
40+
'no_empty_phpdoc' => true,
41+
'no_empty_statement' => true,
42+
'no_leading_import_slash' => true,
43+
'no_mixed_echo_print' => ['use' => 'echo'],
44+
'no_multiline_whitespace_around_double_arrow' => true,
45+
'no_multiline_whitespace_before_semicolons' => true,
46+
'no_null_property_initialization' => true,
47+
'no_short_bool_cast' => true,
48+
'no_singleline_whitespace_before_semicolons' => true,
49+
'no_spaces_after_function_name' => true,
50+
'no_spaces_around_offset' => true,
51+
'no_spaces_inside_parenthesis' => true,
52+
'no_superfluous_elseif' => true,
53+
'no_trailing_comma_in_list_call' => true,
54+
'no_trailing_comma_in_singleline_array' => true,
55+
'no_unneeded_control_parentheses' => true,
56+
'no_unneeded_curly_braces' => true,
57+
'no_unneeded_final_method' => true,
58+
'no_unreachable_default_argument_value' => false,
59+
'no_unused_imports' => true,
60+
'no_useless_else' => true,
61+
'no_useless_return' => true,
62+
'no_whitespace_before_comma_in_array' => true,
63+
'no_whitespace_in_blank_line' => true,
64+
'non_printable_character' => false,
65+
'object_operator_without_whitespace' => true,
66+
'phpdoc_no_access' => true,
67+
'phpdoc_no_empty_return' => true,
68+
'phpdoc_no_package' => true,
69+
'phpdoc_no_useless_inheritdoc' => true,
70+
'phpdoc_return_self_reference' => true,
71+
'phpdoc_scalar' => true,
72+
'phpdoc_single_line_var_spacing' => true,
73+
'phpdoc_to_comment' => true,
74+
'phpdoc_types' => true,
75+
'phpdoc_var_without_name' => true,
76+
'increment_style' => ['style' => 'post'],
77+
'return_type_declaration' => true,
78+
'semicolon_after_instruction' => true,
79+
'short_scalar_cast' => true,
80+
'silenced_deprecation_error' => false,
81+
'single_blank_line_before_namespace' => true,
82+
'single_line_comment_style' => false,
83+
'single_quote' => true,
84+
'space_after_semicolon' => true,
85+
'standardize_not_equals' => true,
86+
'strict_comparison' => false,
87+
'strict_param' => false,
88+
'ternary_operator_spaces' => true,
89+
'trim_array_spaces' => true,
90+
'unary_operator_spaces' => true,
91+
'void_return' => false,
92+
'whitespace_after_comma_in_array' => true,
93+
]
94+
)
95+
->setRiskyAllowed(false)
96+
->setUsingCache(false)
97+
->setIndent(" ")
98+
->setLineEnding("\n")
99+
->setFinder($finder);

composer.json

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,78 @@
66
"tracking",
77
"Symfony2"
88
],
9-
"homepage": "https://github.com/Lendable/VisitorTrackingBundle.git",
9+
"homepage": "https://github.com/Lendable/VisitorTrackingBundle",
1010
"license": "MIT",
11+
1112
"authors": [
1213
{
1314
"name": "The Lendable Team",
1415
"email": "contact@lendable.co.uk"
1516
}
1617
],
18+
19+
"autoload": {
20+
"psr-4": {
21+
"Alpha\\VisitorTrackingBundle\\": "src/"
22+
}
23+
},
24+
"autoload-dev": {
25+
"psr-4": {
26+
"Alpha\\VisitorTrackingBundle\\Tests\\": "tests/"
27+
}
28+
},
29+
1730
"require": {
1831
"php": ">=7.1",
19-
"symfony/framework-bundle": "^3.3",
2032
"doctrine/doctrine-bundle": "~1.6",
2133
"doctrine/orm": "~2.1",
2234
"stof/doctrine-extensions-bundle": "*",
23-
"symfony/security-bundle": "^3.3"
35+
"symfony/framework-bundle": "^3.3|^4.0",
36+
"symfony/security-bundle": "^3.3|^4.0"
2437
},
2538
"require-dev": {
39+
"behat/behat": "^3.4",
40+
"behat/mink-extension": "^2.3",
41+
"behat/symfony2-extension": "^2.1",
2642
"friendsofphp/php-cs-fixer": "*",
2743
"jakub-onderka/php-parallel-lint": "^1.0",
28-
"phpunit/phpunit": "^5.6",
29-
"roave/security-advisories": "dev-master",
44+
"phpstan/phpstan": "^0.10.2",
45+
"phpunit/phpunit": "^5.7",
46+
"satooshi/php-coveralls": "^2.0",
47+
"sensiolabs/security-checker": "^4.1",
3048
"symfony/phpunit-bridge": "^3.0|^4.0"
3149
},
32-
"autoload": {
33-
"psr-4": {
34-
"Alpha\\VisitorTrackingBundle\\": "src/"
35-
}
36-
},
37-
"autoload-dev": {
38-
"psr-4": {
39-
"Alpha\\VisitorTrackingBundle\\Tests\\": "tests/"
40-
}
41-
},
50+
4251
"scripts": {
4352
"check-code-style": [
44-
"vendor/bin/php-cs-fixer fix --config='./.php_cs' --show-progress=none --dry-run --no-interaction -v"
53+
"bin/php-cs-fixer fix --config='./.php_cs' --show-progress=none --dry-run --no-interaction --diff -v"
54+
],
55+
"check-security": [
56+
"bin/security-checker security:check"
4557
],
4658
"fix-code-style": [
47-
"vendor/bin/php-cs-fixer fix --config='./.php_cs' --show-progress=none --no-interaction -v"
59+
"bin/php-cs-fixer fix --config='./.php_cs' --show-progress=none --no-interaction --diff -v"
60+
],
61+
"run-static-analysis": [
62+
"bin/phpstan analyse --level=1 src/"
63+
],
64+
"run-static-analysis-including-tests": [
65+
"@run-static-analysis",
66+
"bin/phpstan analyse --level=1 tests/"
4867
],
4968
"run-tests": [
50-
"vendor/bin/phpunit"
69+
"bin/phpunit"
70+
],
71+
"run-tests-with-clover": [
72+
"bin/phpunit --coverage-clover build/logs/clover.xml"
5173
],
5274
"validate-files": [
53-
"vendor/bin/parallel-lint --exclude vendor ."
75+
"bin/parallel-lint --exclude vendor --exclude bin ."
5476
]
5577
},
78+
5679
"config": {
80+
"bin-dir": "bin",
5781
"sort-packages": true
5882
},
5983
"prefer-stable": true

phpunit.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
colors="true"
4+
convertErrorsToExceptions="true"
5+
convertNoticesToExceptions="false"
6+
convertWarningsToExceptions="true"
7+
stopOnFailure="false"
8+
bootstrap="vendor/autoload.php"
9+
verbose="true"
10+
syntaxCheck="true">
11+
12+
<testsuites>
13+
<testsuite>
14+
<directory>./tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
18+
<filter>
19+
<whitelist>
20+
<directory suffix=".php">./src</directory>
21+
</whitelist>
22+
</filter>
23+
24+
</phpunit>

0 commit comments

Comments
 (0)