Skip to content

Instantly share code, notes, and snippets.

@Spriz
Last active May 15, 2019 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spriz/93f0a79c9d1c5257713c2a783f1a0f1f to your computer and use it in GitHub Desktop.
Save Spriz/93f0a79c9d1c5257713c2a783f1a0f1f to your computer and use it in GitHub Desktop.
<?php
declare(strict_types=1);
namespace App;
use Cake\Utility\Text;
class Foo
{
public function bar()
{
return (new Text())->uuid();
}
}
<?php
declare(strict_types=1);
namespace App;
use Cake\Utility\Text;
class Foo
{
public function bar()
{
return Text::uuid();
}
}
✘  ~/code/apacta/apacta-2   dependencyUpgradesForPhp7-SetCorrectFilePermissions ●✚  rector process ./src/Foo.php --level php70 -vvv
Rector v0.4.12
Config file: /Users/spriz/code/apacta/apacta-2/rector.yaml
/Users/spriz/code/apacta/apacta-2/src/Foo.php
/Users/spriz/code/apacta/apacta-2/src/Foo.php
Rector\Php\Rector\FunctionLike\Php4ConstructorRector
Rector\Php\Rector\FunctionLike\ExceptionHandlerTypehintRector
Rector\Php\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector
Rector\Php\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector
/Users/spriz/code/apacta/apacta-2/src/Foo.php
1 file with changes
===================
1) /Users/spriz/code/apacta/apacta-2/src/Foo.php
---------- begin diff ----------
--- Original
+++ New
@@ -9,6 +9,6 @@
{
public function bar()
{
- return Text::uuid();
+ return (new Text())->uuid();
}
}
----------- end diff -----------
Applied rectors:
* Rector\Php\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector
[OK] Rector is done! 1 changed files
 ~/code/apacta/apacta-2   dependencyUpgradesForPhp7-SetCorrectFilePermissions ●✚ 
✘  ~/code/apacta/apacta-2   dependencyUpgradesForPhp7-SetCorrectFilePermissions ●✚  rector --version
Config file: /Users/spriz/code/apacta/apacta-2/rector.yaml
Rector v0.4.12
parameters:
exclude_paths:
- '_infrastructure/*'
- 'config/Migrations/*'
- 'logs/*'
- 'tmp/*'
- 'vendor/*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment