Skip to content

Commit 02b6aa6

Browse files
committed
Drop support for PHP 5.3 and HHVM, added support for PHP 7.2
1 parent 014bfec commit 02b6aa6

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

.travis.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
language: php
22

33
php:
4-
- 5.3.3
54
- 5.4
65
- 5.5
76
- 5.6
87
- 7.0
98
- 7.1
10-
- hhvm
9+
- 7.2
1110

1211
sudo: false
1312

@@ -17,8 +16,6 @@ cache:
1716
- $HOME/.composer/cache
1817

1918
before_script:
20-
- if [ "$TRAVIS_PHP_VERSION" == "5.3.3" ]; then composer config disable-tls true; fi
21-
- if [ "$TRAVIS_PHP_VERSION" == "5.3.3" ]; then composer config secure-http false; fi
2219
- composer install --no-interaction --prefer-source
2320

2421
script:

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"psr-4": {"JakubOnderka\\PhpConsoleHighlighter\\": "src/"}
1414
},
1515
"require": {
16-
"php": ">=5.3.0",
16+
"php": ">=5.4.0",
1717
"ext-tokenizer": "*",
1818
"jakub-onderka/php-console-color": "~0.1"
1919
},

src/Highlighter.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,12 @@ private function tokenize($source)
151151
case T_LINE:
152152
case T_CLASS_C:
153153
case T_FUNC_C:
154-
//case T_TRAIT_C:
154+
case T_TRAIT_C:
155155
$newType = self::TOKEN_DEFAULT;
156156
break;
157157

158158
default:
159-
// Compatibility with PHP 5.3
160-
if (defined('T_TRAIT_C') && $token[0] === T_TRAIT_C) {
161-
$newType = self::TOKEN_DEFAULT;
162-
} else {
163-
$newType = self::TOKEN_KEYWORD;
164-
}
159+
$newType = self::TOKEN_KEYWORD;
165160
}
166161
} else {
167162
$newType = $token === '"' ? self::TOKEN_STRING : self::TOKEN_KEYWORD;

0 commit comments

Comments
 (0)