Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dypa/declare-strict-types
PHP7 tool for easy add/remove "declare(strict_types=1)"
https://github.com/dypa/declare-strict-types
php php7
Last synced: about 1 month ago
JSON representation
PHP7 tool for easy add/remove "declare(strict_types=1)"
- Host: GitHub
- URL: https://github.com/dypa/declare-strict-types
- Owner: dypa
- License: mit
- Created: 2017-08-20T12:21:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T11:33:02.000Z (over 7 years ago)
- Last Synced: 2024-10-13T13:04:19.675Z (2 months ago)
- Topics: php, php7
- Language: PHP
- Size: 17.6 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP7 tool for easy add/remove "declare(strict_types=1)"
[![Build Status](https://travis-ci.org/dypa/declare-strict-types.png)](//travis-ci.org/dypa/declare-strict-types)
[![Latest Stable Version](https://poser.pugx.org/dypa/declare_strict_types/v/stable.png)](//packagist.org/packages/dypa/declare_strict_types)
[![Latest Unstable Version](https://poser.pugx.org/dypa/declare_strict_types/v/unstable.png)](//packagist.org/packages/dypa/declare_strict_types)
[![Total Downloads](https://poser.pugx.org/dypa/declare_strict_types/downloads.png)](//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
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
You may prefer [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with "declare_strict_types" rule!