Skip to content

Commit edd6368

Browse files
author
Bastian Schwarz
committed
Added bogus check to class of symfony css selector
Signed-off-by: Bastian Schwarz <bastian@repareo.de>
1 parent 1c04d14 commit edd6368

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"scripts": {
5151
"phpunit": "tools/phpunit.phar -c test/phpunit.dist.xml test/",
5252
"psalm": "tools/psalm --threads=10 --long-progress",
53-
"composer-unused": "tools/composer-unused --no-progress --no-interaction --excludePackage=symfony/css-selector",
53+
"composer-unused": "tools/composer-unused --no-progress --no-interaction",
5454
"composer-require-checker": "tools/composer-require-checker --no-interaction",
5555
"infection": "XDEBUG_MODE=coverage tools/infection --min-msi=100 --min-covered-msi=100 --threads=4 --no-progress --show-mutations run",
5656
"ci-all": [

src/CssSelector/SymfonyDomCrawlerAdapter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22
/*
3-
* Copyright 2023 Bastian Schwarz <bastian@codename-php.de>.
3+
* Copyright 2024 Bastian Schwarz <bastian@codename-php.de>.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
1717

1818
namespace de\codenamephp\deploymentchecks\http\CssSelector;
1919

20+
use Symfony\Component\CssSelector\CssSelectorConverter;
2021
use Symfony\Component\DomCrawler\Crawler;
2122

2223
/**
@@ -27,6 +28,6 @@
2728
public function __construct(public Crawler $crawler) {}
2829

2930
public function exists(string $selector) : bool {
30-
return $this->crawler->filter($selector)->count() > 0;
31+
return class_exists(CssSelectorConverter::class) && $this->crawler->filter($selector)->count() > 0;
3132
}
3233
}

0 commit comments

Comments
 (0)