Replaces style checker with PHP CS Fix

This commit is contained in:
Basilius Sauter
2019-06-25 20:23:22 +02:00
parent e8f2ea56bc
commit 8612a53538
23 changed files with 860 additions and 166 deletions
+2
View File
@@ -228,3 +228,5 @@ pip-log.txt
#Mr Developer
.mr.developer.cfg
dbconfig.php
.php_cs.cache
+141
View File
@@ -0,0 +1,141 @@
<?php
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'braces' => [
'position_after_control_structures' => 'same',
'position_after_functions_and_oop_constructs' => 'next',
],
'cast_spaces' => ['space' => 'none'],
'class_definition' => true,
'class_keyword_remove' => false,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'declare_strict_types' => true,
'declare_equal_normalize' => true,
'dir_constant' => true,
'doctrine_annotation_array_assignment' => true,
'doctrine_annotation_braces' => true,
'doctrine_annotation_indentation' => true,
'doctrine_annotation_spaces' => [
'before_argument_assignments' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
],
'elseif' => true,
'encoding' => true,
'ereg_to_preg' => true,
'escape_implicit_backslashes' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true,
'function_declaration' => true,
'function_typehint_space' => true,
'general_phpdoc_annotation_remove' => true,
'indentation_type' => true,
'line_ending' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'lowercase_cast' => true,
'lowercase_constants' => true,
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => true,
'method_chaining_indentation' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'native_constant_invocation' => true,
'native_function_invocation' => true,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_alternative_syntax' => true,
'no_blank_lines_after_phpdoc' => true,
'no_break_comment' => true,
'no_closing_tag' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_homoglyph_names' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ["use" => "print"],
'no_multiline_whitespace_around_double_arrow' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'non_printable_character' => true,
'normalize_index_brace' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_indent' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_to_return_type' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
'phpdoc_var_annotation_correct_order' => true,
'pow_to_exponentiation' => true,
'psr4' => true,
'random_api_migration' => true,
'return_type_declaration' => true,
'self_accessor' => true,
'semicolon_after_instruction' => true,
'set_type_to_cast' => true,
'short_scalar_cast' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'standardize_not_equals' => true,
'standardize_increment' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => false,
'unary_operator_spaces' => true,
'visibility_required' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__."/src")
);
+2 -1
View File
@@ -14,6 +14,7 @@
],
"require": {
"php": "^7.1.0",
"ext-pdo": "*",
"composer/composer": "*",
"gedmo/doctrine-extensions": "*",
"doctrine/orm": "^2.5",
@@ -33,6 +34,6 @@
"require-dev": {
"phpunit/phpunit": "^7.0",
"phpunit/php-code-coverage": "*",
"dancryer/php-docblock-checker": "*"
"friendsofphp/php-cs-fixer": "*"
}
}
Generated
+523 -101
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "382c66dafe0e190852b7423476b4de6a",
"content-hash": "e1f0f8deb916da7f357d33a060e1ef48",
"packages": [
{
"name": "behat/transliterator",
@@ -1530,6 +1530,55 @@
],
"time": "2018-07-02T15:55:56+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
},
{
"name": "psr/log",
"version": "1.1.0",
@@ -2209,23 +2258,23 @@
},
{
"name": "symfony/service-contracts",
"version": "v1.1.2",
"version": "v1.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0"
"reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0",
"reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d",
"reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d",
"shasum": ""
},
"require": {
"php": "^7.1.3"
"php": "^7.1.3",
"psr/container": "^1.0"
},
"suggest": {
"psr/container": "",
"symfony/service-implementation": ""
},
"type": "library",
@@ -2263,7 +2312,7 @@
"interoperability",
"standards"
],
"time": "2019-05-28T07:50:59+00:00"
"time": "2019-06-13T11:15:36+00:00"
},
{
"name": "symfony/yaml",
@@ -2327,66 +2376,92 @@
],
"packages-dev": [
{
"name": "dancryer/php-docblock-checker",
"version": "1.10.2",
"name": "friendsofphp/php-cs-fixer",
"version": "v2.15.1",
"source": {
"type": "git",
"url": "https://github.com/dancryer/php-docblock-checker.git",
"reference": "687bb03a1cf6dd6d0115c018d97fa68e42203299"
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
"reference": "20064511ab796593a3990669eff5f5b535001f7c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dancryer/php-docblock-checker/zipball/687bb03a1cf6dd6d0115c018d97fa68e42203299",
"reference": "687bb03a1cf6dd6d0115c018d97fa68e42203299",
"url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/20064511ab796593a3990669eff5f5b535001f7c",
"reference": "20064511ab796593a3990669eff5f5b535001f7c",
"shasum": ""
},
"require": {
"composer/semver": "^1.4",
"composer/xdebug-handler": "^1.2",
"doctrine/annotations": "^1.2",
"ext-json": "*",
"nikic/php-parser": "3.*|4.*",
"php": ">=5.5",
"symfony/console": "3.4.*|4.*",
"symfony/yaml": "3.4.*|4.*"
"ext-tokenizer": "*",
"php": "^5.6 || ^7.0",
"php-cs-fixer/diff": "^1.3",
"symfony/console": "^3.4.17 || ^4.1.6",
"symfony/event-dispatcher": "^3.0 || ^4.0",
"symfony/filesystem": "^3.0 || ^4.0",
"symfony/finder": "^3.0 || ^4.0",
"symfony/options-resolver": "^3.0 || ^4.0",
"symfony/polyfill-php70": "^1.0",
"symfony/polyfill-php72": "^1.4",
"symfony/process": "^3.0 || ^4.0",
"symfony/stopwatch": "^3.0 || ^4.0"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.8.*",
"phperf/xh-tool": "^1.1",
"phpstan/phpstan": "^0.11.5",
"phpunit/phpunit": "^4.8",
"squizlabs/php_codesniffer": "^3.4"
"johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
"justinrainbow/json-schema": "^5.0",
"keradus/cli-executor": "^1.2",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.1",
"php-cs-fixer/accessible-object": "^1.0",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1",
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
"phpunitgoodpractices/traits": "^1.8",
"symfony/phpunit-bridge": "^4.3"
},
"suggest": {
"ext-mbstring": "For handling non-UTF8 characters in cache signature.",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
"symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
},
"bin": [
"bin/phpdoccheck"
"php-cs-fixer"
],
"type": "library",
"type": "application",
"autoload": {
"psr-4": {
"PhpDocBlockChecker\\": "src"
}
"PhpCsFixer\\": "src/"
},
"classmap": [
"tests/Test/AbstractFixerTestCase.php",
"tests/Test/AbstractIntegrationCaseFactory.php",
"tests/Test/AbstractIntegrationTestCase.php",
"tests/Test/Assert/AssertTokensTrait.php",
"tests/Test/IntegrationCase.php",
"tests/Test/IntegrationCaseFactory.php",
"tests/Test/IntegrationCaseFactoryInterface.php",
"tests/Test/InternalIntegrationCaseFactory.php",
"tests/TestCase.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
"MIT"
],
"authors": [
{
"name": "Dan Cryer",
"email": "dan.cryer@block8.co.uk",
"homepage": "http://www.block8.co.uk",
"role": "Developer"
"name": "Dariusz Rumiński",
"email": "dariusz.ruminski@gmail.com"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "A simple tool for checking that your PHP classes and methods use docblocks.",
"homepage": "https://www.phptesting.org/",
"keywords": [
"checker",
"code quality",
"comment",
"docblock",
"php",
"phpci",
"testing"
],
"time": "2019-04-26T10:38:36+00:00"
"description": "A tool to automatically fix PHP code style",
"time": "2019-06-01T10:32:12+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -2436,57 +2511,6 @@
],
"time": "2019-04-07T13:18:21+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.2.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bd73cc04c3843ad8d6b0bfc0956026a151fc420",
"reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5 || ^7.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2019-05-25T20:07:01+00:00"
},
{
"name": "phar-io/manifest",
"version": "1.0.3",
@@ -2589,6 +2613,57 @@
"description": "Library for handling version information and constraints",
"time": "2018-07-08T19:19:57+00:00"
},
{
"name": "php-cs-fixer/diff",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/diff.git",
"reference": "78bb099e9c16361126c86ce82ec4405ebab8e756"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756",
"reference": "78bb099e9c16361126c86ce82ec4405ebab8e756",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7.23 || ^6.4.3",
"symfony/process": "^3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "SpacePossum"
}
],
"description": "sebastian/diff v2 backport support for PHP5.6",
"homepage": "https://github.com/PHP-CS-Fixer",
"keywords": [
"diff"
],
"time": "2018-02-15T16:58:55+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
@@ -3058,16 +3133,16 @@
},
{
"name": "phpunit/phpunit",
"version": "7.5.12",
"version": "7.5.13",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "9ba59817745b0fe0c1a5a3032dfd4a6d2994ad1c"
"reference": "b9278591caa8630127f96c63b598712b699e671c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9ba59817745b0fe0c1a5a3032dfd4a6d2994ad1c",
"reference": "9ba59817745b0fe0c1a5a3032dfd4a6d2994ad1c",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b9278591caa8630127f96c63b598712b699e671c",
"reference": "b9278591caa8630127f96c63b598712b699e671c",
"shasum": ""
},
"require": {
@@ -3138,7 +3213,7 @@
"testing",
"xunit"
],
"time": "2019-05-28T11:59:40+00:00"
"time": "2019-06-19T12:01:51+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@@ -3706,6 +3781,352 @@
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-10-03T07:35:21+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v4.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "4e6c670af81c4fb0b6c08b035530a9915d0b691f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4e6c670af81c4fb0b6c08b035530a9915d0b691f",
"reference": "4e6c670af81c4fb0b6c08b035530a9915d0b691f",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/event-dispatcher-contracts": "^1.1"
},
"conflict": {
"symfony/dependency-injection": "<3.4"
},
"provide": {
"psr/event-dispatcher-implementation": "1.0",
"symfony/event-dispatcher-implementation": "1.1"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/http-foundation": "^3.4|^4.0",
"symfony/service-contracts": "^1.1",
"symfony/stopwatch": "~3.4|~4.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2019-05-30T16:10:05+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
"version": "v1.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
"reference": "c61766f4440ca687de1084a5c00b08e167a2575c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c61766f4440ca687de1084a5c00b08e167a2575c",
"reference": "c61766f4440ca687de1084a5c00b08e167a2575c",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"suggest": {
"psr/event-dispatcher": "",
"symfony/event-dispatcher-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\EventDispatcher\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Generic abstractions related to dispatching event",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2019-06-20T06:46:26+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v4.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/914e0edcb7cd0c9f494bc023b1d47534f4542332",
"reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\OptionsResolver\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony OptionsResolver Component",
"homepage": "https://symfony.com",
"keywords": [
"config",
"configuration",
"options"
],
"time": "2019-05-10T05:38:46+00:00"
},
{
"name": "symfony/polyfill-php70",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php70.git",
"reference": "bc4858fb611bda58719124ca079baff854149c89"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89",
"reference": "bc4858fb611bda58719124ca079baff854149c89",
"shasum": ""
},
"require": {
"paragonie/random_compat": "~1.0|~2.0|~9.99",
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php70\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.11.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/ab50dcf166d5f577978419edd37aa2bb8eabce0c",
"reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/stopwatch",
"version": "v4.3.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
"reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/6b100e9309e8979cf1978ac1778eb155c1f7d93b",
"reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/service-contracts": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Stopwatch\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Stopwatch Component",
"homepage": "https://symfony.com",
"time": "2019-05-27T08:16:38+00:00"
},
{
"name": "theseer/tokenizer",
"version": "1.1.3",
@@ -3804,7 +4225,8 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.1.0"
"php": "^7.1.0",
"ext-pdo": "*"
},
"platform-dev": []
}
+2 -1
View File
@@ -49,7 +49,7 @@ class Action
}
/**
* @return string|null
* @return null|string
*/
public function getTitle(): ?string
{
@@ -77,6 +77,7 @@ class Action
/**
* Sets all parameters for this action
* @param array $parameters
* @return void
*/
public function setParameters(array $parameters): void
{
+4 -3
View File
@@ -53,7 +53,7 @@ class Battle
/**
* Takes a game object and two participants (Player and Monster) to fight a battle.
* @param \LotGD\Core\Game $game
* @param Game $game
* @param FighterInterface $player
* @param FighterInterface $monster
*/
@@ -83,7 +83,7 @@ class Battle
* @param Game $game
* @param FighterInterface $player
* @param string $serialized
* @return Battle
* @return self
*/
public static function unserialize(Game $game, FighterInterface $player, string $serialized): self
{
@@ -241,7 +241,7 @@ class Battle
* Fights the number of rounds given by the parameter $n and returns the number
* of actual rounds fought.
* @param int $n
* @param bool $firstDamageRound Which damage rounds are calculated. Cannot be 0.
* @param int $firstDamageRound Which damage rounds are calculated. Cannot be 0.
* @return int Number of fights fought.
* @throws ArgumentException if firstDamageRound is 0.
* @throws BattleIsOverException
@@ -333,6 +333,7 @@ class Battle
* Runs one turn.
* @param FighterInterface $attacker
* @param FighterInterface $defender
* @return ArrayCollection
*/
protected function turn(FighterInterface $attacker, FighterInterface $defender): ArrayCollection
{
+9 -5
View File
@@ -7,6 +7,7 @@ use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\EventManager as DoctrineEventManager;
use Doctrine\Common\Util\Debug;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Events as DoctrineEvents;
use Doctrine\ORM\ {
EntityManager,
@@ -39,7 +40,7 @@ class Bootstrap
/**
* Create a new Game object, with all the necessary configuration.
* @param string $cwd
* @param string|null $cwd
* @return Game The newly created Game object.
*/
public static function createGame(string $cwd = null): Game
@@ -89,7 +90,7 @@ class Bootstrap
* Creates a library configuration manager
* @param ComposerManager $composerManager
* @param string $cwd
* @return \LotGD\Core\LibraryConfigurationManager
* @return LibraryConfigurationManager
*/
protected function createLibraryConfigurationManager(
ComposerManager $composerManager,
@@ -100,7 +101,9 @@ class Bootstrap
/**
* Connects to a database using pdo
* @param \LotGD\Core\Configuration $config
* @param string $dsn
* @param string $user
* @param string $password
* @return \PDO
*/
protected function connectToDatabase(string $dsn, string $user, string $password): \PDO
@@ -122,7 +125,7 @@ class Bootstrap
/**
* Returns a configuration object reading from the file located at the path stored in $cwd/config/lotgd.yml.
* @param string $cwd
* @return \LotGD\Core\Configuration
* @return Configuration
* @throws InvalidConfigurationException
*/
protected function createConfiguration(string $cwd): Configuration
@@ -157,6 +160,7 @@ class Bootstrap
/**
* Creates the EntityManager using the pdo connection given in it's argument
* @param \PDO $pdo
* @param Configuration
* @return EntityManagerInterface
*/
protected function createEntityManager(\PDO $pdo, Configuration $config): EntityManagerInterface
@@ -173,7 +177,7 @@ class Bootstrap
// Register uuid type
try {
\Doctrine\DBAL\Types\Type::addType('uuid', 'Ramsey\Uuid\Doctrine\UuidType');
Type::addType('uuid', 'Ramsey\Uuid\Doctrine\UuidType');
} catch (DBALException $e) {}
// Create Schema and update database if needed
+4 -3
View File
@@ -32,7 +32,7 @@ class BuffList
protected $buffs;
protected $buffsBySlot;
protected $activeBuffs = [];
/** @var Doctrine\Common\Collections\ArrayCollection */
/** @var ArrayCollection */
protected $usedBuffs;
/** @var boolean True of the modifiers have already been calculated */
@@ -136,6 +136,7 @@ class BuffList
/**
* Returns whether any buffs are in use.
* @return bool
*/
public function hasBuffsInUse(): bool
{
@@ -391,7 +392,7 @@ class BuffList
/**
* Processes buffs that do direct damage or regeneration
* @param int $activation
* @param \LotGD\Core\Game $game
* @param Game $game
* @param FighterInterface $goodguy
* @param FighterInterface $badguy
* @return Collection
@@ -493,7 +494,7 @@ class BuffList
* Processes buffs that are dependant on the damage done in one round
* @param int $activation
* @param int $damage Positive damage is applied to the badguy, negative damage is applied to the goodguy
* @param \LotGD\Core\Game $game
* @param Game $game
* @param FighterInterface $goodguy
* @param FighterInterface $badguy
* @return Collection
+4 -2
View File
@@ -3,10 +3,10 @@ declare(strict_types=1);
namespace LotGD\Core;
use Exception;
use Composer\{
Composer, Factory, IO\NullIO, Package\CompletePackageInterface, Package\PackageInterface
};
use Monolog\Logger;
use LotGD\Core\{
Exceptions\InvalidConfigurationException,
@@ -53,7 +53,8 @@ class ComposerManager
/**
* Return the Composer package for the corresponding library, in vendor/module format.
* @return PackageInterface Package corresponding to this library.
* @param string $library
* @return CompletePackageInterface Package corresponding to this library.
* @throws LibraryDoesNotExistException
*/
public function getPackageForLibrary(string $library): CompletePackageInterface
@@ -148,6 +149,7 @@ class ComposerManager
/**
* Returns a path (could be relative) to the proper autoload.php file in
* the current setup.
* @return string
*/
public function findAutoloader(): string
{
+1
View File
@@ -213,6 +213,7 @@ class Configuration
/**
* Generate a textual representation of the configuration, for debugging
* purposes.
* @return string
*/
public function __toString(): string
{
+3 -1
View File
@@ -100,7 +100,9 @@ class SceneConnectionGroup implements SceneConnectable
}
/**
* @inheritDoc
* @param SceneConnectable $connectable
* @param int|null $directionality
* @return SceneConnection
*/
public function connect(SceneConnectable $connectable, int $directionality = null): SceneConnection
{
+4 -3
View File
@@ -202,7 +202,7 @@ class Viewpoint implements CreateableInterface
/**
* Adds a new action group to a viewpoint
* @param ActionGroup $group The new group to add.
* @param null|string $after, optional group id that comes before.
* @param null|string $after Optional group id that comes before.
* @throws ArgumentException
*/
public function addActionGroup(ActionGroup $group, ?string $after = null): void
@@ -228,7 +228,7 @@ class Viewpoint implements CreateableInterface
/**
* Returns an action group by id or fails.
* @param $actionGroupId
* @param string $actionGroupId
* @return ActionGroup|null
*/
public function findActionGroupById(string $actionGroupId): ?ActionGroup
@@ -302,7 +302,7 @@ class Viewpoint implements CreateableInterface
/**
* Returns a single data field
* @param string $fieldname Fieldname
* @param mixed $default default value
* @param mixed $default Default value
* @return mixed
*/
public function getDataField(string $fieldname, $default = null)
@@ -313,6 +313,7 @@ class Viewpoint implements CreateableInterface
/**
* Sets a single data field
* @param string $fieldname
* @param mixed $value
*/
public function setDataField(string $fieldname, $value)
{
-1
View File
@@ -5,7 +5,6 @@ namespace LotGD\Core\Models;
/**
* Represents a complete set of viewpoint data used to restore a saved viewpoint.
* @package LotGD\Core\Models
*/
class ViewpointSnapshot
{
+2 -2
View File
@@ -150,7 +150,7 @@ class ModuleManager
/**
* Returns the list of currently registered modules.
* @return array<Module> Array of modules.
* @return ModuleModel[] Array of modules.
*/
public function getModules(): array
{
@@ -160,7 +160,7 @@ class ModuleManager
/**
* Returns the module with the specified library name, in vendor/module format.
* @param string $library
* @return Module
* @return ModuleModel|null
*/
public function getModule(string $library): ?ModuleModel
{
+7 -7
View File
@@ -48,7 +48,7 @@ class PermissionManager
/**
* Construct a permission manager.
* @param Game $g The game.
* @param Game $game The game.
*/
public function __construct(Game $game)
{
@@ -57,7 +57,7 @@ class PermissionManager
/**
* Checks if an actor has a permission set. No assumption can be made if it's allowed or denied.
* @param \LotGD\Core\PermissionableInterface $actor
* @param Actor $actor
* @param string $permissionId
* @return bool True if the permission has been set, be it allowed or denied.
*/
@@ -74,7 +74,7 @@ class PermissionManager
/**
* Checks if an actor is allowed a given permission.
* @param \LotGD\Core\PermissionableInterface $actor
* @param Actor $actor
* @param string $permissionId
* @return bool True if the actor has the permission set and it's state is allowed.
*/
@@ -91,7 +91,7 @@ class PermissionManager
/**
* Checks if an actor is denied a given permission.
* @param \LotGD\Core\PermissionableInterface $actor
* @param Actor $actor
* @param string $permissionId
* @return bool True if the actor has the permission set and it's state is denied.
*/
@@ -126,7 +126,7 @@ class PermissionManager
/**
* Allows an actor a permission given by the permission id.
* @param PermissionableInterface $actor
* @param Actor $actor
* @param string $permissionId
*/
public function allow(
@@ -152,7 +152,7 @@ class PermissionManager
/**
* Denies an actor a permission given by the permission id.
* @param PermissionableInterface $actor
* @param Actor $actor
* @param string $permissionId
*/
public function deny(
@@ -178,7 +178,7 @@ class PermissionManager
/**
* Removes a permission from an actor.
* @param PermissionableInterface $actor
* @param Actor $actor
* @param string $permissionId
*/
public function remove(
+8 -1
View File
@@ -64,7 +64,7 @@ class TimeKeeper
/**
* Returns whether a user who is interating with the game now and last
* interacted at $lastInteractionTime should experience a New Day event.
* @param DateTime|null $lastInteractionTime
* @param DateTime $lastInteractionTime
* @return bool
*/
public function isNewDay(?DateTime $lastInteractionTime): bool
@@ -143,6 +143,13 @@ class TimeKeeper
/**
* Convenience method to generate a DateInterval from an exploded date.
* @param int $years
* @param int $days
* @param int $hours
* @param int $minutes
* @param int $seconds
* @return \DateInterval
* @throws \Exception
*/
private function interval(
int $years,
+5 -1
View File
@@ -7,10 +7,14 @@ use LotGD\Core\ModelExtender;
/**
* Trait to add the __call class required for extendable models.
* @package LotGD\Core\Tools\Model
*/
trait ExtendableModel
{
/**
* @param mixed $method
* @param mixed $arguments
* @return mixed
*/
public function __call($method, $arguments)
{
$callback = ModelExtender::get(self::class, $method);
+6 -1
View File
@@ -8,16 +8,21 @@ use LotGD\Core\Game;
/**
* Helper trait to implement public setGame from GameAwareInterface and private getGame for internal use.
* @package LotGD\Core\Tools\Model
*/
trait GameAware
{
private $game;
/**
* @param Game $game
*/
public function setGame(Game $game) {
$this->game = $game;
}
/**
* @return Game
*/
public function getGame(): Game {
return $this->game;
}
+65
View File
@@ -17,76 +17,141 @@ use Ramsey\Uuid\UuidInterface;
*/
trait MockCharacter
{
/**
* @param mixed $name
* @param mixed $arguments
* @throws IsNullException
*/
public function __call($name, $arguments)
{
throw new IsNullException();
}
/**
* @return UuidInterface
* @throws IsNullException
*/
public function getId(): UuidInterface
{
throw new IsNullException();
}
/**
* @return string
* @throws IsNullException
*/
public function getName(): string
{
throw new IsNullException();
}
/**
* @return string
* @throws IsNullException
*/
public function getDisplayName(): string
{
throw new IsNullException();
}
/**
* @return int
* @throws IsNullException
*/
public function getHealth(): int
{
throw new IsNullException();
}
/**
* @param int $amount
* @throws IsNullException
*/
public function setHealth(int $amount)
{
throw new IsNullException();
}
/**
* @param int $damage
* @throws IsNullException
*/
public function damage(int $damage)
{
throw new IsNullException();
}
/**
* @param int $heal
* @param bool $overheal
* @throws IsNullException
*/
public function heal(int $heal, bool $overheal = false)
{
throw new IsNullException();
}
/**
* @return int
* @throws IsNullException
*/
public function getMaxHealth(): int
{
throw new IsNullException();
}
/**
* @return int
* @throws IsNullException
*/
public function getLevel(): int
{
throw new IsNullException();
}
/**
* @return bool
* @throws IsNullException
*/
public function isAlive(): bool
{
throw new IsNullException();
}
/**
* @param bool $ignoreBuffs
* @return int
* @throws IsNullException
*/
public function getAttack(bool $ignoreBuffs = false): int
{
throw new IsNullException();
}
/**
* @param bool $ignoreBuffs
* @return int
* @throws IsNullException
*/
public function getDefense(bool $ignoreBuffs = false): int
{
throw new IsNullException();
}
/**
* @return Viewpoint
* @throws IsNullException
*/
public function getViewpoint(): Viewpoint
{
throw new IsNullException();
}
/**
* @param string $name
* @param null $default
* @return null
*/
public function getProperty(string $name, $default = null)
{
return $default;
@@ -20,6 +20,12 @@ trait PermissionAssociationable
/** @Column(type="integer") */
protected $permissionState;
/**
* PermissionAssociationable constructor.
* @param Actor $owner
* @param Permission $permission
* @param int $state
*/
public function __construct(Actor $owner, Permission $permission, int $state) {
$this->owner = $owner;
$this->permission = $permission;
+59 -31
View File
@@ -46,7 +46,7 @@ class OneToManyCollection implements Collection
/**
* Returns the class this collection consists of.
* @return string
* @return ClassMetadata
*/
public function getTypeClass(): ClassMetadata
{
@@ -54,7 +54,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return int
* @throws \Doctrine\ORM\NonUniqueResultException
*/
public function count(): int
{
@@ -87,7 +88,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $element
* @return true|void
* @throws WrongTypeException
*/
public function add($element)
{
@@ -102,7 +105,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* Clears the collection.
*/
public function clear()
{
@@ -114,7 +117,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $element
* @return bool
*/
public function contains($element): bool
{
@@ -128,7 +132,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return bool
*/
public function isEmpty(): bool
{
@@ -136,7 +140,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param int|string $key
* @return mixed|void
*/
public function remove($key)
{
@@ -147,7 +152,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $element
* @return bool|void
*/
public function removeElement($element)
{
@@ -159,7 +165,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param int|string $key
* @return bool
*/
public function containsKey($key)
{
@@ -182,7 +189,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return array
*/
public function getKeys(): array
{
@@ -190,7 +197,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return array
*/
public function getValues(): array
{
@@ -198,7 +205,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param int|string $key
* @param mixed $value
* @throws WrongTypeException
*/
public function set($key, $value)
{
@@ -210,7 +219,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return array
*/
public function toArray(): array
{
@@ -218,23 +227,23 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return mixed
*/
public function first()
{
return first($this->collection);
return array_values($this->collection)[0];
}
/**
* @inheritDoc
* @return mixed
*/
public function last()
{
return last($this->collection);
return array_values($this->collection)[count($this->collection)];
}
/**
* @inheritDoc
* @return int|string|null
*/
public function key()
{
@@ -242,7 +251,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return mixed|object
*/
public function next()
{
@@ -250,7 +259,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @return mixed|object
*/
public function current()
{
@@ -258,7 +267,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param \Closure $p
* @return bool
* @throws NotImplementedException
*/
public function exists(\Closure $p): bool
{
@@ -266,7 +277,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param \Closure $p
* @return Collection|void
* @throws NotImplementedException
*/
public function filter(\Closure $p)
{
@@ -274,7 +287,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param \Closure $p
* @return bool|void
* @throws NotImplementedException
*/
public function forAll(\Closure $p)
{
@@ -282,7 +297,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param \Closure $p
* @return Collection|void
* @throws NotImplementedException
*/
public function map(\Closure $p)
{
@@ -290,7 +307,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param \Closure $p
* @return Collection[]|void
* @throws NotImplementedException
*/
public function partition(\Closure $p)
{
@@ -298,7 +317,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $element
* @return bool|false|int|string
* @throws WrongTypeException
*/
public function indexOf($element)
{
@@ -307,7 +328,10 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param int $offset
* @param null $length
* @return array|void
* @throws NotImplementedException
*/
public function slice($offset, $length = null)
{
@@ -324,7 +348,9 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $key
* @return mixed
* @throws KeyNotFoundException
*/
public function offsetGet($key)
{
@@ -332,7 +358,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $key
* @param mixed $element
*/
public function offsetSet($key, $element)
{
@@ -340,7 +367,7 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $key
*/
public function offsetUnset($key)
{
@@ -348,7 +375,8 @@ class OneToManyCollection implements Collection
}
/**
* @inheritDoc
* @param mixed $key
* @return bool
*/
public function offsetExists($key)
{
+1 -1
View File
@@ -6,7 +6,6 @@ namespace LotGD\Core\Tools;
/**
* Abstracts a scene description and provides tools to modify the text more easily.
* Class SceneDescription
* @package LotGD\Core\Tools
*/
class SceneDescription
{
@@ -42,6 +41,7 @@ class SceneDescription
/**
* Adds a paragraph to the description. If the paragraph contains \n\n, it gets broken into multiple paragraphs first.
* @param string $paragraph
* @return void
*/
public function addParagraph(string $paragraph): void
{
+2 -1
View File
@@ -1,3 +1,4 @@
#!/bin/bash -ex
./vendor/bin/phpunit --stop-on-failure
./vendor/bin/phpdoccheck -d src --no-ansi
./vendor/bin/phpcs src
#./vendor/bin/phpdoccheck -d src --no-ansi