PHPackages                             sepehr-mohseni/strict-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. [CLI &amp; Console](/categories/cli)
4. /
5. sepehr-mohseni/strict-types

ActiveLibrary[CLI &amp; Console](/categories/cli)

sepehr-mohseni/strict-types
===========================

A powerful CLI tool to manage strict\_types declarations in PHP files with framework presets, dry-run mode, and comprehensive testing

v1.0.0(4mo ago)2141↓43.3%MITPHPPHP ^7.4 || ^8.0

Since Jan 3Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/sepehr-mohseni/strict-types)[ Packagist](https://packagist.org/packages/sepehr-mohseni/strict-types)[ RSS](/packages/sepehr-mohseni-strict-types/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

strict-types
============

[](#strict-types)

A CLI tool for managing `declare(strict_types=1);` in PHP projects.

Requirements
------------

[](#requirements)

- PHP 7.4+

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

[](#installation)

```
composer require --dev sepehr-mohseni/strict-types
```

Usage
-----

[](#usage)

```
# Add strict_types to files
./vendor/bin/strict-types add src/

# Check coverage
./vendor/bin/strict-types check .

# Remove strict_types
./vendor/bin/strict-types remove src/

# Generate config file
./vendor/bin/strict-types init
```

Commands
--------

[](#commands)

CommandDescription`add`Add `declare(strict_types=1);` to PHP files`remove`Remove the declaration from files`check`Report strict\_types coverage`init`Create `.strict-types.json` config`help`Show help`version`Show versionOptions
-------

[](#options)

```
--dry-run           Preview changes
--backup            Create .bak files before modifying
--no-recursive      Skip subdirectories
--preset=     Use framework preset
--exclude= Exclude files matching pattern
--json              Output JSON (check command)
-v, --verbose       Verbose output
-q, --quiet         Suppress output
```

Framework Presets
-----------------

[](#framework-presets)

Auto-detected or manually specified:

- `laravel` - excludes blade templates, storage, cache
- `symfony` - excludes var, public
- `wordpress` - excludes wp-admin, wp-includes
- `drupal` - excludes core
- `yii` - excludes runtime, web/assets
- `codeigniter` - excludes system, writable

Configuration
-------------

[](#configuration)

Create `.strict-types.json`:

```
{
    "exclude_patterns": ["*.blade.php"],
    "exclude_directories": ["vendor", "node_modules"],
    "dry_run": false,
    "backup": true,
    "recursive": true
}
```

Examples
--------

[](#examples)

```
# Laravel project with backup
./vendor/bin/strict-types add --preset=laravel --backup .

# Check and output JSON for CI
./vendor/bin/strict-types check --json src/ > report.json

# Dry run to preview
./vendor/bin/strict-types add --dry-run app/
```

CI Integration
--------------

[](#ci-integration)

```
# GitHub Actions
- name: Check strict_types
  run: ./vendor/bin/strict-types check --json . > coverage.json
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

Author
------

[](#author)

Sepehr Mohseni - [GitHub](https://github.com/sepehr-mohseni)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance76

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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

Unknown

Total

1

Last Release

129d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee4894771ae3ecf9a2d11f98128ea6ee1b75f545f2c1f96928592b80c1013b9a?d=identicon)[sepehr-mohseni](/maintainers/sepehr-mohseni)

---

Top Contributors

[![sepehr-mohseni](https://avatars.githubusercontent.com/u/64346646?v=4)](https://github.com/sepehr-mohseni "sepehr-mohseni (2 commits)")

---

Tags

composerpackagephpphp-libraryphp7php8phpclisymfonylaravelwordpressstatic analysiscode qualitystrict types

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sepehr-mohseni-strict-types/health.svg)

```
[![Health](https://phpackages.com/badges/sepehr-mohseni-strict-types/health.svg)](https://phpackages.com/packages/sepehr-mohseni-strict-types)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[nunomaduro/laravel-console-task

Laravel Console Task is a output method for your Laravel/Laravel Zero commands.

2582.1M11](/packages/nunomaduro-laravel-console-task)[nunomaduro/laravel-console-summary

A Beautiful Laravel Console Summary for your Laravel/Laravel Zero commands.

662.0M3](/packages/nunomaduro-laravel-console-summary)[nunomaduro/laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.

16255.4k7](/packages/nunomaduro-laravel-console-dusk)[rahul900day/laravel-console-spinner

Laravel Console Spinner is a spinner output for Laravel command line.

76125.4k1](/packages/rahul900day-laravel-console-spinner)

PHPackages © 2026

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