/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Notifier/Test/Constraint/NotificationSubjectContains.php
47 строк
1 KB
Alexander M. Turek
Prefix all sprintf() calls
20 июн 2024, 18:52
20 июн 2024, 18:52
6ce530c
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Notifier\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\Notifier\Message\MessageInterface; /** * @author Smaïne Milianni <smaine.milianni@gmail.com> */ final class NotificationSubjectContains extends Constraint { public function __construct( private string $expectedText, ) { } public function toString(): string { return \sprintf('contains "%s"', $this->expectedText); } /** * @param MessageInterface $message */ protected function matches($message): bool { return false !== mb_strpos($message->getSubject(), $this->expectedText); } /** * @param MessageInterface $message */ protected function failureDescription($message): string { return 'the Notification subject '.$this->toString(); } }