Created UpdateTagAction

This commit is contained in:
Alejandro Celaya
2017-07-15 12:04:12 +02:00
parent e07c464de8
commit 963d26f59b
7 changed files with 236 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace Shlinkio\Shlink\Core\Exception;
use Shlinkio\Shlink\Common\Exception\ExceptionInterface;
class EntityDoesNotExistException extends \RuntimeException implements ExceptionInterface
{
public static function createFromEntityAndConditions($entityName, array $conditions)
{
return new self(sprintf(
'Entity of type %s with params [%s] does not exist',
$entityName,
static::serializeParams($conditions)
));
}
private static function serializeParams(array $params)
{
$result = [];
foreach ($params as $key => $value) {
$result[] = sprintf('"%s" => "%s"', $key, $value);
}
return implode(', ', $result);
}
}