PHPackages                             dypa/declare\_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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dypa/declare\_strict\_types

AbandonedArchivedProject[Utility &amp; Helpers](/categories/utility)

dypa/declare\_strict\_types
===========================

PHP7 tool for easy add/remove "declare(strict\_types=1)"

1.0.0(8y ago)223MITPHPPHP &gt;=7.1.0

Since Aug 20Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/dypa/declare-strict-types)[ Packagist](https://packagist.org/packages/dypa/declare_strict_types)[ RSS](/packages/dypa-declare-strict-types/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

PHP7 tool for easy add/remove "declare(strict\_types=1)"
========================================================

[](#php7-tool-for-easy-addremove-declarestrict_types1)

[![Build Status](https://camo.githubusercontent.com/9c6bdfce845281e46f8f2ea7e97385a1cf1f25d662bf0704e4a8d4f381a6cfbc/68747470733a2f2f7472617669732d63692e6f72672f647970612f6465636c6172652d7374726963742d74797065732e706e67)](//travis-ci.org/dypa/declare-strict-types)[![Latest Stable Version](https://camo.githubusercontent.com/4f5b8d12e3e0bc7a05d28a6cab48b807af962a406d1f3ad0965f1a04a062524b/68747470733a2f2f706f7365722e707567782e6f72672f647970612f6465636c6172655f7374726963745f74797065732f762f737461626c652e706e67)](//packagist.org/packages/dypa/declare_strict_types)[![Latest Unstable Version](https://camo.githubusercontent.com/27eea6d59cba2ef1734491134ccb45a140b6dca813daf1bdade79deda5fd1d63/68747470733a2f2f706f7365722e707567782e6f72672f647970612f6465636c6172655f7374726963745f74797065732f762f756e737461626c652e706e67)](//packagist.org/packages/dypa/declare_strict_types)[![Total Downloads](https://camo.githubusercontent.com/c6c934b95e22b9a55b23a18327a85d777637210b91045e3747a57400f382b4d6/68747470733a2f2f706f7365722e707567782e6f72672f647970612f6465636c6172655f7374726963745f74797065732f646f776e6c6f6164732e706e67)](//packagist.org/packages/dypa/declare_strict_types)

Enable strict typing in your project with one command. Based on PCRE and supports PSR-2.

WARNING: before run command ensure that you have backup of your files!!!

Usage
-----

[](#usage)

Install via composer

`composer require-dev dypa/declare_strict_types`

Run command to add "declare(strict\_types=1)" in all files in specified folders

`bin/declare_strict_types add --exclude=bar/baz/bah foo/directory bar/baz`

Also supports remove mode

`bin/declare_strict_types remove foo/directory`

PS
--

[](#ps)

You may prefer [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with "declare\_strict\_types" rule!

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance52

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

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

Every ~3 days

Total

2

Last Release

3232d ago

Major Versions

0.9.0 → 1.0.02017-08-23

PHP version history (2 changes)0.9.0PHP &gt;=7.0.0

1.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dad3105e9e4fa05b9fd014c086cfa50503cb103ab3432e5d288d9ddd95fb57b?d=identicon)[dypa](/maintainers/dypa)

---

Top Contributors

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

---

Tags

phpphp7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dypa-declare-strict-types/health.svg)

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

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k245.4M24.0k](/packages/friendsofphp-php-cs-fixer)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[testo/testo

A lightweight PHP testing framework.

1943.4k36](/packages/testo-testo)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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