Search by

switon / lint

switon

Extension-routed single-file lint drivers and structured diagnostics for Switon Framework

v1.0.0 2026-08-22 14:29 UTC

This package is auto-updated.

Last update: 2026-11-23 14:46:01 UTC


README

PHP 8.3+

Switon's single-file lint for application services that want syntax diagnostics, and a deeper check only when one is asked for.

Highlights

  • By extension: each file is checked by the driver registered for its extension.
  • Syntax first: the default check is the fast syntax tool for that language.
  • Deeper on request: analyzers such as PHPStan or ESLint run only when a deep check is asked for, and only when that tool is found.
  • Attach a report: a write can carry a syntax report without failing when the checker crashes.
  • Replace a language: application config can replace a driver or drop an extension.

Installation

composer require switon/lint

Quick Start

use Switon\Core\Attribute\Autowired;
use Switon\Lint\LinterInterface;

class Checker
{
    #[Autowired] protected LinterInterface $linter;

    public function check(string $path): array
    {
        return $this->linter->lint($path, static fn (): bool => false);
    }
}

Docs: https://github.com/switon-php/lint/blob/main/docs/README.md

License

MIT.