summaryrefslogtreecommitdiffstats
path: root/php-kukulich-fshl-php71.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-02-16 12:19:36 +0100
committerRemi Collet <fedora@famillecollet.com>2017-02-16 12:19:36 +0100
commitcda658dfc27a0bef6272a0b05767edc0a668c725 (patch)
treee09f761bbb62a2927dad3da2a70136c0e7e84328 /php-kukulich-fshl-php71.patch
parent8bc42fc77a92d62870743ac109dbf8a2112633fc (diff)
php-kukulich-fshl: add patch for PHP 7.1HEADmaster
Diffstat (limited to 'php-kukulich-fshl-php71.patch')
-rw-r--r--php-kukulich-fshl-php71.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/php-kukulich-fshl-php71.patch b/php-kukulich-fshl-php71.patch
new file mode 100644
index 0000000..63fb55e
--- /dev/null
+++ b/php-kukulich-fshl-php71.patch
@@ -0,0 +1,72 @@
+From ae00651ce648c576ba37b79755a804801b592604 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Thu, 16 Feb 2017 12:08:34 +0100
+Subject: [PATCH 1/2] workaround PHP 7.1 issue, fixed #12
+
+---
+ FSHL/Highlighter.php | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/FSHL/Highlighter.php b/FSHL/Highlighter.php
+index 04e7b42..d3c9e38 100644
+--- a/FSHL/Highlighter.php
++++ b/FSHL/Highlighter.php
+@@ -250,7 +250,7 @@ public function highlight($text, Lexer $lexer = null)
+ }
+
+ // Switches between lexers (transition to embedded language)
+- if ($this->lexer->flags[$newState] & Generator::STATE_FLAG_NEWLEXER) {
++ if ((int)$this->lexer->flags[$newState] & Generator::STATE_FLAG_NEWLEXER) {
+ if ($newState === $this->lexer->quitState) {
+ // Returns to the previous lexer
+ if ($item = $this->popState()) {
+@@ -275,7 +275,7 @@ public function highlight($text, Lexer $lexer = null)
+ }
+
+ // If newState is marked with recursion flag (alias call), push current state to the context stack
+- if (($this->lexer->flags[$newState] & Generator::STATE_FLAG_RECURSION) && $state !== $newState) {
++ if (((int)$this->lexer->flags[$newState] & Generator::STATE_FLAG_RECURSION) && $state !== $newState) {
+ $this->pushState($lexerName, $state);
+ }
+
+@@ -434,7 +434,7 @@ private function generateCache(Lexer $lexer)
+ */
+ private function template($part, $state)
+ {
+- if ($this->lexer->flags[$state] & Generator::STATE_FLAG_KEYWORD) {
++ if ((int)$this->lexer->flags[$state] & Generator::STATE_FLAG_KEYWORD) {
+ $normalized = Generator::CASE_SENSITIVE === $this->lexer->keywords[Generator::KEYWORD_INDEX_CASE_SENSITIVE] ? $part : strtolower($part);
+
+ if (isset($this->lexer->keywords[Generator::KEYWORD_INDEX_LIST][$normalized])) {
+
+From 213824a607741ef08cffd0d2b7dfa112f2e6ae9d Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Thu, 16 Feb 2017 12:09:59 +0100
+Subject: [PATCH 2/2] enable more versions in travis
+
+---
+ .travis.yml | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/.travis.yml b/.travis.yml
+index 901bf6a..66db7f9 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -3,6 +3,10 @@ language: php
+ php:
+ - 5.3
+ - 5.4
++ - 5.5
++ - 5.6
++ - 7.0
++ - 7.1
+
+ branches:
+ only:
+@@ -13,4 +17,4 @@ notifications:
+ email:
+ - kontakt@kukulich.cz
+
+-script: phpunit tests/FSHL
+\ No newline at end of file
++script: phpunit tests/FSHL