2021-02-28 13:53:28 +01:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-02-28 13:53:28 +01:00
|
|
|
namespace Rector\Php80\ValueObjectFactory;
|
|
|
|
|
|
|
|
use PhpParser\Node\Expr\FuncCall;
|
|
|
|
use Rector\Php80\ValueObject\StrStartsWith;
|
|
|
|
final class StrStartsWithFactory
|
|
|
|
{
|
2021-05-10 22:23:08 +00:00
|
|
|
public function createFromFuncCall(\PhpParser\Node\Expr\FuncCall $funcCall, bool $isPositive) : \Rector\Php80\ValueObject\StrStartsWith
|
2021-02-28 13:53:28 +01:00
|
|
|
{
|
|
|
|
$haystack = $funcCall->args[0]->value;
|
|
|
|
$needle = $funcCall->args[1]->value;
|
2021-05-10 22:23:08 +00:00
|
|
|
return new \Rector\Php80\ValueObject\StrStartsWith($funcCall, $haystack, $needle, $isPositive);
|
2021-02-28 13:53:28 +01:00
|
|
|
}
|
|
|
|
}
|