Download the PHP package dunglas/phpdoc-to-typehint without Composer
On this page you can find all versions of the php package dunglas/phpdoc-to-typehint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dunglas/phpdoc-to-typehint
More information about dunglas/phpdoc-to-typehint
Files in dunglas/phpdoc-to-typehint
Package phpdoc-to-typehint
Short Description Generate scalar type hints from PHPDoc annotations
License MIT
Informations about the package phpdoc-to-typehint
PHPDoc to Type Hint
Archived! This repository is now archived. Consider using PHP CS Fixer (and especially the
phpdoc_to_param_type
and phpdoc_to_return_type
rules) or Rector instead.
phpdoc-to-typehint
adds automatically scalar type hints and return types to all functions and methods of a PHP project
using existing PHPDoc annotations.
Warning: this project is an early stage of development. It can damage your code. Be sure to make a backup before running this command and to run your test suite after.
Please report any bug you find using this tool.
Install and usage
- Download the latest PHAR file
- Run
php phpdoc-to-typehint.phar <your-project-directory>
Your project should have scalar type hints and return type declarations.
Before:
After:
Features
Supports:
- functions
- methods of classes and traits
- method definitions in interfaces
- PHPDoc inheritance
- PHP 7.1 nullable types (can be disabled with
--no-nullable-types
option)
Credits
Created by Kévin Dunglas. Sponsored by Les-Tilleuls.coop.
All versions of phpdoc-to-typehint with dependencies
ext-tokenizer Version *
symfony/console Version ^2.7.0
symfony/finder Version ^2.7.0
phpdocumentor/reflection Version ^2.0@dev
phpdocumentor/reflection-common Version ^1.0@dev
phpdocumentor/reflection-docblock Version ^3.0@dev
sebastian/diff Version ^1.3