diff options
Diffstat (limited to 'vendor/scssphp/scssphp/src/Exception')
6 files changed, 171 insertions, 0 deletions
diff --git a/vendor/scssphp/scssphp/src/Exception/CompilerException.php b/vendor/scssphp/scssphp/src/Exception/CompilerException.php new file mode 100644 index 000000000..0b00cf525 --- /dev/null +++ b/vendor/scssphp/scssphp/src/Exception/CompilerException.php @@ -0,0 +1,24 @@ +<?php + +/** + * SCSSPHP + * + * @copyright 2012-2020 Leaf Corcoran + * + * @license http://opensource.org/licenses/MIT MIT + * + * @link http://scssphp.github.io/scssphp + */ + +namespace ScssPhp\ScssPhp\Exception; + +/** + * Compiler exception + * + * @author Oleksandr Savchenko <traveltino@gmail.com> + * + * @internal + */ +class CompilerException extends \Exception implements SassException +{ +} diff --git a/vendor/scssphp/scssphp/src/Exception/ParserException.php b/vendor/scssphp/scssphp/src/Exception/ParserException.php new file mode 100644 index 000000000..f0726698f --- /dev/null +++ b/vendor/scssphp/scssphp/src/Exception/ParserException.php @@ -0,0 +1,58 @@ +<?php + +/** + * SCSSPHP + * + * @copyright 2012-2020 Leaf Corcoran + * + * @license http://opensource.org/licenses/MIT MIT + * + * @link http://scssphp.github.io/scssphp + */ + +namespace ScssPhp\ScssPhp\Exception; + +/** + * Parser Exception + * + * @author Oleksandr Savchenko <traveltino@gmail.com> + * + * @internal + */ +class ParserException extends \Exception implements SassException +{ + /** + * @var array|null + * @phpstan-var array{string, int, int}|null + */ + private $sourcePosition; + + /** + * Get source position + * + * @api + * + * @return array|null + * @phpstan-return array{string, int, int}|null + */ + public function getSourcePosition() + { + return $this->sourcePosition; + } + + /** + * Set source position + * + * @api + * + * @param array $sourcePosition + * + * @return void + * + * @phpstan-param array{string, int, int} $sourcePosition + */ + public function setSourcePosition($sourcePosition) + { + $this->sourcePosition = $sourcePosition; + } +} diff --git a/vendor/scssphp/scssphp/src/Exception/RangeException.php b/vendor/scssphp/scssphp/src/Exception/RangeException.php new file mode 100644 index 000000000..4be4dee70 --- /dev/null +++ b/vendor/scssphp/scssphp/src/Exception/RangeException.php @@ -0,0 +1,24 @@ +<?php + +/** + * SCSSPHP + * + * @copyright 2012-2020 Leaf Corcoran + * + * @license http://opensource.org/licenses/MIT MIT + * + * @link http://scssphp.github.io/scssphp + */ + +namespace ScssPhp\ScssPhp\Exception; + +/** + * Range exception + * + * @author Anthon Pang <anthon.pang@gmail.com> + * + * @internal + */ +class RangeException extends \Exception implements SassException +{ +} diff --git a/vendor/scssphp/scssphp/src/Exception/SassException.php b/vendor/scssphp/scssphp/src/Exception/SassException.php new file mode 100644 index 000000000..9f62b3cd2 --- /dev/null +++ b/vendor/scssphp/scssphp/src/Exception/SassException.php @@ -0,0 +1,7 @@ +<?php + +namespace ScssPhp\ScssPhp\Exception; + +interface SassException +{ +} diff --git a/vendor/scssphp/scssphp/src/Exception/SassScriptException.php b/vendor/scssphp/scssphp/src/Exception/SassScriptException.php new file mode 100644 index 000000000..19356a7a1 --- /dev/null +++ b/vendor/scssphp/scssphp/src/Exception/SassScriptException.php @@ -0,0 +1,32 @@ +<?php + +namespace ScssPhp\ScssPhp\Exception; + +/** + * An exception thrown by SassScript. + * + * This class does not implement SassException on purpose, as it should + * never be returned to the outside code. The compilation will catch it + * and replace it with a SassException reporting the location of the + * error. + */ +class SassScriptException extends \Exception +{ + /** + * Creates a SassScriptException with support for an argument name. + * + * This helper ensures a consistent handling of argument names in the + * error message, without duplicating it. + * + * @param string $message + * @param string|null $name The argument name, without $ + * + * @return SassScriptException + */ + public static function forArgument($message, $name = null) + { + $varDisplay = !\is_null($name) ? "\${$name}: " : ''; + + return new self($varDisplay . $message); + } +} diff --git a/vendor/scssphp/scssphp/src/Exception/ServerException.php b/vendor/scssphp/scssphp/src/Exception/ServerException.php new file mode 100644 index 000000000..e593c4014 --- /dev/null +++ b/vendor/scssphp/scssphp/src/Exception/ServerException.php @@ -0,0 +1,26 @@ +<?php + +/** + * SCSSPHP + * + * @copyright 2012-2020 Leaf Corcoran + * + * @license http://opensource.org/licenses/MIT MIT + * + * @link http://scssphp.github.io/scssphp + */ + +namespace ScssPhp\ScssPhp\Exception; + +@trigger_error(sprintf('The "%s" class is deprecated.', ServerException::class), E_USER_DEPRECATED); + +/** + * Server Exception + * + * @author Anthon Pang <anthon.pang@gmail.com> + * + * @deprecated The Scssphp server should define its own exception instead. + */ +class ServerException extends \Exception implements SassException +{ +} |