Before | After |
$a = new SomeClass; |
$a = new SomeClass(); |
Before | After |
$a = join(',', $arr);
die("done"); |
$a = implode(',', $arr);
exit("done"); |
Before | After |
$a = [
1 => 1,
22 => 22,
333 => 333,
]; |
$a = [
1 => 1,
22 => 22,
333 => 333,
]; |
Before | After |
$a = 1; // Comment 1
$bb = 22; // Comment 2
$ccc = 333; // Comment 3 |
$a = 1; // Comment 1
$bb = 22; // Comment 2
$ccc = 333; // Comment 3 |
Before | After |
$a = 1;
$bb = 22;
$ccc = 333; |
$a = 1;
$bb = 22;
$ccc = 333; |
Before | After |
$a = [
1 => 1,
22 => 22,
333 => 333,
4444 => 4444,
]; |
$a = [
1 => 1,
22 => 22,
333 => 333,
4444 => 4444,
]; |
Before | After |
function a(
TypeA $a,
TypeBB $bb,
TypeCCC $ccc = array(),
TypeDDDD $dddd,
TypeEEEEE $eeeee
){
noop();
} |
function a(
TypeA $a,
TypeBB $bb,
TypeCCC $ccc = array(),
TypeDDDD $dddd,
TypeEEEEE $eeeee
){
noop();
} |
Before | After |
if ($a) {
} |
if ($a)
{
} |
Before | After |
$a = new SomeClass() |
$a = new SomeClass(); |
Before | After |
class A {
const constant = 1;
function b(){
A::constant;
}
} |
class A {
const constant = 1;
function b(){
self::constant;
}
} |
Before | After |
class A {
const constant = 1;
function b(){
A::constant;
}
} |
class A {
const constant = 1;
function b(){
static::constant;
}
} |
<?="Hello World"?>
<?php echo "Hello World" ?>
Before | After |
$a = ""; |
$a = ''; |
Before | After |
namespace NS1;
class A {
} |
namespace NS1 {
class A {
}
} |
Before | After |
class A {
function a(Someclass $a) {
return 1;
}
} |
class A {
/**
* @param Someclass $a
* @return int
*/
function a(Someclass $a) {
return 1;
}
} |
Before | After |
$a = ($b)
? $c
: $d
; |
$a = ($b)
? $c
: $d
; |
Before | After |
$a = join(',', $arr); |
$a = implode(',', $arr); |
Before | After |
$a = [$a, $b]; |
$b = array($b, $c); |
Before | After |
if($a){
} else if($b) {
} |
if($a){
} elseif($b) {
} |
<?php
namespace A;
?>
<?php
namespace A;
?>
Before | After |
/**
* @param int $myInt
*/
function a($myInt){
} |
/**
* @param int $myInt
*/
function a($myInt){
} |
Before | After |
use C;
use B;
class D {
function f() {
new B();
}
} |
use B;
use C;
class D {
function f() {
new B();
}
} |
Before | After |
use C;
use B;
class D {
function f() {
new B();
}
} |
use B;
class D {
function f() {
new B();
}
} |
Before | After |
class A {
public function d(){}
protected function b(){}
private $a = "";
private function c(){}
public function a(){}
public $b = "";
const B = 0;
const A = 0;
} |
class A {
const A = 0;
const B = 0;
public $b = "";
private $a = "";
public function a(){}
public function d(){}
protected function b(){}
private function c(){}
} |
Before | After |
/**
* @param int $a
* @param int $b
* @return int
*/
function abc($a = 10, $b = 20, $c) {
} |
/**
* @param int $a
* @param int $b
* @return int
*/
function abc(int $a = 10, int $b = 20, $c): int {
} |
Before | After |
/**
* some description.
* @param array $b
* @param LongTypeName $c
*/
function A(array $b, LongTypeName $c) {
} |
/**
* some description.
* @param array $b
* @param LongTypeName $c
*/
function A(array $b, LongTypeName $c) {
} |
Before | After |
// PSR2 Mode - From
function a()
{} |
function a() {} |
Before | After |
$codeAlignedWithTabs = true |
$codeAlignedWithTabs = false |
Before | After |
function a($a, $b, $c)
{} |
function a(
$a,
$b,
$c
) {} |
Before | After |
$aaaaa->b
->c; |
$aaaaa->b
->c; |
Before | After |
switch ($a) {
case 1:
echo 'a';
} |
switch ($a) {
case 1:
echo 'a';
} |
Before | After |
require_once("file.php"); |
require_once "file.php"; |
Before | After |
function xxx() {
// code
}; |
function xxx() {
// code
} |
Before | After |
namespace NS1;
use \B;
use \D;
new B();
new D(); |
namespace NS1;
use B;
use D;
new B();
new D(); |
Before | After |
if ($a and $b or $c) {...} |
if ($a && $b || $c) {...} |
Before | After |
is_null($a); |
null === $a; |
Before | After |
function a(){
return null;
} |
function a(){
return;
} |
Before | After |
echo array(); |
echo []; |
Before | After |
if($a) echo array(); |
if($a) {
echo array();
} |
Before | After |
if ($a) {
}
if ($b) {
} |
if ($a) {
}
if ($b) {
} |
Before | After |
if (!true) foo(); |
if ( ! true) foo(); |
Before | After |
class A {
function b(){
}
function c(){
}
} |
class A {
function b(){
}
function c(){
}
} |
Before | After |
if($a){
} elseif($b) {
} |
if($a){
} else if($b) {
} |
Before | After |
array_search($needle, $haystack);
base64_decode($str);
in_array($needle, $haystack);
array_keys($arr);
mb_detect_encoding($arr);
array_keys($arr, [1]);
mb_detect_encoding($arr, 'UTF8'); |
array_search($needle, $haystack, true);
base64_decode($str, true);
in_array($needle, $haystack, true);
array_keys($arr, null, true);
mb_detect_encoding($arr, null, true);
array_keys($arr, [1], true);
mb_detect_encoding($arr, 'UTF8', true); |
Before | After |
if($a == $b){}
if($a != $b){} |
if($a === $b){}
if($a !== $b){} |
Before | After |
$a = [$a, $b, ];
$b = array($b, $c, ); |
$a = [$a, $b];
$b = array($b, $c); |
Before | After |
class A {
protected $a;
} |
class A {
protected $a;
} |
Before | After |
for ($a = 0; $a < 10; $a++){
if($a){
// do something
}
} |
for ($a = 0; $a < 10; $a++){
if($a){
// do something
}
} |
Before | After |
$a = [$a, $b];
$b = array($b, $c); |
$a=[$a,$b];$b=array($b,$c); |
Before | After |
for ($a = 0; $a < 10; $a++){
if($a){
// do something
}
} |
for ($a = 0; $a < 10; $a++){
if($a){
// do something
}
} |
Before | After |
$a = 'a' . 'b';
$a = 'a' . 1 . 'b'; |
$a = 'a'.'b';
$a = 'a'. 1 .'b'; |
Before | After |
$var = ereg("[A-Z]", $var);
$var = eregi_replace("[A-Z]", "", $var)
$var = spliti("[A-Z]", $var); |
$var = preg_match("/[A-Z]/Di", $var);
$var = preg_replace("/[A-Z]/Di", "", $var);
$var = preg_split("/[A-Z]/Di", $var); |
Before | After |
class A {
function A(){
}
} |
class A {
function __construct(){
}
} |
Before | After |
if($a == 1){
} |
if(1 == $a){
} |