Skip to content

Commit

Permalink
Merge pull request #2 from cvc-digital/support-twig-3
Browse files Browse the repository at this point in the history
Support Twig v3 only
  • Loading branch information
markuspoerschke committed Mar 31, 2020
2 parents c1b11cc + 2935796 commit 37a28eb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
19 changes: 5 additions & 14 deletions .travis.yml
Expand Up @@ -49,35 +49,26 @@ jobs:
- <<: *lint_php
name: Lint PHP 7.3
php: 7.3
- <<: *lint_php
name: Lint PHP 7.2
php: 7.2
- <<: *editor_config
name: Lint Editorconfig
php: 7.4
- <<: *psalm
name: Psalm (PHP 7.3)
php: 7.3
- <<: *psalm
name: Psalm (PHP 7.4)
php: 7.4
- <<: *psalm
name: Psalm (PHP 7.2)
php: 7.2
name: Psalm (PHP 7.3)
php: 7.3
- <<: *unit_tests
name: Unit Tests (PHP 7.4, highest)
php: 7.4
- <<: *unit_tests
name: Unit Tests (PHP 7.3, highest)
php: 7.3
- <<: *unit_tests
name: Unit Tests (PHP 7.2, highest)
php: 7.2
name: Unit Tests (PHP 7.4, lowest)
php: 7.4
env: dependencies=lowest
- <<: *unit_tests
name: Unit Tests (PHP 7.3, lowest)
php: 7.3
env: dependencies=lowest
- <<: *unit_tests
name: Unit Tests (PHP 7.2, lowest)
php: 7.2
env: dependencies=lowest
11 changes: 11 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.2.0

### Changed

* Support Twig v3 only

### Removed

* Support PHP 7.2
* Support Twig v2

## 0.1.0

### Added
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -23,8 +23,8 @@
}
],
"require": {
"php": ">=7.2",
"twig/twig": "^2.0",
"php": ">=7.3",
"twig/twig": "^3.0",
"phpdocumentor/reflection-docblock": "^4.3"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions src/Describer/FilterDescriber.php
Expand Up @@ -18,8 +18,8 @@ final class FilterDescriber extends AbstractDescriber
{
public function describe(TwigFilter $filter): FilterDescription
{
$skipParameters = $filter->needsContext() + $filter->needsEnvironment();
$description = $this->describeCallable(new FilterDescription($filter->getName()), $filter->getCallable(), $skipParameters);
$numberOfSkippedParameters = intval($filter->needsContext()) + intval($filter->needsEnvironment());
$description = $this->describeCallable(new FilterDescription($filter->getName()), $filter->getCallable(), $numberOfSkippedParameters);
assert($description instanceof FilterDescription);

return $description;
Expand Down
4 changes: 2 additions & 2 deletions src/Describer/FunctionDescriber.php
Expand Up @@ -18,8 +18,8 @@ final class FunctionDescriber extends AbstractDescriber
{
public function describe(TwigFunction $function): FunctionDescription
{
$skipParameters = $function->needsContext() + $function->needsEnvironment();
$description = $this->describeCallable(new FunctionDescription($function->getName()), $function->getCallable(), $skipParameters);
$numberOfSkippedParameters = intval($function->needsContext()) + intval($function->needsEnvironment());
$description = $this->describeCallable(new FunctionDescription($function->getName()), $function->getCallable(), $numberOfSkippedParameters);
assert($description instanceof FunctionDescription);

return $description;
Expand Down

0 comments on commit 37a28eb

Please sign in to comment.