rector/docs/AllRectorsOverview.md

782 lines
20 KiB
Markdown
Raw Normal View History

2018-05-04 22:30:32 +00:00
# All Rectors Overview
2018-04-29 09:03:47 +00:00
2018-05-05 12:48:33 +00:00
## Rector\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector
Turns action injection in Controllers to constructor injection
```diff
final class SomeController
{
- public function default(ProductRepository $productRepository)
+ /**
+ * @var ProductRepository
+ */
+ private $productRepository;
+ public function __construct(ProductRepository $productRepository)
{
- $products = $productRepository->fetchAll();
+ $this->productRepository = $productRepository;
+ }
+
+ public function default()
+ {
+ $products = $this->productRepository->fetchAll();
}
}
```
## Rector\Rector\Architecture\DependencyInjection\ReplaceVariableByPropertyFetchRector
Turns variable in controller action to property fetch, as follow up to action injection variable to property change.
```diff
final class SomeController
{
/**
* @var ProductRepository
*/
private $productRepository;
public function __construct(ProductRepository $productRepository)
{
$this->productRepository = $productRepository;
}
public function default()
{
- $products = $productRepository->fetchAll();
+ $products = $this->productRepository->fetchAll();
}
}
```
2018-05-04 22:30:32 +00:00
## Rector\Rector\Architecture\RepositoryAsService\ReplaceParentRepositoryCallsByRepositoryPropertyRector
Handles method calls in child of Doctrine EntityRepository and moves them to "$this->repository" property.
```diff
2018-05-04 23:40:50 +00:00
<?php
use Doctrine\ORM\EntityRepository;
class SomeRepository extends EntityRepository
2018-05-04 22:30:32 +00:00
{
public function someMethod()
{
- return $this->findAll();
+ return $this->repository->findAll();
}
}
```
## Rector\Rector\Architecture\RepositoryAsService\MoveRepositoryFromParentToConstructorRector
Turns parent EntityRepository class to constructor dependency
```diff
namespace App\Repository;
+use App\Entity\Post;
use Doctrine\ORM\EntityRepository;
-final class PostRepository extends EntityRepository
+final class PostRepository
{
+ /**
+ * @var \Doctrine\ORM\EntityRepository
+ */
+ private $repository;
+ public function __construct(\Doctrine\ORM\EntityManager $entityManager)
+ {
+ $this->repository = $entityManager->getRepository(\App\Entity\Post::class);
+ }
}
```
## Rector\Rector\Architecture\RepositoryAsService\ServiceLocatorToDIRector
Turns "$this->getRepository()" in Symfony Controller to constructor injection and private property access.
```diff
class ProductController extends Controller
{
+ /**
+ * @var ProductRepository
+ */
+ private $productRepository;
+
+ public function __construct(ProductRepository $productRepository)
+ {
+ $this->productRepository = $productRepository;
+ }
+
public function someAction()
{
$entityManager = $this->getDoctrine()->getManager();
- $entityManager->getRepository('SomethingBundle:Product')->findSomething(...);
+ $this->productRepository->findSomething(...);
}
}
```
## Rector\Rector\Dynamic\MethodNameReplacerRector
[Dynamic] Turns method names to new ones.
```diff
$someObject = new SomeClass;
-$someObject->oldMethod();
+$someObject->newMethod();
-SomeClass::oldStaticMethod();
+SomeClass::newStaticMethod();
```
## Rector\Rector\Dynamic\PropertyToMethodRector
[Dynamic] Replaces properties assign calls be defined methods.
```diff
-$result = $object->property;
-$object->property = $value;
+$result = $object->getProperty();
+$object->setProperty($value);
```
## Rector\Rector\Dynamic\ClassReplacerRector
[Dynamic] Replaces defined classes by new ones.
```diff
-$value = new SomeOldClass;
+$value = new SomeNewClass;
```
2018-06-02 11:46:23 +00:00
## Rector\Rector\CodeQuality\InArrayAndArrayKeysToArrayKeyExistsRector
2018-05-04 22:30:32 +00:00
Simplify `in_array` and `array_keys` functions combination into `array_key_exists` when `array_keys` has one argument only
```diff
-in_array("key", array_keys($array), true);
+array_key_exists("key", $array);
```
2018-06-02 11:46:23 +00:00
## Rector\Rector\CodeQuality\UnnecessaryTernaryExpressionRector
Remove unnecessary ternary expressions.
```diff
-$foo === $bar ? true : false;
+$foo === $bar;
```
2018-05-04 22:30:32 +00:00
## Rector\Rector\Dynamic\ParentTypehintedArgumentRector
[Dynamic] Changes defined parent class typehints.
```diff
2018-05-04 23:40:50 +00:00
interface SomeInterface
{
public read(string $content);
}
2018-05-04 22:30:32 +00:00
class SomeClass implements SomeInterface
{
- public read($content);
+ public read(string $content);
}
```
## Rector\Rector\Dynamic\ArgumentRemoverRector
[Dynamic] Removes defined arguments in defined methods and their calls.
```diff
2018-05-05 00:04:41 +00:00
$someObject = new SomeClass;
-$someObject->someMethod(true);
+$someObject->someMethod();'
2018-05-04 22:30:32 +00:00
```
## Rector\Rector\Dynamic\FunctionToMethodCallRector
[Dynamic] Turns defined function calls to local method calls.
```diff
-view("...", []);
+$this->render("...", []);
```
2018-06-02 11:39:01 +00:00
## Rector\PhpParser\Rector\IdentifierRector
2018-05-04 22:30:32 +00:00
Turns node string names to Identifier object in php-parser
```diff
$constNode = new \PhpParser\Node\Const_;
-$name = $constNode->name;
+$name = $constNode->name->toString();'
```
2018-06-02 11:39:01 +00:00
## Rector\PhpParser\Rector\ParamAndStaticVarNameRector
2018-05-04 22:30:32 +00:00
Turns old string `var` to `var->name` sub-variable in Node of PHP-Parser
```diff
-$paramNode->name;
+$paramNode->var->name;
-$staticVarNode->name;
+$staticVarNode->var->name;
```
2018-06-02 11:39:01 +00:00
## Rector\PhpParser\Rector\CatchAndClosureUseNameRector
2018-05-04 22:30:32 +00:00
Turns `$catchNode->var` to its new `name` property in php-parser
```diff
-$catchNode->var;
+$catchNode->var->name
```
2018-06-02 11:39:01 +00:00
## Rector\PhpParser\Rector\SetLineRector
2018-05-04 22:30:32 +00:00
Turns standalone line method to attribute in Node of PHP-Parser
```diff
-$node->setLine(5);
+$node->setAttribute("line", 5);
```
2018-06-02 11:39:01 +00:00
## Rector\PhpParser\Rector\RemoveNodeRector
2018-05-04 22:30:32 +00:00
Turns integer return to remove node to constant in NodeVisitor of PHP-Parser
```diff
public function leaveNode()
{
- return false;
+ return NodeTraverser::REMOVE_NODE;
}
```
2018-06-02 11:39:01 +00:00
## Rector\PhpParser\Rector\UseWithAliasRector
2018-05-04 22:30:32 +00:00
Turns use property to method and `$node->alias` to last name in UseAlias Node of PHP-Parser
```diff
-$node->alias;
+$node->getAlias();
-$node->name->getLast();
+$node->alias
```
## Rector\Rector\Dynamic\PropertyNameReplacerRector
[Dynamic] Replaces defined old properties by new ones.
```diff
-$someObject->someOldProperty;
+$someObject->someNewProperty;
```
## Rector\Rector\Dynamic\ClassConstantReplacerRector
[Dynamic] Replaces defined class constants in their calls.
```diff
-$value = SomeClass::OLD_CONSTANT;
+$value = SomeClass::NEW_CONSTANT;
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertNotOperatorRector
2018-05-04 22:30:32 +00:00
Turns not-operator comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertTrue(!$foo, "message");
+$this->assertFalse($foo, "message");
-$this->assertFalse(!$foo, "message");
+$this->assertTrue($foo, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertComparisonToSpecificMethodRector
2018-05-04 22:30:32 +00:00
Turns comparison operations to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertTrue($foo === $bar, "message");
+$this->assertSame($bar, $foo, "message");
-$this->assertFalse($foo >= $bar, "message");
+$this->assertLessThanOrEqual($bar, $foo, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertTrueFalseToSpecificMethodRector
2018-05-04 22:30:32 +00:00
Turns true/false comparisons to their method name alternatives in PHPUnit TestCase when possible
```diff
-$this->assertTrue(is_readable($readmeFile), "message");
+$this->assertIsReadable($readmeFile, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertSameBoolNullToSpecificMethodRector
2018-05-04 22:30:32 +00:00
Turns same bool and null comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertSame(null, $anything);
+$this->assertNull($anything);
-$this->assertNotSame(false, $anything);
+$this->assertNotFalse($anything);
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertFalseStrposToContainsRector
2018-05-04 22:30:32 +00:00
Turns `strpos`/`stripos` comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertFalse(strpos($anything, "foo"), "message");
+$this->assertNotContains("foo", $anything, "message");
-$this->assertNotFalse(stripos($anything, "foo"), "message");
+$this->assertContains("foo", $anything, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertTrueFalseInternalTypeToSpecificMethodRector
2018-05-04 22:30:32 +00:00
Turns true/false with internal type comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertTrue(is_{internal_type}($anything), "message");
+$this->assertInternalType({internal_type}, $anything, "message");
-$this->assertFalse(is_{internal_type}($anything), "message");
+$this->assertNotInternalType({internal_type}, $anything, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertCompareToSpecificMethodRector
2018-05-04 22:30:32 +00:00
Turns vague php-only method in PHPUnit TestCase to more specific
```diff
-$this->assertSame(10, count($anything), "message");
+$this->assertCount(10, $anything, "message");
-$this->assertSame($value, {function}($anything), "message");
+$this->assert{function}($value, $anything, "message\");
-$this->assertEquals($value, {function}($anything), "message");
+$this->assert{function}($value, $anything, "message\");
-$this->assertNotSame($value, {function}($anything), "message");
+$this->assertNot{function}($value, $anything, "message")
-$this->assertNotEquals($value, {function}($anything), "message");
+$this->assertNot{function}($value, $anything, "message")
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertIssetToSpecificMethodRector
2018-05-04 22:30:32 +00:00
Turns isset comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertTrue(isset($anything->foo));
+$this->assertFalse(isset($anything["foo"]), "message");
-$this->assertObjectHasAttribute("foo", $anything);
+$this->assertArrayNotHasKey("foo", $anything, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertInstanceOfComparisonRector
2018-05-04 22:30:32 +00:00
Turns instanceof comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertTrue($foo instanceof Foo, "message");
+$this->assertFalse($foo instanceof Foo, "message");
-$this->assertInstanceOf("Foo", $foo, "message");
+$this->assertNotInstanceOf("Foo", $foo, "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertPropertyExistsRector
2018-05-04 22:30:32 +00:00
Turns `property_exists` comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertTrue(property_exists(new Class, "property"), "message");
+$this->assertClassHasAttribute("property", "Class", "message");
-$this->assertFalse(property_exists(new Class, "property"), "message");
+$this->assertClassNotHasAttribute("property", "Class", "message");
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\SpecificMethod\AssertRegExpRector
2018-05-04 22:30:32 +00:00
Turns `preg_match` comparisons to their method name alternatives in PHPUnit TestCase
```diff
-$this->assertSame(1, preg_match("/^Message for ".*"\.$/", $string), $message);
+$this->assertRegExp("/^Message for ".*"\.$/", $string, $message);
-$this->assertEquals(false, preg_match("/^Message for ".*"\.$/", $string), $message);
+$this->assertNotRegExp("/^Message for ".*"\.$/", $string, $message);
```
2018-06-13 08:43:34 +00:00
## Rector\PHPUnit\Rector\ArrayToYieldDataProviderRector
Turns method data providers in PHPUnit from arrays to yield
```diff
/**
- * @return mixed[]
*/
-public function provide(): array
+public function provide(): Iterator
{
- return [
- ['item']
- ]
+ yield ['item'];
}
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\ExceptionAnnotationRector
2018-05-04 22:30:32 +00:00
Takes `setExpectedException()` 2nd and next arguments to own methods in PHPUnit.
```diff
-/**
- * @expectedException Exception
- * @expectedExceptionMessage Message
- */
public function test()
{
+ $this->expectException('Exception');
+ $this->expectExceptionMessage('Message');
// tested code
}
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\GetMockRector
2018-05-04 22:30:32 +00:00
Turns getMock*() methods to createMock()
```diff
-$this->getMock("Class")
+$this->createMock("Class")
-$this->getMockWithoutInvokingTheOriginalConstructor("Class")
+$this->createMock("Class"
```
## Rector\Rector\Dynamic\PseudoNamespaceToNamespaceRector
[Dynamic] Replaces defined Pseudo_Namespaces by Namespace\Ones.
```diff
-$someServie = Some_Object;
+$someServie = Some\Object;
```
2018-06-02 11:29:48 +00:00
## Rector\PHPUnit\Rector\DelegateExceptionArgumentsRector
2018-05-04 22:30:32 +00:00
Takes `setExpectedException()` 2nd and next arguments to own methods in PHPUnit.
```diff
-$this->setExpectedException(Exception::class, "Message", "CODE");
+$this->setExpectedException(Exception::class);
+$this->expectExceptionMessage("Message");
+$this->expectExceptionCode("CODE");
```
## Rector\Rector\Dynamic\AnnotationReplacerRector
[Dynamic] Turns defined annotations above properties and methods to their new values.
```diff
-/** @test */
+/** @scenario */
public function someMethod() {};
```
2018-06-02 10:44:43 +00:00
## Rector\Sensio\Rector\FrameworkExtraBundle\TemplateAnnotationRector
2018-05-04 22:30:32 +00:00
Turns @Template annotation to explicit method call in Controller of FrameworkExtraBundle in Symfony
```diff
-/**
- * @Template()
- */
public function indexAction()
{
+ return $this->render("index.html.twig");
}
```
2018-06-02 11:15:01 +00:00
## Rector\Sylius\Rector\Review\ReplaceCreateMethodWithoutReviewerRector
2018-05-04 22:30:32 +00:00
Turns `createForSubjectWithReviewer()` with null review to standalone method in Sylius
```diff
-$this->createForSubjectWithReviewer($subject, null)
+$this->createForSubject($subject)
```
2018-05-05 00:04:41 +00:00
## Rector\Rector\Dynamic\ArgumentAdderRector
[Dynamic] This Rector adds new default arguments in calls of defined methods and class types.
```diff
$someObject = new SomeClass;
-$someObject->someMethod();
+$someObject->someMethod(true);
class MyCustomClass extends SomeClass
{
- public function someMethod()
+ public function someMethod($value = true)
{
}
}
```
2018-05-04 22:30:32 +00:00
## Rector\Rector\Dynamic\ReturnTypehintRector
[Dynamic] Changes defined return typehint of method and class.
```diff
class SomeClass
{
- public getData();
+ public getData(): array;
}
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector
2018-05-04 22:30:32 +00:00
Turns fetching of dependencies via `$container->get()` in ContainerAware to constructor injection in Command and Controller in Symfony
```diff
-class MyCommand extends ContainerAwareCommand
+class MyCommand extends Command
{
+ public function __construct(SomeService $someService)
+ {
+ $this->someService = $someService;
+ }
+
public function someMethod()
{
// ...
- $this->getContainer()->get('some_service');
- $this->container->get('some_service');
+ $this->someService;
+ $this->someService;
}
}
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\FrameworkBundle\GetParameterToConstructorInjectionRector
2018-05-04 22:30:32 +00:00
Turns fetching of parameters via `getParameter()` in ContainerAware to constructor injection in Command and Controller in Symfony
```diff
-class MyCommand extends ContainerAwareCommand
+class MyCommand extends Command
{
+ private $someParameter;
+
+ public function __construct($someParameter)
+ {
+ $this->someParameter = $someParameter;
+ }
+
public function someMethod()
{
- $this->getParameter('someParameter');
+ $this->someParameter;
}
}
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\FrameworkBundle\GetToConstructorInjectionRector
2018-05-04 22:30:32 +00:00
Turns fetching of dependencies via `$this->get()` to constructor injection in Command and Controller in Symfony
```diff
-class MyCommand extends ContainerAwareCommand
+class MyCommand extends Command
{
+ public function __construct(SomeService $someService)
+ {
+ $this->someService = $someService;
+ }
+
public function someMethod()
{
- // ...
- $this->get('some_service');
+ $this->someService;
}
}
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Controller\RedirectToRouteRector
2018-05-04 22:30:32 +00:00
Turns redirect to route to short helper method in Controller in Symfony
```diff
-$this->redirect($this->generateUrl("homepage"));
+$this->redirectToRoute("homepage");
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Controller\AddFlashRector
2018-05-04 22:30:32 +00:00
Turns long flash adding to short helper method in Controller in Symfony
```diff
2018-06-13 08:43:34 +00:00
class SomeController extends Controller
{
public function some(Request $request)
{
- $request->getSession()->getFlashBag()->add("success", "something");
+ $this->addFlash("success", "something");
}
}
2018-05-04 22:30:32 +00:00
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\HttpKernel\GetRequestRector
2018-05-04 22:30:32 +00:00
Turns fetching of dependencies via `$this->get()` to constructor injection in Command and Controller in Symfony
```diff
+use Symfony\Component\HttpFoundation\Request;
+
class SomeController
{
- public function someAction()
+ public action(Request $request)
{
- $this->getRequest()->...();
+ $request->...();
}
}
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Form\FormTypeGetParentRector
2018-05-04 22:30:32 +00:00
Turns string Form Type references to their CONSTANT alternatives in `getParent()` and `getExtendedType()` methods in Form in Symfony
```diff
-function getParent() { return "collection"; }
+function getParent() { return CollectionType::class; }
-function getExtendedType() { return "collection"; }
+function getExtendedType() { return CollectionType::class; }
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Form\OptionNameRector
2018-05-04 22:30:32 +00:00
Turns old option names to new ones in FormTypes in Form in Symfony
```diff
-$builder->add("...", ["precision" => "...", "virtual" => "..."];
+$builder->add("...", ["scale" => "...", "inherit_data" => "..."];
```
2018-07-31 06:38:48 +00:00
## Rector\Rector\Dynamic\ArgumentDefaultValueReplacerRector
[Dynamic] Replaces defined map of arguments in defined methods and their calls.
```diff
$someObject = new SomeClass;
-$someObject->someMethod(SomeClass::OLD_CONSTANT);
+$someObject->someMethod(false);'
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Console\ConsoleExceptionToErrorEventConstantRector
2018-05-04 22:30:32 +00:00
Turns old event name with EXCEPTION to ERROR constant in Console in Symfony
```diff
-"console.exception"
+Symfony\Component\Console\ConsoleEvents::ERROR
-Symfony\Component\Console\ConsoleEvents::EXCEPTION
+Symfony\Component\Console\ConsoleEvents::ERROR
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Validator\ConstraintUrlOptionRector
2018-05-04 22:30:32 +00:00
Turns true value to `Url::CHECK_DNS_TYPE_ANY` in Validator in Symfony.
```diff
-$constraint = new Url(["checkDNS" => true]);
+$constraint = new Url(["checkDNS" => Url::CHECK_DNS_TYPE_ANY]);
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Form\FormIsValidRector
2018-05-04 22:30:32 +00:00
Adds `$form->isSubmitted()` validatoin to all `$form->isValid()` calls in Form in Symfony
```diff
-if ($form->isValid()) { ... };
+if ($form->isSubmitted() && $form->isValid()) { ... };
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Form\StringFormTypeToClassRector
2018-05-04 22:30:32 +00:00
Turns string Form Type references to their CONSTANT alternatives in FormTypes in Form in Symfony
```diff
-$form->add("name", "form.type.text");
+$form->add("name", \Symfony\Component\Form\Extension\Core\Type\TextType::class);
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\VarDumper\VarDumperTestTraitMethodArgsRector
2018-05-04 22:30:32 +00:00
Adds new `$format` argument in `VarDumperTestTrait->assertDumpEquals()` in Validator in Symfony.
```diff
-VarDumperTestTrait->assertDumpEquals($dump, $data, $mesage = "");
+VarDumperTestTrait->assertDumpEquals($dump, $data, $context = null, $mesage = "");
-VarDumperTestTrait->assertDumpMatchesFormat($dump, $format, $mesage = "");
+VarDumperTestTrait->assertDumpMatchesFormat($dump, $format, $context = null, $mesage = "");
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector
2018-05-04 22:30:32 +00:00
Turns old default value to parameter in ContinerBuilder->build() method in DI in Symfony
```diff
-$containerBuilder = new Symfony\Component\DependencyInjection\ContainerBuilder(); $containerBuilder->compile();
+$containerBuilder = new Symfony\Component\DependencyInjection\ContainerBuilder(); $containerBuilder->compile(true);
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Process\ProcessBuilderInstanceRector
2018-05-04 22:30:32 +00:00
Turns `ProcessBuilder::instance()` to new ProcessBuilder in Process in Symfony. Part of multi-step Rector.
```diff
-$processBuilder = Symfony\Component\Process\ProcessBuilder::instance($args);
+$processBuilder = new Symfony\Component\Process\ProcessBuilder($args);
```
2018-06-01 13:51:34 +00:00
## Rector\Symfony\Rector\Process\ProcessBuilderGetProcessRector
2018-05-04 22:30:32 +00:00
Removes `$processBuilder->getProcess()` calls to $processBuilder in Process in Symfony, because ProcessBuilder was removed. This is part of multi-step Rector and has very narrow focus.
```diff
$processBuilder = new Symfony\Component\Process\ProcessBuilder;
-$process = $processBuilder->getProcess();
-$commamdLine = $processBuilder->getProcess()->getCommandLine();
+$process = $processBuilder;
+$commamdLine = $processBuilder->getCommandLine();
```
2018-04-29 09:03:47 +00:00