dchesterton/phpdoc-to-return

Convert PHPDoc @return hints to PHP7/Hack native return type syntax

v0.1.1 2015-01-20 15:20 UTC

This package is not auto-updated.

Last update: 2024-04-27 14:22:44 UTC


README

Command line tool to convert PHPDoc @return hints to new PHP 7 return type syntax. (Requires PHP 5.4+)

Installation

Install the package globally using Composer: composer global require dchesterton/phpdoc-to-return

Usage

Navigate to the directory you wish to convert, then simply call phpdoc-to-return.

By default, the tool will overwrite the code but you can optionally specify the source and destination folders using the --src and --dest options.

phpdoc-to-return --src=lib --dest=converted

Hack

The tool has basic support for converting to Hack Return Types

phpdoc-to-return --src=lib --hack