package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -16,10 +16,10 @@ use Symfony\Component\DomCrawler\Crawler;
final class CrawlerSelectorTextContains extends Constraint
{
private $selector;
private $expectedText;
private $hasNode = false;
private $nodeText;
private string $selector;
private string $expectedText;
private bool $hasNode = false;
private string $nodeText;
public function __construct(string $selector, string $expectedText)
{
@@ -27,9 +27,6 @@ final class CrawlerSelectorTextContains extends Constraint
$this->expectedText = $expectedText;
}
/**
* {@inheritdoc}
*/
public function toString(): string
{
if ($this->hasNode) {
@@ -41,8 +38,6 @@ final class CrawlerSelectorTextContains extends Constraint
/**
* @param Crawler $crawler
*
* {@inheritdoc}
*/
protected function matches($crawler): bool
{
@@ -56,13 +51,11 @@ final class CrawlerSelectorTextContains extends Constraint
$this->hasNode = true;
$this->nodeText = $crawler->text(null, true);
return false !== mb_strpos($this->nodeText, $this->expectedText);
return str_contains($this->nodeText, $this->expectedText);
}
/**
* @param Crawler $crawler
*
* {@inheritdoc}
*/
protected function failureDescription($crawler): string
{