You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
-
#Introduction
2
-
####What is PHP 7 Migration Assistant Report(MAR)?
1
+
#Introduction
2
+
####What is PHP 7 Migration Assistant Report(MAR)?
3
3
PHP 7 MAR, or just "php7mar", is a command line utility to generate reports on existing PHP 5 code to assist developers in porting their code quickly to PHP 7. It will run against invididual files or entire project folders. Reports contain line numbers, issues noted, and suggested fixes along with documentation links.
4
4
5
-
####Will php7mar automatically fix my code?
5
+
####Will php7mar automatically fix my code?
6
6
No, php7mar does implement a full lexer to determine code changes and can not determine the intent of the code. It uses lexer tokenizing, string matching, and regular expressions to find syntax changes that may cause issues when porting code to PHP 7. As well, it will detect code snippets in comments and report them as it can not distinguish it as commented code.
7
7
8
-
####What has changed in PHP 7? (Read This!)
8
+
####What has changed in PHP 7? (Read This!)
9
9
If you are currently unfamiliar with what will change moving to PHP 7 then read the [UPGRADING file in the current master branch of php-src](https://github.com/php/php-src/blob/PHP-7.0.0/UPGRADING). Understanding these changes is important to reading the reports generated by php7mar.
10
10
11
-
####Does it handle very poorly styled code?
11
+
####Does it handle very poorly styled code?
12
12
Very poorly styled code will not parse well, but assuming there is at least some structure to the code style it should still parse. If the code is entirely too poorly formatted there are several web sites that can be used to clean up source code.
13
13
14
14
*http://www.phpformatter.com/ (Does not support PHP 5.4 [] array syntax.)
15
15
*http://phpbeautifier.com/
16
16
*http://phpcodecleaner.com/
17
17
18
-
#Usage
18
+
#Usage
19
19
First, start by downloading or cloning this repository. It does not need to be placed inside the folder containing the source code.
20
20
21
21
To begin, type on the command line:
@@ -38,7 +38,7 @@ Give a try, use the included `testcases.php` to generate a report:
38
38
39
39
php mar.php -f="testcases.php"
40
40
41
-
##Available Options:
41
+
##Available Options:
42
42
**-f**
43
43
```
44
44
Path to the file or folder to run against.
@@ -74,12 +74,12 @@ Give a try, use the included `testcases.php` to generate a report:
74
74
*Example: --php="/path/to/php/binary/php"*
75
75
```
76
76
77
-
#Test Types
78
-
##Critical
77
+
#Test Types
78
+
##Critical
79
79
Critical tests look for issues that will cause broken code, compilation errors, or otherwise create code that works in unintended manors.
80
80
81
-
##Nuance
81
+
##Nuance
82
82
Nuance tests look for issues that might cause silent underisable code behavior. These tests can report many false positives as they can not determine the intent of the code being checked.
83
83
84
-
##Syntax
84
+
##Syntax
85
85
A basic command line based syntax checker that checks all files for standard syntax issues. This is useful for double checking work after making many mass find and replace operations. Please note that syntax checking adds a significant increase to processing time especially for large code bases. To run without syntax checking use the -t option and omit syntax; -t="critical,nuance"
0 commit comments