diff --git a/.gitignore b/.gitignore index c08ae891..0592df05 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,3 @@ vendor/ tmp/ .DS_STORE - diff --git a/.php_cs b/.php_cs new file mode 100644 index 00000000..1c3afccf --- /dev/null +++ b/.php_cs @@ -0,0 +1,31 @@ +in(__DIR__ . "/src"); + +return PhpCsFixer\Config::create() + ->setRules( + [ + '@PSR2' => true, + 'array_syntax' => [ + 'syntax' => 'short' + ], + 'class_keyword_remove' => false, + 'concat_space' => [ + 'spacing' => 'one' + ], + 'combine_consecutive_unsets' => true, + 'general_phpdoc_annotation_remove' => [ + 'annotations' => ['@author'], + ], + 'linebreak_after_opening_tag' => true, + 'no_short_echo_tag' => true, + 'no_useless_return' => true, + 'not_operator_with_space' => false, + 'not_operator_with_successor_space' => false, + 'ordered_imports' => true, + 'phpdoc_add_missing_param_annotation' => true, + 'protected_to_private' => true, + 'semicolon_after_instruction' => true, + ] + ) + ->setFinder($finder); diff --git a/composer.json b/composer.json index 58606889..c6b82ceb 100644 --- a/composer.json +++ b/composer.json @@ -37,18 +37,19 @@ } }, "require-dev": { + "friendsofphp/php-cs-fixer": "^2.4", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phpro/grumphp": "^0.11.6", "phpunit/phpunit": "^5.7", - "friendsofphp/php-cs-fixer": "^2.4" + "sensiolabs/security-checker": "^4.1" }, "bin": [ "bin/bunq-install" ], - "scripts": { - "phpcs": [ - "./vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no src" - ], - "phpcs-fix": [ - "./vendor/bin/php-cs-fixer fix -v --using-cache=no src" - ] + "config": { + "sort-packages": true, + "platform": { + "php": "5.6" + } } } diff --git a/grumphp.yml b/grumphp.yml new file mode 100644 index 00000000..35139875 --- /dev/null +++ b/grumphp.yml @@ -0,0 +1,75 @@ +parameters: + bin_dir: "./vendor/bin" + git_dir: "." + hide_circumvention_tip: false + hooks_dir: ~ + hooks_preset: local + ignore_unstaged_changes: false + process_async_limit: 10 + process_async_wait: 1000 + process_timeout: 60 + stop_on_failure: true + ascii: + failed: ~ + succeeded: ~ + tasks: + composer: + file: ./composer.json + no_check_all: false + no_check_lock: false + no_check_publish: false + with_dependencies: false + strict: true + git_blacklist: + keywords: + - "die(" + - "dump(" + - "exit;" + - "print_r(" + - "print_rr(" + - "var_dump(" + triggered_by: ['php'] + phpcpd: + directory: '.' + exclude: ['vendor'] + names_exclude: [] + fuzzy: false + min_lines: 5 + min_tokens: 70 + triggered_by: ['php'] + phpcsfixer2: + allow_risky: false + cache_file: ~ + config: ~ + rules: [] + using_cache: true + path_mode: ~ + verbose: true + phplint: + exclude: ['vendor'] + jobs: ~ + triggered_by: ['php', 'phtml'] + phpunit: + config_file: ~ + testsuite: ~ + group: [] + always_execute: false + phpversion: + project: '5.6' + securitychecker: + lockfile: ./composer.lock + format: ~ + end_point: ~ + timeout: ~ + run_always: true + xmllint: + ignore_patterns: [] + load_from_net: false + x_include: false + dtd_validation: false + scheme_validation: false + triggered_by: ['xml'] + yamllint: + ignore_patterns: [] + object_support: false + exception_on_invalid_type: true diff --git a/src/Util/InstallationUtil.php b/src/Util/InstallationUtil.php index 6a3684d1..33161573 100644 --- a/src/Util/InstallationUtil.php +++ b/src/Util/InstallationUtil.php @@ -79,7 +79,7 @@ public static function interactiveInstall() ); $methodInitializeInstallationContext->invoke($context); - $description = static::readline(self::PROMPT_DESCRIPTION, self::ERROR_EMPTY_DESCRIPTION); + $description = static::readLine(self::PROMPT_DESCRIPTION, self::ERROR_EMPTY_DESCRIPTION); $permittedIpsInput = static::readLineOrNull(self::PROMPT_PERMITTED_IPS); $permittedIps = static::formatIps($permittedIpsInput); $methodRegisterDevice = static::createAccessibleReflectionMethod(ApiContext::class, self::METHOD_REGISTER_DEVICE);