for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Collections\Exception;
class ElementAlreadyExists extends Exception
{
public static function duplicatedElement($element)
if (!is_string($element)) {
$element = '';
}
return new static(sprintf("The element %s already exists", $element));