Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of Grumphp #24

Merged
merged 8 commits into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ vendor/
tmp/

.DS_STORE

31 changes: 31 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
$finder = PhpCsFixer\Finder::create()
->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);
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

@dnl-blkv dnl-blkv Aug 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? Is it 5.6 because it is the lowest platform we support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

  1. There will be no longer problems as phpstan/phpstan in (7e8fad5). When someone now try to install an packages which has no support for PHP 5.6 they will get an Composer error

composer require phpstan/phpstan

[InvalidArgumentException]                                                               
Could not find package phpstan/phpstan at any version matching your PHP version 5.6.0.0  
  1. Now I don't need to change my local environment to PHP 5.6 when I add/update some PHP packages.

}
}
}
75 changes: 75 additions & 0 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/Util/InstallationUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down