PHPackages                             kafkiansky/service-locator-interrupter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kafkiansky/service-locator-interrupter

ActivePsalm-plugin[Utility &amp; Helpers](/categories/utility)

kafkiansky/service-locator-interrupter
======================================

Psalm plugin for Laravel that interrupt service locator calls.

5.0.0(2y ago)818.7kMITPHPPHP ^8.2

Since Aug 8Pushed 2y ago3 watchersCompare

[ Source](https://github.com/kafkiansky/service-locator-interrupter)[ Packagist](https://packagist.org/packages/kafkiansky/service-locator-interrupter)[ RSS](/packages/kafkiansky-service-locator-interrupter/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (6)Versions (20)Used By (0)

Psalm plugin that prevent service locator calls for Laravel applications.
=========================================================================

[](#psalm-plugin-that-prevent-service-locator-calls-for-laravel-applications)

[![test](https://github.com/kafkiansky/service-locator-interrupter/workflows/test/badge.svg?event=push)](https://github.com/kafkiansky/service-locator-interrupter/workflows/test/badge.svg?event=push)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Quality Score](https://camo.githubusercontent.com/1f762b26520dd0041bd40a941b5e9f25b18b14d166e7462c9b7c51576281d80a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6b61666b69616e736b792f736572766963652d6c6f6361746f722d696e7465727275707465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/kafkiansky/service-locator-interrupter)[![StyleCI](https://camo.githubusercontent.com/48047330233cd385432957b0568e08e1adb963c18669a4fc7795afd2be734d06/68747470733a2f2f7374796c6563692e696f2f7265706f732f3236313239303935352f736869656c64)](https://styleci.io/repos/261290955)[![Total Downloads](https://camo.githubusercontent.com/f91da03e2169c8d5a41253d90de33eeea0f758b272eb6f655f3ef4854ba46ec7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61666b69616e736b792f736572766963652d6c6f6361746f722d696e7465727275707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kafkiansky/service-locator-interrupter)[![Latest Stable Version](https://camo.githubusercontent.com/c2c89e71c126db5897ac88330b81284a937fc38ed2da772188eb58e080c70b31/68747470733a2f2f706f7365722e707567782e6f72672f6b61666b69616e736b792f736572766963652d6c6f6361746f722d696e7465727275707465722f762f737461626c65)](https://packagist.org/packages/kafkiansky/service-locator-interrupter)

### Contents:

[](#contents)

- [Installation](#installation)
- [WHY](#why)
- [Dependency Injection](#dependency-injection)
- [Testing](#testing)
- [License](#license)

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

[](#installation)

Install this package with Composer:

 PHP Version Package Version   **PHP ^7.1**   `composer require kafkiansky/service-locator-interrupter "1.0.4" --dev`     **PHP ^8.0**   `composer require kafkiansky/service-locator-interrupter "2.0.1" --dev`     **PHP &lt;= 8.1**   `composer require kafkiansky/service-locator-interrupter "2.1.0" --dev`     **PHP ^8.1 &amp;&amp; Laravel ^10.x**   `composer require kafkiansky/service-locator-interrupter "^4.0" --dev`     **PHP ^8.2 &amp;&amp; Laravel ^11.x**   `composer require kafkiansky/service-locator-interrupter "^5.0" --dev`  WHY
---

[](#why)

Laravel-like developers prefer to use some kinds of ioc bad practices. In example: facades, helpers method, container injection and container instances creation anywhere: controllers, services, routes and even in models. You need inject necessary services in method and constructor, not call container to do it for you. Any services **must has** it own contract, container injection - it's not legal contract, it's hack.

This plugin can found issues of service locator usage - helpers, facades, container injection, container instances creation - and prevent them.

**Even if you have your own facade, the plugin will be found it**.

**Even if you have inherited `Container/Application` classes, the plugin will be found it**.

**Even if you have implemented any fo `ContainerInterface`, the plugin also prevent that**.

Dependency Injection
--------------------

[](#dependency-injection)

#### Replacement map

[](#replacement-map)

 Helper(s)/Facade What you **need** to use instead   `event`,`\Illuminate\Support\Facades\Event`   `\Illuminate\Events\Dispatcher::class`,`\Illuminate\Contracts\Events\Dispatcher::class`     `info`,`\Illuminate\Support\Facades\Log`   `\Illuminate\Log\LogManager::class`, `\Psr\Log\LoggerInterface::class`     `logger`,`\Illuminate\Support\Facades\Log`   `\Illuminate\Log\LogManager::class`, `\Psr\Log\LoggerInterface::class`     `logs`,`\Illuminate\Support\Facades\Log`   `\Illuminate\Log\LogManager::class`, `\Psr\Log\LoggerInterface::class`     `abort, abort_if, abort_unless`   `\Illuminate\Http\Exceptions\HttpResponseException`, `\Symfony\Component\HttpKernel\Exception\HttpException`     `auth`, `\Illuminate\Support\Facades\Auth`   `\Illuminate\Auth\AuthManager::class`, `\Illuminate\Contracts\Auth\Factory::class`     `back`   `\Illuminate\Routing\Redirector`     `broadcast`, `\Illuminate\Support\Facades\Broadcast`   `\Illuminate\Broadcasting\BroadcastManager`, `\Illuminate\Contracts\Broadcasting\Factory`     `cache`, `\Illuminate\Support\Facades\Cache`   `\Illuminate\Cache\CacheManager::class`, `\Illuminate\Contracts\Cache\Factory::class`     `config`, `\Illuminate\Support\Facades\Config`   `\Illuminate\Config\Repository::class`, `\Illuminate\Contracts\Config\Repository::class`     `cookie`, `\Illuminate\Support\Facades\Cookie`   `\Illuminate\Cookie\CookieJar::class`, `\Illuminate\Contracts\Cookie\Factory::class`, `\Illuminate\Contracts\Cookie\QueueingFactory::class`     `dispatch, dispatch_now`   `\Illuminate\Contracts\Bus\Dispatcher`, `\Illuminate\Bus\Dispatcher`, `\Illuminate\Contracts\Bus\QueueingDispatcher`,     `redirect`, `\Illuminate\Support\Facades\Redirect`   `\Illuminate\Routing\Redirector`, `\Illuminate\Http\RedirectResponse`     `report`   `\Illuminate\Contracts\Debug\ExceptionHandler`     `request`, `\Illuminate\Support\Facades\Request`   `\Illuminate\Http\Request::class`, `\Symfony\Component\HttpFoundation\Request::class`     `response`, `\Illuminate\Support\Facades\Response`   `\Illuminate\Contracts\Routing\ResponseFactory`, `\Illuminate\Routing\ResponseFactory`,     `route`, `\Illuminate\Support\Facades\Route`   `\Illuminate\Routing\UrlGenerator::class`, `\Illuminate\Contracts\Routing\UrlGenerator::class`,     `url`, `\Illuminate\Support\Facades\URL`   `\Illuminate\Routing\UrlGenerator::class`, `\Illuminate\Contracts\Routing\UrlGenerator::class`,     `session`, `\Illuminate\Support\Facades\Session`   `\Illuminate\Session\SessionManager::class`, `\Illuminate\Session\Store::class`, `\Illuminate\Contracts\Session\Session::class`     `trans, trans_choice`   `\Illuminate\Contracts\Translation\Translator`, `\Illuminate\Translation\Translator`,     `validator`, `\Illuminate\Support\Facades\Validator`   `\Illuminate\Validation\Factory::class`, `\Illuminate\Contracts\Validation\Factory::class`     `view`, `\Illuminate\Support\Facades\View`   `\Illuminate\View\Factory::class`, `\Illuminate\Contracts\View\Factory::class`  Testing
-------

[](#testing)

```
$ composer codeception
```

License
-------

[](#license)

The MIT License (MIT). See [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~94 days

Recently: every ~190 days

Total

16

Last Release

733d ago

Major Versions

1.0.4 → v2.0.02020-12-20

v2.2.0 → v3.0.02022-05-26

v3.0.0 → v4.x-dev2023-06-23

v4.0.0 → 5.x-dev2024-06-24

PHP version history (5 changes)1.0.0PHP ^7.1

v2.0.0PHP ^7.1 || ^8.0

v2.1.0PHP &gt;=7.4 || &lt;= 8.1

v4.x-devPHP ^8.1

5.x-devPHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b0c87976a285325177559e27d154a9b5019466800c6a3342db916140c512ede?d=identicon)[kafkiansky](/maintainers/kafkiansky)

---

Top Contributors

[![kafkiansky](https://avatars.githubusercontent.com/u/37590388?v=4)](https://github.com/kafkiansky "kafkiansky (14 commits)")

---

Tags

laravelpsalmpsalm-pluginstatic-analysispluginlaravelpsalm

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kafkiansky-service-locator-interrupter/health.svg)

```
[![Health](https://phpackages.com/badges/kafkiansky-service-locator-interrupter/health.svg)](https://phpackages.com/packages/kafkiansky-service-locator-interrupter)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[awcodes/filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.

265877.0k5](/packages/awcodes-filament-table-repeater)[awcodes/filament-badgeable-column

Filament Tables column to append and prepend badges.

145494.6k4](/packages/awcodes-filament-badgeable-column)[awcodes/recently

Easily track and access recently viewed records in your filament panels.

4332.4k](/packages/awcodes-recently)[tonegabes/filament-better-options

Filament form components for better radio and checkbox options.

168.1k](/packages/tonegabes-filament-better-options)

PHPackages © 2026

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