Skip to content

Commit

Permalink
Merge pull request #292 from tsukasa-mixer/master
Browse files Browse the repository at this point in the history
parseChain array result support
  • Loading branch information
bzick authored Mar 28, 2018
2 parents 7b0dab9 + d141b14 commit 9a1e56d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ language: php
sudo: false

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2

before_script:
- composer global require satooshi/php-coveralls
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Fenom - Template Engine for PHP
* **Subject:** Template engine
* **Syntax:** Smarty-like
* **Documentation:** **[English](./docs/en/readme.md)**, **[Russian](./docs/ru/readme.md)**
* **PHP version:** 5.3+
* **PHP version:** 5.4+
* **State:** [![Build Status](https://travis-ci.org/fenom-template/fenom.svg?branch=master)](https://travis-ci.org/fenom-template/fenom) [![Coverage Status](https://coveralls.io/repos/fenom-template/fenom/badge.svg?branch=master)](https://coveralls.io/r/fenom-template/fenom?branch=master)
* **Version:** [![Latest Stable Version](https://poser.pugx.org/fenom/fenom/v/stable.png)](https://packagist.org/packages/fenom/fenom)
* **Packagist:** [fenom/fenom](https://packagist.org/packages/fenom/fenom) [![Total Downloads](https://poser.pugx.org/fenom/fenom/downloads.png)](https://packagist.org/packages/fenom/fenom)
Expand Down
4 changes: 4 additions & 0 deletions src/Fenom/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,10 @@ public function parseChain(Tokenizer $tokens, $code)
if ($tokens->is(T_OBJECT_OPERATOR) && $tokens->isNext(T_STRING)) {
$code .= '->' . $tokens->next()->getAndNext();
}
if ($tokens->current() === "." || $tokens->current() === "[") {
$code = substr($code, 0, -strlen($tokens->prev[1]));
$code .= $this->parseVariable($tokens, $tokens->prev[1]);
}
} while ($tokens->is('(', T_OBJECT_OPERATOR));

return $code;
Expand Down

0 comments on commit 9a1e56d

Please sign in to comment.