PHPackages                             samlitowitz/no-ternary - 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. samlitowitz/no-ternary

ActiveLibrary[Testing &amp; Quality](/categories/testing)

samlitowitz/no-ternary
======================

PHPStan rule to disallow the use of ternary operators

v1.0(7y ago)03Apache-2.0PHP

Since Apr 23Pushed 4y agoCompare

[ Source](https://github.com/samlitowitz/no-ternary)[ Packagist](https://packagist.org/packages/samlitowitz/no-ternary)[ RSS](/packages/samlitowitz-no-ternary/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

PHPStan rule to disallow use of the ternary operator
====================================================

[](#phpstan-rule-to-disallow-use-of-the-ternary-operator)

[![Build Status](https://camo.githubusercontent.com/d82b4bc3f242d5683c633c5e52036a7cd12bb629494b2405952392b968174434/68747470733a2f2f7472617669732d63692e6f72672f73616d6c69746f7769747a2f6e6f2d7465726e6172792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/samlitowitz/no-ternary)

Usage
=====

[](#usage)

To use these rules, require it via [Composer](https://getcomposer.org/)

```
composer require samlitowitz/no-ternary --dev

```

Include rules.neon in your project's PHPStan config

```
includes:
    - vendor/samlitowitz/no-ternary/rules.neon

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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

Unknown

Total

1

Last Release

2625d ago

### Community

Maintainers

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

---

Top Contributors

[![samlitowitz](https://avatars.githubusercontent.com/u/4641296?v=4)](https://github.com/samlitowitz "samlitowitz (2 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/samlitowitz-no-ternary/health.svg)

```
[![Health](https://phpackages.com/badges/samlitowitz-no-ternary/health.svg)](https://phpackages.com/packages/samlitowitz-no-ternary)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.7k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79473.3M2.0k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67270.7M1.3k](/packages/phpstan-phpstan-doctrine)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.0M322](/packages/drupal-core-dev)[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.

4813.1M84](/packages/shipmonk-dead-code-detector)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M131](/packages/wp-cli-wp-cli-tests)

PHPackages © 2026

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