Skip to content

Commit

Permalink
Backport composer commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 9, 2019
1 parent 89c70f4 commit 53c2536
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ env:
matrix:
include:
- php: 7.3
env: PHPCS=1 DEFAULT=0

- php: 7.3
env: PHPSTAN=1 DEFAULT=0
env: CHECKS=1 DEFAULT=0

before_script:
- if [[ $DEFAULT = 1 || $PHPCS = 1 ]]; then composer install; fi
- if [[ $DEFAULT = 1 ]]; then composer run-script post-install-cmd --no-interaction; fi
- if [[ $PHPSTAN = 1 ]]; then composer require --dev "phpstan/phpstan-shim"; fi
- composer install --no-interaction
- if [[ $DEFAULT == 1 ]]; then composer run-script post-install-cmd --no-interaction; fi

- if [[ $CHECKS == 1 ]]; then composer stan-setup; fi

script:
- if [[ $DEFAULT = 1 ]]; then vendor/bin/phpunit; fi
- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ config/ webroot/; fi
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 5 src/; fi
- if [[ $DEFAULT == 1 ]]; then composer test; fi

- if [[ $CHECKS == 1 ]]; then composer cs-check; fi
- if [[ $CHECKS == 1 ]]; then composer stan; fi

cache:
directories:
- $HOME/.composer/cache

notifications:
email: false
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
"@test",
"@cs-check"
],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-fix": "phpcbf --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-check": "phpcs --colors -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ config/ webroot/",
"cs-fix": "phpcbf --colors -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ config/ webroot/",
"stan": "phpstan analyse -l 5 src/",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
"test": "phpunit --colors=always"
},
"prefer-stable": true,
Expand Down
2 changes: 1 addition & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Router::scope('/', function (RouteBuilder $routes) {
// Register scoped middleware for in scopes.
$routes->registerMiddleware('csrf', new CsrfProtectionMiddleware([
'httpOnly' => true
'httpOnly' => true,
]));

/*
Expand Down

0 comments on commit 53c2536

Please sign in to comment.