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 3d 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 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

2578d 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

[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

78268.9M1.5k](/packages/phpstan-phpstan-symfony)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33120.0M375](/packages/spaze-phpstan-disallowed-calls)[drupal/core-dev

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

2021.0M277](/packages/drupal-core-dev)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[calebdw/larastan-livewire

A Larastan / PHPStan extension for Livewire.

43482.4k3](/packages/calebdw-larastan-livewire)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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