Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdorn committed Nov 2, 2021
1 parent fedbb8c commit 400818b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

tin is a PHP code highlighter for the terminal.

[![Tests](https://github.com/felixdorn/tin/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/felixdorn/tin/actions/workflows/tests.yml)
[![Formats](https://github.com/felixdorn/tin/actions/workflows/formats.yml/badge.svg?branch=master)](https://github.com/felixdorn/tin/actions/workflows/formats.yml)
[![Tests](https://github.com/felixdorn/tin/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/felixdorn/tin/actions/workflows/tests.yml)
[![Formats](https://github.com/felixdorn/tin/actions/workflows/formats.yml/badge.svg?branch=main)](https://github.com/felixdorn/tin/actions/workflows/formats.yml)
[![Version](https://poser.pugx.org/felixdorn/tin/version)](//packagist.org/packages/felixdorn/tin)
[![Total Downloads](https://poser.pugx.org/felixdorn/tin/downloads)](//packagist.org/packages/felixdorn/tin)
[![License](https://poser.pugx.org/felixdorn/tin/license)](//packagist.org/packages/felixdorn/tin)
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"php": "^8.0"
},
"require-dev": {
"blackfire/php-sdk": "^1.27",
"friendsofphp/php-cs-fixer": "^v2.19.2",
"pestphp/pest": "^v1.20.0",
"phpstan/phpstan": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Tin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public function highlight(string $code): string
public function process(string $code, callable $transformer): string
{
$highlighted = '';
$lastToken = $tokens[array_key_last($tokens)];
$tokens = Token::tokenize($code);
$lastToken = $tokens[array_key_last($tokens)];
$attributeOpen = false;
foreach ($tokens as $index => $token) {
if ($token->id !== T_STRING) {
Expand Down
18 changes: 0 additions & 18 deletions src/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,4 @@

class Token extends PhpToken
{
public function getTokenName(): string
{
if ($this->id < 256) {
return chr($this->id);
}

return match ($this->id) {
T_CLASS_NAME => 'T_CLASS_NAME',
T_FUNCTION_NAME => 'T_FUNCTION_NAME',
T_CONST_NAME => 'T_CONST_NAME',
T_BUILTIN_TYPE => 'T_BUILTIN_TYPE',
T_METHOD_NAME => 'T_METHOD_NAME',
T_FUNCTION_DECL => 'T_FUNCTION_DECL',
T_DECLARE_PARAMETER => 'T_DECLARE_PARAMETER',
T_ATTRIBUTE_CLASS => 'T_ATTRIBUTE_CLASS',
default => parent::getTokenName()
};
}
}

0 comments on commit 400818b

Please sign in to comment.