Download the PHP package edalzell/dead-code-detector-laravel-actions without Composer

On this page you can find all versions of the php package edalzell/dead-code-detector-laravel-actions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dead-code-detector-laravel-actions

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Two usage providers and one usage excluder for shipmonk/dead-code-detector, covering lorisleiva/laravel-actions.

This is a PHPStan extension, not a Laravel package. There is no service provider and nothing to publish.

For the Eloquent conventions shipmonk misses — trait hooks and #[Scope] attributes — see edalzell/dead-code-detector-laravel.

Installation

With phpstan/extension-installer the extension registers itself. Without it, add one line:

lorisleiva/laravel-actions is a suggestion, not a requirement. All three extensions match on trait names as strings and never reference a class from that package, so they load and do nothing when it is absent.

What each extension does

LaravelActionsUsageProvider — laravel-actions resolves a set of methods by name through its decorators: the four entrypoint adapters, and the validation and response hooks. Nothing calls them, so all of them read as dead. The list is literal rather than a prefix match, so a typo in an Action still fails loudly, and it is scoped to classes actually using one of the package's traits, so a rules() on an unrelated class is still reported. It also marks handle() used on a class using AsCommand, AsController, AsJob or AsListener directly: each decorator falls back to handle() when its asX adapter is absent, and whatever reaches it — a route, the scheduler, the queue — names the class, never the method. AsAction is deliberately not counted, since a class that says it is everything gives no signal about how it is reached.

LaravelActionsRunUsageProviderFoo::run() reaches Foo::handle() through AsObject's trait body, which lives in vendor and is never analysed, so the detector never sees the call. Every Action used to pass anyway, by accident: shipmonk's Laravel provider marks any public handle* whose first parameter is class-typed as an auto-discovered listener, which every Action taking a model happened to satisfy. One with a scalar first parameter read as dead however many callers it had. This records the call the trait hides, for run, runIf and runUnless.

ActionListenerUsageExcluder — the flip side of that heuristic. Because it marks any class-typed-first-parameter handle as a listener, a genuinely dead Action taking a model was invisible: one shipped with no caller for a whole phase and nothing reported it. This subtracts that one invented usage — matched by the note shipmonk attaches to it, so real calls are untouched — for classes using AsObject but not AsListener. An Action that really is a listener keeps the heuristic, and so does the constructor, which laravel-actions resolves through the container either way.

Testing

The suite runs PHPStan over tests/Fixtures four times: once with the shipped extension.neon, and once per extension with that one service left out. Each run asserts the exact set of members reported dead, so removing any extension turns a test red with a named fixture rather than quietly changing nothing.

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.


All versions of dead-code-detector-laravel-actions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
phpstan/phpstan Version ^2.0
shipmonk/dead-code-detector Version ^1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package edalzell/dead-code-detector-laravel-actions contains the following files

Loading the files please wait ...