From a7b2b8a32f45e95798fb3c56e86eca2d8da706d7 Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 25 Dec 2019 18:53:29 +0530 Subject: [PATCH] Update travis config --- .travis.yml | 15 ++++++++------- src/Breadcrumb/ActiveBreadcrumb.php | 3 ++- src/View/Helper/CrudViewHelper.php | 12 ++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3780cf2..bf40f66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php php: - 7.2 - 7.3 + - 7.4 env: global: @@ -17,29 +18,29 @@ matrix: env: PHPCS=1 DEFAULT=0 - php: 7.2 - env: PHPSTAN=1 DEFAULT=0 + env: STATIC_ANALYSIS=1 DEFAULT=0 - php: 7.2 env: DEFAULT=1 LOWEST=1 before_script: - - if [[ $TRAVIS_PHP_VERSION != 7.2 ]]; then phpenv config-rm xdebug.ini; fi + - if [[ $TRAVIS_PHP_VERSION != 7.3 ]]; then phpenv config-rm xdebug.ini; fi - if [[ $LOWEST = 0 ]]; then composer install --prefer-dist --no-interaction; fi - if [[ $LOWEST = 1 ]]; then composer update --prefer-lowest --prefer-dist --no-interaction; fi - if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:dev-next; fi - - if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan:^0.11; fi + - if [[ $STATIC_ANALYSIS = 1 ]]; then composer require phpstan/phpstan:^0.12 psalm/phar:^3.7; fi script: - - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.2 ]]; then vendor/bin/phpunit; fi - - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.2 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi + - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.3 ]]; then vendor/bin/phpunit; fi + - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.3 ]]; 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 src; fi + - if [[ $STATIC_ANALYSIS = 1 ]]; then vendor/bin/phpstan.phar analyse src && vendor/bin/psalm.phar; fi after_success: - - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.2 ]]; then bash <(curl -s https://codecov.io/bash); fi + - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.3 ]]; then bash <(curl -s https://codecov.io/bash); fi notifications: email: false diff --git a/src/Breadcrumb/ActiveBreadcrumb.php b/src/Breadcrumb/ActiveBreadcrumb.php index 95c32108..89f70c08 100644 --- a/src/Breadcrumb/ActiveBreadcrumb.php +++ b/src/Breadcrumb/ActiveBreadcrumb.php @@ -6,7 +6,8 @@ class ActiveBreadcrumb extends Breadcrumb { /** - * {@inheritDoc} + * @inheritDoc + * @psalm-suppress MissingParamType */ public function __construct($title, $url = null, array $options = []) { diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index 6087d129..efd04489 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -188,8 +188,8 @@ public function columnType(string $field): ?string public function formatBoolean(string $field, $value, array $options): string { return (bool)$value ? - $this->Html->label(__d('crud', 'Yes'), ['type' => empty($options['inverted']) ? 'success' : 'danger']) : - $this->Html->label(__d('crud', 'No'), ['type' => empty($options['inverted']) ? 'danger' : 'success']); + $this->Html->badge(__d('crud', 'Yes'), ['class' => empty($options['inverted']) ? 'success' : 'danger']) : + $this->Html->badge(__d('crud', 'No'), ['class' => empty($options['inverted']) ? 'danger' : 'success']); } /** @@ -203,7 +203,7 @@ public function formatBoolean(string $field, $value, array $options): string public function formatDate(string $field, $value, array $options): string { if ($value === null) { - return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']); + return $this->Html->badge(__d('crud', 'N/A'), ['class' => 'info']); } /** @psalm-suppress ArgumentTypeCoercion */ @@ -215,7 +215,7 @@ public function formatDate(string $field, $value, array $options): string return $this->Time->timeAgoInWords($value, $options); } - return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']); + return $this->Html->badge(__d('crud', 'N/A'), ['class' => 'info']); } /** @@ -229,7 +229,7 @@ public function formatDate(string $field, $value, array $options): string public function formatTime(string $field, $value, array $options): string { if ($value === null) { - return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']); + return $this->Html->badge(__d('crud', 'N/A'), ['class' => 'info']); } $format = $options['format'] ?? null; @@ -242,7 +242,7 @@ public function formatTime(string $field, $value, array $options): string return $this->Time->nice($value, $format); } - return $this->Html->label(__d('crud', 'N/A'), ['type' => 'info']); + return $this->Html->badge(__d('crud', 'N/A'), ['class' => 'info']); } /**