PHPackages                             justintime50/phpcs-short-scalar-types - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. justintime50/phpcs-short-scalar-types

ActivePhpcodesniffer-standard[Validation &amp; Sanitization](/categories/validation)

justintime50/phpcs-short-scalar-types
=====================================

PHPCS sniff to enforce short scalar type names in comments (bool, int, etc.)

1.0.0(2mo ago)0696↓50%1MITPHPPHP &gt;=7.2

Since Jan 4Pushed 2mo agoCompare

[ Source](https://github.com/Justintime50/phpcs-short-scalar-types)[ Packagist](https://packagist.org/packages/justintime50/phpcs-short-scalar-types)[ GitHub Sponsors](https://github.com/Justintime50)[ RSS](/packages/justintime50-phpcs-short-scalar-types/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (1)

PHPCS Short Scalar Types Sniff
==============================

[](#phpcs-short-scalar-types-sniff)

[![Version](https://camo.githubusercontent.com/ffa8a2403282ea8d9a63e357372322a005dfd879f9d0e1f2c38ca0235f5431c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f6a757374696e74696d6535302f70687063732d73686f72742d7363616c61722d7479706573)](https://github.com/justintime50/phpcs-short-scalar-types/releases)[![Licence](https://camo.githubusercontent.com/bef6c03635bb971b3095045fd8f880afac6d73d23438f9ccec22bb9f88af67bd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a757374696e74696d6535302f7663722d6163636573736f726965732d706870)](LICENSE)

A PHPCS sniff to enforce the use of short scalar type names (`bool`, `int`, etc) in comments, instead of long names (`boolean`, `integer`, etc).

Install
-------

[](#install)

```
# Install Sniff
composer require --dev justintime50/phpcs-short-scalar-types

# Allow PHPCS to find Sniff (or use https://github.com/PHPCSStandards/composer-installer)
vendor/bin/phpcs --config-set installed_paths vendor/justintime50/phpcs-short-scalar-types/ShortTypes
```

Usage
-----

[](#usage)

Add to your `phpcs.xml`:

```

```

Run PHPCS as usual. Use `--fix` to auto-correct long forms in comments.

Example
-------

[](#example)

```
// @var boolean $flag  // Error: Use "bool" instead of "boolean".
// @var bool $flag     // OK
```

Development
-----------

[](#development)

To have PHPCS pick up the local copy of this sniff, you'll need to adjust the installed paths like so:

```
# Set config
vendor/bin/phpcs --config-set installed_paths "$(pwd)/ShortTypes"

# Confirm ShortTypes is now available
vendor/bin/phpcs -i
```

### Testing

[](#testing)

```
# Run sniff test
composer test

# Run autofix test
composer fix
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance88

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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 ~15 days

Total

6

Last Release

61d ago

Major Versions

0.3.0 → 1.0.02026-03-18

PHP version history (2 changes)v0.1.0PHP &gt;=7.0

1.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39606064?v=4)[Justin Hammond](/maintainers/justintime50)[@Justintime50](https://github.com/Justintime50)

---

Top Contributors

[![Justintime50](https://avatars.githubusercontent.com/u/39606064?v=4)](https://github.com/Justintime50 "Justintime50 (11 commits)")

---

Tags

commentsphpcodesniffer-standardphpcsscalarshorttypes

### Embed Badge

![Health badge](/badges/justintime50-phpcs-short-scalar-types/health.svg)

```
[![Health](https://phpackages.com/badges/justintime50-phpcs-short-scalar-types/health.svg)](https://phpackages.com/packages/justintime50-phpcs-short-scalar-types)
```

###  Alternatives

[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[gskema/phpcs-type-sniff

PHPCS sniff to enforce PHP7 types and array types

41121.6k2](/packages/gskema-phpcs-type-sniff)[ninjify/coding-standard

Tuned &amp; very strict coding standards for PHP projects. Trusted by Contributte, Apitte, Nettrine and many others.

13497.1k13](/packages/ninjify-coding-standard)[leroy-merlin-br/coding-standard

The coding standard for PHP projects on LMBR

2137.0k10](/packages/leroy-merlin-br-coding-standard)

PHPackages © 2026

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