Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of PHPUnit.
4
 *
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PHPUnit\Framework\MockObject;
11
 
12
use function array_diff_assoc;
13
use function array_unique;
14
use function implode;
15
use function sprintf;
16
 
17
/**
18
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
19
 */
20
final class DuplicateMethodException extends \PHPUnit\Framework\Exception implements Exception
21
{
22
    /**
23
     * @psalm-param list<string> $methods
24
     */
25
    public function __construct(array $methods)
26
    {
27
        parent::__construct(
28
            sprintf(
29
                'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")',
30
                implode(', ', $methods),
31
                implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods))))
32
            )
33
        );
34
    }
35
}