Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Mar 26, 2016
1 parent f7a1193 commit 065b7d9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## WORK IN PROGRESS

# Convert PHP 7 code to PHP 5 code

[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/7to5.svg?style=flat-square)](https://packagist.org/packages/spatie/7to5)
Expand All @@ -18,17 +16,6 @@ You can convert an entire directory with PHP 7 code with a the console command:
$ php7to5 convert {$directoryWithPHP7Code} {$destinationWithPHP5Code}
```

Currently this package converts PHP 7 code to equivalent PHP 5 code by:
- removing scalar type hints
- removing return type hints
- removing the strict type declaration
- replacing the spaceship operator by an equivalent PHP 5 code
- replacing null coalesce statements by equivalent PHP 5 code
- converting anonymous classes to regular classes

To make sure the converted code works we higly recommend running your automated tests against the converted code.


Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

## Installation
Expand All @@ -44,6 +31,20 @@ If you want to [integrate the package in your own code](#programmatically-conver
``` bash
$ composer require spatie/7to5
```

## The conversion process

Thhis package converts PHP 7 code to equivalent PHP 5 code by:

- removing scalar type hints
- removing return type hints
- removing the strict type declaration
- replacing the spaceship operator by an equivalent PHP 5 code
- replacing null coalesce statements by equivalent PHP 5 code
- converting anonymous classes to regular classes

Because there are a lot of things that cannot be detected and/or converted properly we do not guarantee that the converted code will work. We higly recommend running your automated tests against the converted code to determine if it works.

## Using the console command

This package provides a console command `php7to5` to convert files and directories.
Expand Down

0 comments on commit 065b7d9

Please sign in to comment.