PHPackages                             shish/phpstan-safe-rule - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. shish/phpstan-safe-rule

AbandonedArchivedPhpstan-extension[Testing &amp; Quality](/categories/testing)

shish/phpstan-safe-rule
=======================

A PHPStan rule to detect safety issues. Must be used in conjunction with shish/safe

v1.3.2(1y ago)321.2k—7.8%1MITPHPPHP ^8.2

Since Oct 8Pushed 1y agoCompare

[ Source](https://github.com/shish/phpstan-safe-rule)[ Packagist](https://packagist.org/packages/shish/phpstan-safe-rule)[ RSS](/packages/shish-phpstan-safe-rule/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/3a98f99b571300e6a6b58750a2017bb7cff55e0a538924c9e168adf7026403d0/68747470733a2f2f706f7365722e707567782e6f72672f73686973682f7068707374616e2d736166652d72756c652f762f737461626c65)](https://packagist.org/packages/shish/phpstan-safe-rule)[![Total Downloads](https://camo.githubusercontent.com/1c0f32f1b1c167cdd5f72564c08a8163a6374fe5260146c8de78ea65ab02b46e/68747470733a2f2f706f7365722e707567782e6f72672f73686973682f7068707374616e2d736166652d72756c652f646f776e6c6f616473)](https://packagist.org/packages/shish/phpstan-safe-rule)[![License](https://camo.githubusercontent.com/8272aa17315446fd2b90908a7b5e6b2ee4eae01bcd4f3f2870697f8232876af5/68747470733a2f2f706f7365722e707567782e6f72672f73686973682f7068707374616e2d736166652d72756c652f6c6963656e7365)](https://packagist.org/packages/shish/phpstan-safe-rule)[![Continuous Integration](https://github.com/shish/phpstan-safe-rule/workflows/Automated%20Tests/badge.svg)](https://github.com/shish/phpstan-safe-rule/actions)

PHPStan rules for shish/safe
============================

[](#phpstan-rules-for-shishsafe)

The [shish/safe](https://github.com/shish/safe) package provides a set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered.

This PHPStan rule will help you detect unsafe function call and will propose you to use the `shish/safe` variant instead.

Please read [shish/safe documentation](https://github.com/shish/safe) for details about installation and usage.

(This is a fork of `thecodingmachine/phpstan-safe-rule`, with added support for PHP 8)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~35 days

Total

3

Last Release

607d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a40f5d114b344f735652e4ccc988a618ef5ee2e85a644abeb7e20e92f4c740d5?d=identicon)[shish](/maintainers/shish)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (33 commits)")[![shish](https://avatars.githubusercontent.com/u/40659?v=4)](https://github.com/shish "shish (19 commits)")[![dbrekelmans](https://avatars.githubusercontent.com/u/9531344?v=4)](https://github.com/dbrekelmans "dbrekelmans (3 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (2 commits)")[![vkill](https://avatars.githubusercontent.com/u/610852?v=4)](https://github.com/vkill "vkill (1 commits)")[![clxmstaab](https://avatars.githubusercontent.com/u/47448731?v=4)](https://github.com/clxmstaab "clxmstaab (1 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (1 commits)")[![sanmai](https://avatars.githubusercontent.com/u/139488?v=4)](https://github.com/sanmai "sanmai (1 commits)")[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (1 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (1 commits)")[![tigitz](https://avatars.githubusercontent.com/u/1524501?v=4)](https://github.com/tigitz "tigitz (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/shish-phpstan-safe-rule/health.svg)

```
[![Health](https://phpackages.com/badges/shish-phpstan-safe-rule/health.svg)](https://phpackages.com/packages/shish-phpstan-safe-rule)
```

###  Alternatives

[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67475.0M1.6k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136411.0k14](/packages/rector-rector-src)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2613.3M489](/packages/ssch-typo3-rector)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

5014.2M111](/packages/shipmonk-dead-code-detector)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)

PHPackages © 2026

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