Skip to content

Commit

Permalink
Fix Latte 2.5 compatibility (#164)
Browse files Browse the repository at this point in the history
* Remove Kdyby\StrictObjects\Scream trait from Kdyby\Translation\Latte\TranslateMacros since it's ancestor uses Tracy\Strict

* Fix Kdyby\Monolog compatibility issue

* Drop support for PHP < 7.1, add PHP 7.3 to tests

* Move tests to the end of testing pipeline

* Remove shortNoEscape (deprecated in Latte 2.4.0 and removed in Latte 2.5.0)
  • Loading branch information
jankonas authored and enumag committed May 31, 2019
1 parent 6b0721c commit 0619a64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ cache:
- $HOME/.composer/cache

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

env:
- # dev
Expand All @@ -20,14 +19,14 @@ env:
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.3
env: COMPOSER_EXTRA_ARGS="--prefer-stable" COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.2
- php: 7.3
env: COMPOSER_EXTRA_ARGS="--prefer-stable" PHPSTAN=1
- php: 7.2
- php: 7.3
env: COMPOSER_EXTRA_ARGS="--prefer-stable" CODING_STANDARD=1
exclude:
- php: 7.2
- php: 7.3
env: COMPOSER_EXTRA_ARGS="--prefer-stable"
allow_failures:
- env:
Expand All @@ -40,10 +39,10 @@ install:
- if [ "$COVERAGE" != "" ]; then travis_retry wget -O /tmp/coveralls.phar https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar; fi

script:
- vendor/bin/tester $COVERAGE -s -p ${TESTER_RUNTIME:-php} -c ./tests/php.ini-unix ./tests/KdybyTests/
- php /tmp/php-parallel-lint/parallel-lint.php -e php,phpt --exclude vendor .
- if [ "$PHPSTAN" = "1" ]; then php vendor/phpstan/phpstan-shim/phpstan.phar analyse --ansi --no-progress -l7 -c phpstan.neon src tests/KdybyTests; fi
- if [ "$CODING_STANDARD" = "1" ]; then php vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 -sp src tests; fi
- vendor/bin/tester $COVERAGE -s -p ${TESTER_RUNTIME:-php} -c ./tests/php.ini-unix ./tests/KdybyTests/

after_script:
- if [ "$COVERAGE" != "" ]; then php /tmp/coveralls.phar --verbose --config tests/.coveralls.yml || true; fi
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"issues": "https://github.com/kdyby/translation/issues"
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.1",
"kdyby/strict-objects": "^1.0",
"latte/latte": "^2.4.6@dev",
"nette/caching": "^2.5@dev",
Expand Down Expand Up @@ -45,7 +45,7 @@
"nette/forms": "^2.4.6@dev",
"tracy/tracy": "^2.4.9@dev",
"kdyby/console": "^2.7.1@dev",
"kdyby/monolog": "^1.3.2@dev",
"kdyby/monolog": "^1.4.0@dev",
"symfony/yaml": "^3.4 || ^4.0",
"symfony/console": "^3.4 || ^4.0",
"nette/tester": "^2.0",
Expand Down
1 change: 0 additions & 1 deletion src/Extractors/LatteExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function extractFile($file, MessageCatalogue $catalogue)
{
$buffer = NULL;
$parser = new Parser();
$parser->shortNoEscape = TRUE;

foreach ($tokens = $parser->parse(file_get_contents($file)) as $token) {
if ($token->type !== $token::MACRO_TAG || !in_array($token->name, ['_', '/_'], TRUE)) {
Expand Down
2 changes: 0 additions & 2 deletions src/Latte/TranslateMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
class TranslateMacros extends \Latte\Macros\MacroSet
{

use \Kdyby\StrictObjects\Scream;

public static function install(Compiler $compiler)
{
$me = new static($compiler);
Expand Down

0 comments on commit 0619a64

Please sign in to comment.