Skip to content

Commit

Permalink
Update travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Dec 25, 2019
1 parent 40ce931 commit a7b2b8a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 7.2
- 7.3
- 7.4

env:
global:
Expand All @@ -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
3 changes: 2 additions & 1 deletion src/Breadcrumb/ActiveBreadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
class ActiveBreadcrumb extends Breadcrumb
{
/**
* {@inheritDoc}
* @inheritDoc
* @psalm-suppress MissingParamType
*/
public function __construct($title, $url = null, array $options = [])
{
Expand Down
12 changes: 6 additions & 6 deletions src/View/Helper/CrudViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

/**
Expand All @@ -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 */
Expand All @@ -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']);
}

/**
Expand All @@ -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;

Expand All @@ -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']);
}

/**
Expand Down

0 comments on commit a7b2b8a

Please sign in to comment.