2020-04-23 14:34:27 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2020-04-23 14:34:27 +02:00
|
|
|
namespace Rector\Php80\ValueObject;
|
|
|
|
|
|
|
|
use PhpParser\Node\Expr;
|
|
|
|
use PhpParser\Node\Expr\FuncCall;
|
2020-09-01 19:56:30 +02:00
|
|
|
final class StrStartsWith
|
2020-04-23 14:34:27 +02:00
|
|
|
{
|
2020-04-26 02:57:47 +02:00
|
|
|
/**
|
2021-08-23 00:20:32 +00:00
|
|
|
* @var \PhpParser\Node\Expr\FuncCall
|
2020-04-23 14:34:27 +02:00
|
|
|
*/
|
2020-04-23 23:49:56 +02:00
|
|
|
private $funcCall;
|
2020-04-23 14:34:27 +02:00
|
|
|
/**
|
2021-08-23 00:20:32 +00:00
|
|
|
* @var \PhpParser\Node\Expr
|
2020-04-23 14:34:27 +02:00
|
|
|
*/
|
|
|
|
private $haystackExpr;
|
2020-04-23 23:49:56 +02:00
|
|
|
/**
|
2021-08-23 00:20:32 +00:00
|
|
|
* @var \PhpParser\Node\Expr
|
2020-04-23 23:49:56 +02:00
|
|
|
*/
|
|
|
|
private $needleExpr;
|
2021-05-10 23:39:21 +00:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private $isPositive;
|
2021-05-10 22:23:08 +00:00
|
|
|
public function __construct(\PhpParser\Node\Expr\FuncCall $funcCall, \PhpParser\Node\Expr $haystackExpr, \PhpParser\Node\Expr $needleExpr, bool $isPositive)
|
2020-04-23 14:34:27 +02:00
|
|
|
{
|
2020-04-23 23:49:56 +02:00
|
|
|
$this->funcCall = $funcCall;
|
2020-04-23 14:34:27 +02:00
|
|
|
$this->haystackExpr = $haystackExpr;
|
2020-04-23 23:49:56 +02:00
|
|
|
$this->needleExpr = $needleExpr;
|
2021-05-10 23:39:21 +00:00
|
|
|
$this->isPositive = $isPositive;
|
2020-04-23 14:34:27 +02:00
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getFuncCall() : \PhpParser\Node\Expr\FuncCall
|
2020-04-23 14:34:27 +02:00
|
|
|
{
|
2020-04-23 23:49:56 +02:00
|
|
|
return $this->funcCall;
|
2020-04-23 14:34:27 +02:00
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getHaystackExpr() : \PhpParser\Node\Expr
|
2020-04-23 14:34:27 +02:00
|
|
|
{
|
|
|
|
return $this->haystackExpr;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function isPositive() : bool
|
2020-04-23 14:34:27 +02:00
|
|
|
{
|
|
|
|
return $this->isPositive;
|
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getNeedleExpr() : \PhpParser\Node\Expr
|
2020-04-23 23:49:56 +02:00
|
|
|
{
|
|
|
|
return $this->needleExpr;
|
|
|
|
}
|
2020-04-23 14:34:27 +02:00
|
|
|
}
|