This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
17
{
18
/** @var ServiceLocator */
19
private $persisters;
20
21
9
public function __construct(ServiceLocator $persisters)
22
{
23
9
$this->persisters = $persisters;
24
9
}
25
26
/**
27
* @throws \InvalidArgumentException if no pager persister was registered for the given name
28
*/
29
4
public function getPagerPersister(string $name): PagerPersisterInterface
30
{
31
4
if (!$this->persisters->has($name)) {
32
1
throw new \InvalidArgumentException(\sprintf('No pager persister was registered for the give name "%s".', $name));
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.