Completed
Push — master ( 801ae3...f2d109 )
by Ítalo
04:18
created

ElementAlreadyExists   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A duplicatedElement() 0 8 2
1
<?php
2
3
namespace Collections\Exception;
4
5
class ElementAlreadyExists extends Exception
6
{
7
    public static function duplicatedElement($element)
8
    {
9
        if (!is_string($element)) {
10
            $element = '';
11
        }
12
13
        return new static(sprintf("The element %s already exists", $element));
14
    }
15
}
16