new files
This commit is contained in:
42
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/DirectoryDoesNotExist.php
vendored
Normal file
42
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/DirectoryDoesNotExist.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2017-2022 Andreas Möller
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE.md file that was distributed with this source code.
|
||||
*
|
||||
* @see https://github.com/ergebnis/classy
|
||||
*/
|
||||
|
||||
namespace Ergebnis\Classy\Exception;
|
||||
|
||||
final class DirectoryDoesNotExist extends \InvalidArgumentException implements ExceptionInterface
|
||||
{
|
||||
private string $directory = '';
|
||||
|
||||
/**
|
||||
* Returns a new exception from a directory.
|
||||
*/
|
||||
public static function fromDirectory(string $directory): self
|
||||
{
|
||||
$exception = new self(\sprintf(
|
||||
'Directory "%s" does not exist.',
|
||||
$directory,
|
||||
));
|
||||
|
||||
$exception->directory = $directory;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the directory.
|
||||
*/
|
||||
public function directory(): string
|
||||
{
|
||||
return $this->directory;
|
||||
}
|
||||
}
|
||||
18
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/ExceptionInterface.php
vendored
Normal file
18
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/ExceptionInterface.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2017-2022 Andreas Möller
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE.md file that was distributed with this source code.
|
||||
*
|
||||
* @see https://github.com/ergebnis/classy
|
||||
*/
|
||||
|
||||
namespace Ergebnis\Classy\Exception;
|
||||
|
||||
interface ExceptionInterface extends \Throwable
|
||||
{
|
||||
}
|
||||
57
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/MultipleDefinitionsFound.php
vendored
Normal file
57
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/MultipleDefinitionsFound.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2017-2022 Andreas Möller
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE.md file that was distributed with this source code.
|
||||
*
|
||||
* @see https://github.com/ergebnis/classy
|
||||
*/
|
||||
|
||||
namespace Ergebnis\Classy\Exception;
|
||||
|
||||
use Ergebnis\Classy\Construct;
|
||||
|
||||
final class MultipleDefinitionsFound extends \RuntimeException implements ExceptionInterface
|
||||
{
|
||||
/**
|
||||
* @var array<int, Construct>
|
||||
*/
|
||||
private array $constructs = [];
|
||||
|
||||
/**
|
||||
* Returns a new exception from constructs.
|
||||
*
|
||||
* @param array<int, Construct> $constructs
|
||||
*/
|
||||
public static function fromConstructs(array $constructs): self
|
||||
{
|
||||
$exception = new self(\sprintf(
|
||||
"Multiple definitions have been found for the following constructs:\n\n%s",
|
||||
\implode("\n", \array_map(static function (Construct $construct): string {
|
||||
return \sprintf(
|
||||
' - "%s" defined in "%s"',
|
||||
$construct->name(),
|
||||
\implode('", "', $construct->fileNames()),
|
||||
);
|
||||
}, $constructs)),
|
||||
));
|
||||
|
||||
$exception->constructs = $constructs;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of constructs.
|
||||
*
|
||||
* @return array<int, Construct>
|
||||
*/
|
||||
public function constructs(): array
|
||||
{
|
||||
return $this->constructs;
|
||||
}
|
||||
}
|
||||
41
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/ParseError.php
vendored
Normal file
41
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/ParseError.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2017-2022 Andreas Möller
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE.md file that was distributed with this source code.
|
||||
*
|
||||
* @see https://github.com/ergebnis/classy
|
||||
*/
|
||||
|
||||
namespace Ergebnis\Classy\Exception;
|
||||
|
||||
final class ParseError extends \ParseError implements ExceptionInterface
|
||||
{
|
||||
public static function fromParseError(\ParseError $exception): self
|
||||
{
|
||||
return new self(
|
||||
$exception->getMessage(),
|
||||
0,
|
||||
$exception,
|
||||
);
|
||||
}
|
||||
|
||||
public static function fromFileNameAndParseError(
|
||||
string $fileName,
|
||||
\ParseError $exception,
|
||||
): self {
|
||||
return new self(
|
||||
\sprintf(
|
||||
'A parse error occurred when parsing "%s": "%s".',
|
||||
$fileName,
|
||||
$exception->getMessage(),
|
||||
),
|
||||
0,
|
||||
$exception,
|
||||
);
|
||||
}
|
||||
}
|
||||
22
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/ShouldNotHappen.php
vendored
Normal file
22
pro_v3.5.1/vendor/ergebnis/classy/src/Exception/ShouldNotHappen.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2017-2022 Andreas Möller
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE.md file that was distributed with this source code.
|
||||
*
|
||||
* @see https://github.com/ergebnis/classy
|
||||
*/
|
||||
|
||||
namespace Ergebnis\Classy\Exception;
|
||||
|
||||
final class ShouldNotHappen extends \LogicException implements ExceptionInterface
|
||||
{
|
||||
public static function create(): self
|
||||
{
|
||||
return new self('This should not happen.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user