for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the puli/discovery package.
*
* (c) Bernhard Schussek <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Puli\Discovery\Api\Type;
use Exception;
use RuntimeException;
/**
* Thrown when a duplicate binding type is detected.
* @since 1.0
* @author Bernhard Schussek <[email protected]>
class DuplicateTypeException extends RuntimeException
{
* Creates an exception for a type name.
* @param string $typeName The name of the type.
* @param Exception|null $cause The exception that caused this exception.
* @return static The created exception.
public static function forTypeName($typeName, Exception $cause = null)
return new static(sprintf(
'The type "%s" is already defined.',
$typeName
), 0, $cause);
}