Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trim() expects parameter 1 to be string, boolean given (0) #192

Open
vaajnur opened this issue Dec 2, 2022 · 3 comments
Open

trim() expects parameter 1 to be string, boolean given (0) #192

vaajnur opened this issue Dec 2, 2022 · 3 comments

Comments

@vaajnur
Copy link

vaajnur commented Dec 2, 2022

[TypeError]
trim() expects parameter 1 to be string, boolean given (0)
/vendor/imangazaliev/didom/src/DiDom/Query.php:108
#0: trim(boolean)
/vendor/imangazaliev/didom/src/DiDom/Query.php:108
#1: DiDom\Query::parseAndConvertSelector(string, string)
/vendor/imangazaliev/didom/src/DiDom/Query.php:74
#2: DiDom\Query::cssToXpath(string)
/vendor/imangazaliev/didom/src/DiDom/Query.php:53
#3: DiDom\Query::compile(string, string)
/vendor/imangazaliev/didom/src/DiDom/Document.php:402
#4: DiDom\Document->find(string)

@vaajnur
Copy link
Author

vaajnur commented Dec 2, 2022

решается declare(strict_types = 0); но только в самой библиотеке
такое решение не подходит

@Imangazaliev
Copy link
Owner

Видимо, вы указали некорректный селектор. Можете показать его?

@staixe
Copy link

staixe commented Mar 25, 2024

Такая же ошибка
пример кода
`
$test = '<p class="test">Привет</p>';

$doc = new \DiDom\Document($test);

$objDoc = $doc->find('.test');

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants