PHPackages                             stoffel/console-sourcecode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. stoffel/console-sourcecode

ActiveLibrary[CLI &amp; Console](/categories/cli)

stoffel/console-sourcecode
==========================

Helper to render source code using Symfony Console Component

0.1(5y ago)15012MITPHPPHP ^7.4 || ^8

Since Oct 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/chr-hertel/console-sourcecode)[ Packagist](https://packagist.org/packages/stoffel/console-sourcecode)[ RSS](/packages/stoffel-console-sourcecode/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (2)

Console SourceCode
==================

[](#console-sourcecode)

Helper to render source code using Symfony Console Component.

Example
-------

[](#example)

```
$ git clone git@github.com:chr-hertel/console-sourcecode.git
$ cd console-image
$ composer install
$ example/php-code
$ example/php-file
```

Installation
------------

[](#installation)

```
$ composer require stoffel/console-sourcecode
```

Usage in PHP

```
use Stoffel\Console\SourceCode\SourceCodeHelper;

// print code from variable
SourceCodeHelper::create($output)
    ->write($code);

// print code from file
SourceCodeHelper::create($output)
    ->writeFile('/path/to/source-file.php');

// print only an excerpt
SourceCodeHelper::create($output)
    ->writeFile('/path/to/source-file.php', 59, 17);

// chose one of the predefined themes
SourceCodeHelper::create($output)
    ->useTheme('seti')
    ->writeFile('/path/to/source-file.php');

// disable line numbers
SourceCodeHelper::create($output)
    ->disableLineNumbers()
    ->writeFile('/path/to/source-file.php');
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1994d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e644c6c1e90b7d997edd1c25da41c48a76d89b7449fb5788214b341e2cd1a019?d=identicon)[chr-hertel](/maintainers/chr-hertel)

---

Top Contributors

[![chr-hertel](https://avatars.githubusercontent.com/u/2852185?v=4)](https://github.com/chr-hertel "chr-hertel (5 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (1 commits)")

### Embed Badge

![Health badge](/badges/stoffel-console-sourcecode/health.svg)

```
[![Health](https://phpackages.com/badges/stoffel-console-sourcecode/health.svg)](https://phpackages.com/packages/stoffel-console-sourcecode)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
