Skip to content

Commit

Permalink
code migration to fix abandonned package (see #157)
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Oct 21, 2022
1 parent cbbbaeb commit b5d7b1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"n98/junit-xml": "1.1.0"
},
"require-dev": {
"jakub-onderka/php-console-highlighter": "^0.4",
"php-parallel-lint/php-console-highlighter": "^1.0",
"brainmaestro/composer-git-hooks": "^2.8.5",
"friendsofphp/php-cs-fixer": "^3.4.0",
"jetbrains/phpstorm-stubs": "^2021.3 || ^2022.0",
Expand Down
15 changes: 8 additions & 7 deletions src/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Overtrue\PHPLint\Command;

use DateTime;
use JakubOnderka\PhpConsoleColor\ConsoleColor;
use JakubOnderka\PhpConsoleHighlighter\Highlighter;
use PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor;
use PHP_Parallel_Lint\PhpConsoleColor\InvalidStyleException;
use PHP_Parallel_Lint\PhpConsoleHighlighter\Highlighter;
use N98\JUnitXml\Document;
use Overtrue\PHPLint\Cache;
use Overtrue\PHPLint\Linter;
Expand Down Expand Up @@ -129,7 +130,7 @@ public function initialize(InputInterface $input, OutputInterface $output): void
}

/**
* @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
* @throws InvalidStyleException
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down Expand Up @@ -294,7 +295,7 @@ protected function executeLint(Linter $linter, InputInterface $input, OutputInte
}

/**
* @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
* @throws InvalidStyleException
*/
protected function showErrors(array $errors): void
{
Expand Down Expand Up @@ -330,13 +331,13 @@ protected function getCodeSnippet(string $filePath, int $lineNumber, int $linesB
}

/**
* @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
* @throws InvalidStyleException
*/
public function getHighlightedCodeSnippet(string $filePath, int $lineNumber, int $linesBefore = 3, int $linesAfter = 3): string
{
if (
!class_exists('\JakubOnderka\PhpConsoleHighlighter\Highlighter') ||
!class_exists('\JakubOnderka\PhpConsoleColor\ConsoleColor')
!class_exists('\PHP_Parallel_Lint\PhpConsoleHighlighter\Highlighter') ||
!class_exists('\PHP_Parallel_Lint\PhpConsoleColor\ConsoleColor')
) {
return $this->getCodeSnippet($filePath, $lineNumber, $linesBefore, $linesAfter);
}
Expand Down

0 comments on commit b5d7b1b

Please sign in to comment.