This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace Gaufrette\Exception;
use Gaufrette\Exception;
/**
* Exception to be thrown when a file already exists.
*
* @author Benjamin Dulau <benjamin.dulau@gmail.com>
*/
class FileAlreadyExists extends \RuntimeException implements Exception
{
private $key;
public function __construct($key, $code = 0, \Exception $previous = null)
{
$this->key = $key;
parent::__construct(
sprintf('The file %s already exists and can not be overwritten.', $key),
$code,
$previous
);
}
public function getKey()
{
return $this->key;
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Gaufrette\Exception;
use Gaufrette\Exception;
/**
* Exception to be thrown when a file was not found.
*
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class FileNotFound extends \RuntimeException implements Exception
{
private $key;
public function __construct($key, $code = 0, \Exception $previous = null)
{
$this->key = $key;
parent::__construct(
sprintf('The file "%s" was not found.', $key),
$code,
$previous
);
}
public function getKey()
{
return $this->key;
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Gaufrette\Exception;
use Gaufrette\Exception;
/**
* Exception to be thrown when an unexpected file exists.
*
* @author Antoine Hérault <antoine.herault@gmail.com>
*/
class UnexpectedFile extends \RuntimeException implements Exception
{
private $key;
public function __construct($key, $code = 0, \Exception $previous = null)
{
$this->key = $key;
parent::__construct(
sprintf('The file "%s" was not supposed to exist.', $key),
$code,
$previous
);
}
public function getKey()
{
return $this->key;
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace Gaufrette\Exception;
use Gaufrette\Exception;
class UnsupportedAdapterMethodException extends \BadMethodCallException implements Exception
{
}