Download the PHP package sepmni/strict-types without Composer
On this page you can find all versions of the php package sepmni/strict-types. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sepmni/strict-types
More information about sepmni/strict-types
Files in sepmni/strict-types
Package strict-types
Short Description Adds strict types declaration recursively to your PHP files
License MIT
Informations about the package strict-types
PHP Strict Types Adder
The PHP Strict Types Adder is a Composer package that allows you to automatically add declare(strict_types=1);
to PHP files within a directory recursively. It ensures your PHP files are consistent and have strict type checking enabled without the need for manual editing.
Features
- Recursively add
declare(strict_types=1);
to PHP files within a specified directory. - Ignores files that already have a
declare(strict_types=1);
statement. - Excludes files within the "vendor" folder and those with ".blade.php" in the name.
- Automatically detects and handles existing
<?php
tags.
Installation
You can install the PHP Strict Types Adder using Composer:
Usage
Once installed, you can use the command-line interface (CLI) to add declare(strict_types=1);
to your PHP files.
Replace /path/to/your/php/files/directory
with the path to the directory you want to process.
Example
Let's say you have a project directory structure like this:
To add strict types declarations to all PHP files in the src/
directory (excluding those with existing declarations), you would run:
The package will process all PHP files within the specified directory and its subdirectories.
Contributing
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and write tests.
- Submit a pull request with a clear description of your changes.
License
This package is open-source software licensed under the MIT License.
Support
If you have any questions or encounter issues, please feel free to open a GitHub issue. We welcome your feedback and contributions!
Acknowledgments
Special thanks to the PHP community and the tools that made this package possible.