Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phplint Laravel Package

overtrue/phplint

PHPLint is a fast PHP syntax linter that runs multiple lint processes in parallel to speed up checking large codebases. Supports modern PHP versions, with easy installation via Composer, PHAR, Docker, or Phive, and configurable rules and paths.

View on GitHub
Deep Wiki
Context7

Programmatically

<?php

use Overtrue\PHPLint\Command\LintCommand;
use Overtrue\PHPLint\Configuration\ConsoleOptionsResolver;
use Overtrue\PHPLint\Event\EventDispatcher;
use Overtrue\PHPLint\Finder;
use Overtrue\PHPLint\Linter;
use Symfony\Component\Console\Input\ArrayInput;

$dispatcher = new EventDispatcher([]);

$arguments = [
    'path' => [dirname(__DIR__) . '/src', dirname(__DIR__) . '/tests'],
    '--no-configuration' => true,
    '--no-cache' => true,
    '--exclude' => ['vendor'],
    '--extensions' => ['php'],
    '--warning' => true,
];
$command = new LintCommand($dispatcher);
$input = new ArrayInput($arguments, $command->getDefinition());

$configResolver = new ConsoleOptionsResolver($input);

$finder = new Finder($configResolver);
$linter = new Linter($configResolver, $dispatcher);
$results = $linter->lintFiles($finder->getFiles());

var_dump($results->getErrors());
/*
 array(1) {
  ["/absolute/path/to/tests/fixtures/syntax_error.php"]=>
  array(4) {
    ["absolute_file"]=>
    string(62) "/absolute/path/to/tests/fixtures/syntax_error.php"
    ["relative_file"]=>
    string(25) "fixtures/syntax_error.php"
    ["error"]=>
    string(32) "unexpected end of file in line 4"
    ["line"]=>
    int(4)
  }
}
 */

var_dump($results->getWarnings());
/*
array(1) {
  ["/absolute/path/to/tests/fixtures/syntax_warning.php"]=>
  array(4) {
    ["absolute_file"]=>
    string(64) "/absolute/path/to/tests/fixtures/syntax_warning.php"
    ["relative_file"]=>
    string(27) "fixtures/syntax_warning.php"
    ["error"]=>
    string(97) " declare(encoding=...) ignored because Zend multibyte feature is turned off by settings in line 1"
    ["line"]=>
    int(1)
  }
}
 */
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata