aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/scssphp/scssphp/src/Exception/SassScriptException.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-02-10 22:04:24 +0000
committerMario <mario@mariovavti.com>2024-02-10 22:04:24 +0000
commit7ccb2a261521cc826ff41d91cebbab504b7c4e11 (patch)
tree043d03fbad8f58352c75ae7e3fb6ae942edb64e9 /vendor/scssphp/scssphp/src/Exception/SassScriptException.php
parent067a66b9278e3c8ff2c624f38f2817715eb8a316 (diff)
downloadvolse-hubzilla-7ccb2a261521cc826ff41d91cebbab504b7c4e11.tar.gz
volse-hubzilla-7ccb2a261521cc826ff41d91cebbab504b7c4e11.tar.bz2
volse-hubzilla-7ccb2a261521cc826ff41d91cebbab504b7c4e11.zip
custom sass bootstrap builds for channels and site
Diffstat (limited to 'vendor/scssphp/scssphp/src/Exception/SassScriptException.php')
-rw-r--r--vendor/scssphp/scssphp/src/Exception/SassScriptException.php32
1 files changed, 32 insertions, 0 deletions
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);
+ }
+}