composer update

This commit is contained in:
Manish Verma
2018-12-05 10:50:52 +05:30
parent 9eabcacfa7
commit 4addd1e9c6
3328 changed files with 156676 additions and 138988 deletions

View File

@@ -1,21 +1,22 @@
language: php
php:
- 5.3.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
- hhvm-nightly
- 7.1
- 7.2
sudo: false
matrix:
allowed_failures:
- php: 7.0
- php: hhvm-nightly
cache:
directories:
- vendor
- $HOME/.composer/cache
before_script:
- composer install --no-interaction --prefer-source
script:
- ant
- ant

View File

@@ -37,4 +37,6 @@ echo $highlighter->getWholeFile($fileContent);
------
[![Downloads this Month](https://img.shields.io/packagist/dm/jakub-onderka/php-console-highlighter.svg)](https://packagist.org/packages/jakub-onderka/php-console-highlighter)
[![Build Status](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter.svg?branch=master)](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter)
[![License](https://poser.pugx.org/jakub-onderka/php-console-highlighter/license.svg)](https://packagist.org/packages/jakub-onderka/php-console-highlighter)

View File

@@ -1,5 +1,6 @@
{
"name": "jakub-onderka/php-console-highlighter",
"description": "Highlight PHP code in terminal",
"type": "library",
"license": "MIT",
"authors": [
@@ -10,15 +11,16 @@
}
],
"autoload": {
"psr-0": {"JakubOnderka\\PhpConsoleHighlighter": "src/"}
"psr-4": {"JakubOnderka\\PhpConsoleHighlighter\\": "src/"}
},
"require": {
"php": ">=5.3.0",
"jakub-onderka/php-console-color": "~0.1"
"php": ">=5.4.0",
"ext-tokenizer": "*",
"jakub-onderka/php-console-color": "~0.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"jakub-onderka/php-parallel-lint": "~0.5",
"jakub-onderka/php-parallel-lint": "~1.0",
"jakub-onderka/php-var-dump-check": "~0.1",
"squizlabs/php_codesniffer": "~1.5",
"jakub-onderka/php-code-style": "~1.0"

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/bootstrap.php">
<phpunit bootstrap="./vendor/autoload.php">
<testsuites>
<testsuite>
<directory>tests/*</directory>
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
@@ -12,4 +12,4 @@
<directory>vendor</directory>
</blacklist>
</filter>
</phpunit>
</phpunit>

View File

@@ -31,6 +31,7 @@ class Highlighter
/**
* @param ConsoleColor $color
* @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
*/
public function __construct(ConsoleColor $color)
{
@@ -118,20 +119,6 @@ class Highlighter
foreach ($tokens as $token) {
if (is_array($token)) {
switch ($token[0]) {
case T_INLINE_HTML:
$newType = self::TOKEN_HTML;
break;
case T_COMMENT:
case T_DOC_COMMENT:
$newType = self::TOKEN_COMMENT;
break;
case T_ENCAPSED_AND_WHITESPACE:
case T_CONSTANT_ENCAPSED_STRING:
$newType = self::TOKEN_STRING;
break;
case T_WHITESPACE:
break;
@@ -151,17 +138,26 @@ class Highlighter
case T_LINE:
case T_CLASS_C:
case T_FUNC_C:
//case T_TRAIT_C:
case T_TRAIT_C:
$newType = self::TOKEN_DEFAULT;
break;
case T_COMMENT:
case T_DOC_COMMENT:
$newType = self::TOKEN_COMMENT;
break;
case T_ENCAPSED_AND_WHITESPACE:
case T_CONSTANT_ENCAPSED_STRING:
$newType = self::TOKEN_STRING;
break;
case T_INLINE_HTML:
$newType = self::TOKEN_HTML;
break;
default:
// Compatibility with PHP 5.3
if (defined('T_TRAIT_C') && $token[0] === T_TRAIT_C) {
$newType = self::TOKEN_DEFAULT;
} else {
$newType = self::TOKEN_KEYWORD;
}
$newType = self::TOKEN_KEYWORD;
}
} else {
$newType = $token === '"' ? self::TOKEN_STRING : self::TOKEN_KEYWORD;
@@ -171,7 +167,7 @@ class Highlighter
$currentType = $newType;
}
if ($currentType != $newType) {
if ($currentType !== $newType) {
$output[] = array($currentType, $buffer);
$buffer = '';
$currentType = $newType;

View File

@@ -8,7 +8,9 @@ class HighlighterTest extends \PHPUnit_Framework_TestCase
protected function getConsoleColorMock()
{
$mock = $this->getMock('\JakubOnderka\PhpConsoleColor\ConsoleColor');
$mock = method_exists($this, 'createMock')
? $this->createMock('\JakubOnderka\PhpConsoleColor\ConsoleColor')
: $this->getMock('\JakubOnderka\PhpConsoleColor\ConsoleColor');
$mock->expects($this->any())
->method('apply')
@@ -260,4 +262,13 @@ EOL
''
);
}
}
public function testWhitespace()
{
$this->compare(
' '
,
'<token_html> </token_html>'
);
}
}

View File

@@ -1,2 +0,0 @@
<?php
$loader = require_once __DIR__ . '/../vendor/autoload.php';