Skip to content

Commit

Permalink
Update to phpstan v9
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 6, 2018
1 parent 6407198 commit 1df3e98
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ before_script:
- composer install --prefer-dist --no-interaction

- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:dev-master; fi
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan:^0.8; fi
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan:^0.9; fi

script:
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.0 ]]; then vendor/bin/phpunit; fi
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi

- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ config/; fi
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 5 src; fi
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -c phpstan.neon -l 5 src; fi

after_success:
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then bash <(curl -s https://codecov.io/bash); fi
Expand Down
10 changes: 10 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parameters:
universalObjectCratesClasses:
- Crud\Event\Subject
ignoreErrors:
- '#Access to an undefined property object::\$element#'
- '#Access to an undefined property object::\$params#'
- '#Access to an undefined property object::\$query#'
- '#Access to an undefined property object::\$type#'
- '#Parameter \#1 $dateTime of method Cake\\View\\Helper\\TimeHelper::timeAgoInWords\(\) expects Cake\\Chronos\\ChronosInterface|DateTime|int|string, DateTime|DateTimeImmutable|int|string given#'
- '#Parameter \#1 $dateString of method Cake\\View\\Helper\\TimeHelper::nice() expects DateTime|int|string|null, DateTime|DateTimeImmutable|int|string given#'
2 changes: 1 addition & 1 deletion src/Breadcrumb/Breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct($title, $url = null, array $options = [])
/**
* Returns the menu item title
*
* @return string
* @return string|array
*/
public function getTitle()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,15 @@ protected function _primaryKeyValue()
*
* If no value can be found, NULL is returned
*
* @return string
* @return string|null
*/
protected function _displayFieldValue()
{
return $this->_deriveFieldFromContext($this->_table()->getDisplayField());
}

/**
* Extract a field value from a either the CakeRequest::getData()
* Extract a field value from a either ServerRequest::getData()
* or Controller::$viewVars for the current model + the supplied field
*
* @param string $field Name of field.
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/CrudViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function formatString($field, $value)
* Format display field value.
*
* @param string $value Display field value.
* @param mixed $options Field options.
* @param array $options Field options.
* @return string
*/
public function formatDisplayField($value, array $options)
Expand Down

0 comments on commit 1df3e98

Please sign in to comment.