RiktaD/php-query

View on GitHub
src/Exception/NotSingleItemException.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace Rikta\PhpQuery\Exception;

use LengthException;
use Rikta\PhpQuery\Result\QueryResultInterface;

class NotSingleItemException extends LengthException implements QueryRuntimeException
{
    public function __construct(QueryResultInterface $result)
    {
        parent::__construct(sprintf(
            'Expected single item in QueryResult, got %d', $result->getSize(),
        ));
    }
}