Highlight PHP code in terminal

Overview

PHP Console Highlighter

This repository is abandoned.

Suggested alternative: https://github.com/php-parallel-lint/PHP-Console-Highlighter


Highlight PHP code in console (terminal).

Example

Example

Install

Just create a composer.json file and run the php composer.phar install command to install it:

{
    "require": {
        "jakub-onderka/php-console-highlighter": "0.*"
    }
}

Usage

<?php
use JakubOnderka\PhpConsoleColor\ConsoleColor;
use JakubOnderka\PhpConsoleHighlighter\Highlighter;

require __DIR__ . '/vendor/autoload.php';

$highlighter = new Highlighter(new ConsoleColor());

$fileContent = file_get_contents(__FILE__);
echo $highlighter->getWholeFile($fileContent);

Downloads this Month Build Status License

You might also like...
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

⚗️ About Larastan Larastan was created by Can Vural and Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural, Nuno Maduro, and Vik

Free ZIP Code API - Free Access to Worldwide Postal Code Data

About Zipcodebase - Free Zip Code API Zipcodebase is a zip code API that was founded in 2019 to solve common issues with postal code data. As we have

Preload your sweet sweet code to opcache with a composer command, making your code faster to run.

Composer Preload Preload your sweet sweet code to opcache with a composer command, making your code run faster. Composer Preload is a composer plugin

The SensioLabs DeprecationDetector runs a static code analysis against your project's source code to find usages of deprecated methods, classes and interfaces

SensioLabs DeprecationDetector CAUTION: This package is abandoned and will no longer receive any updates. The SensioLabs DeprecationDetector runs a st

Webman quickly creates a verification code tool similar to Google verification code
Webman quickly creates a verification code tool similar to Google verification code

webman-captcha-grid webman quickly creates a verification code tool similar to Google verification code webman 快速创建一个类似于 Google 点图验证码的本地验证码扩展 介绍 webma

Code to accompany the YouTube video "Full PHP cURL API tutorial - how to use a REST API from PHP using cURL"

PHP cURL CRUD Example Example code to accompany this YouTube video. Note that the init_curl.php file contains a placeholder for an API key. DO NOT che

The VarExporter component allows exporting any serializable PHP data structure to plain PHP code.

The VarExporter component allows exporting any serializable PHP data structure to plain PHP code. While doing so, it preserves all the semantics associated with the serialization mechanism of PHP (__wakeup, __sleep, Serializable).

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.
A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

Comments
  • Convert to psr-4

    Convert to psr-4

    Directories have been simplified to just src/ and test/

    The Test bootstrap file is no longer needed, and the typo in the test filename has been fixed.

    opened by avindra 7
  • Release version 1.0.0

    Release version 1.0.0

    What blockers are there to releasing a 1.0.0 version? It seems that this package is already used in production (albeit continuous-integration production, rather than user-facing).

    opened by samwilson 5
  • Fixed tokenization of empty string

    Fixed tokenization of empty string

    Fixes:

    PHPUnit 4.4.1 by Sebastian Bergmann.
    
    Configuration read from /PHP-Console-Highlighter/phpunit.xml
    
    .............E
    
    Time: 84 ms, Memory: 7.75Mb
    
    There was 1 error:
    
    1) JakubOnderka\PhpConsoleHighlighter\HighlighterTest::testBlank
    Undefined variable: newType
    
    /PHP-Console-Highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php:183
    /PHP-Console-Highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php:102
    /PHP-Console-Highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php:77
    /PHP-Console-Highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php:33
    /PHP-Console-Highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php:261
    
    FAILURES!
    Tests: 14, Assertions: 20, Errors: 1.
    
    opened by hason 1
Releases(v0.4)
Owner
Jakub Onderka
Jakub Onderka
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Highlight code blocks with league/commonmark and Shiki

Highlight code blocks with league/commonmark and Shiki This package contains a block renderer for league/commonmark to highlight code blocks using Shi

Spatie 55 Aug 27, 2022
Run the following commands in your terminal to setup the project

Run the following commands in your terminal to setup the project You must have the LAMP installed on your system git clone https://github.com/Bashar-A

null 1 Nov 6, 2021
Terminal drawing with braille

php-drawille Terminal drawing with braille. Requirements php-drawille requires PHP 5.4.0 or later. Installation The recommended way to install php-dra

Jeff Welch 102 Nov 2, 2022
Terminal management system.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

HISTYLE 3 Sep 5, 2022
Terminal management system.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

HISTYLE 2 May 14, 2022
Detection of execution by command (Terminal) or web environment.

WEB-CLI-Detector Detection of execution by command (Terminal) or web environment. Acronym: [WEB-CLI-Detector]. Name: WEB-CLI-Detector. Dependencies: S

Walter Nuñez 4 Jul 13, 2022
TraceX-GUI is a GUI based IP atrcker tool for terminal user

TraceX-GUI Author Alex Butler (MrHacker-X) What is IP Tracing? As IP addresses are automatically identified thanks to the handshake, IP address tracke

Alex Butler 10 Dec 26, 2022
Result of our code-along meetup writing PHP 8.1 code

PHP 8.1 Demo Code This code demonstrates various PHP 8.0 and 8.1 features in a realistic, functional (but incomplete) codebase. The code is part of so

azPHP 2 Nov 14, 2021
Dead Code Detector (DCD) for PHP code.

This project is no longer maintained and its repository is only kept for archival purposes. PHP Dead Code Detector (PHPDCD) phpdcd is a Dead Code Dete

Sebastian Bergmann 406 Dec 30, 2022