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...
26
{
27
/**
28
* Creates an exception for a UUID that was not found.
29
*
30
* @param Uuid $uuid The UUID.
31
* @param Exception|null $cause The exception that caused this exception.
32
*
33
* @return static The created exception.
34
*/
35
4
public static function forUuid(Uuid $uuid, Exception $cause = null)
36
{
37
4
return new static(sprintf(
38
4
'The binding with UUID "%s" does not exist.',
39
4
$uuid->toString()
40
4
), 0, $cause);
41
}
42
43
/**
44
* Creates an exception for a UUID that was not found in a given module.
45
*
46
* @param Uuid $uuid The UUID.
47
* @param string $moduleName The name of the containing module.
48
* @param Exception|null $cause The exception that caused this
49
* exception.
50
*
51
* @return static The created exception.
52
*/
53
public static function forUuidAndModule(Uuid $uuid, $moduleName, Exception $cause = null)
54
{
55
return new static(sprintf(
56
'The binding with UUID "%s" does not exist in module "%s".',
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.