Add a variable name for an exception

@param string|array $path Variable name
486640
public function setException($path) {
        $pathException = (!is_array($path)) ? array($path) : $path;
        $this->exceptions = array_merge($this->exceptions, $pathException);
    }
272254
public function setBasePath($path)
    {
        if (!is_dir($path)) {
            throw new \Exception("Base path for views is not a directory: " . $path);
        }
        $this->path = rtrim($path, '/') . '/';
    }
1320819
private function checkPaths($path, array $paths)
    {
        $reserved = [
            '?' => '\?',
            '.' => '\.',
            '*' => '.*',
            '+' => '\+',
            '(' => '\(',
            ')' => '\)',
            '[' => '\[',
            ']' => '\]',
        ];
        $errorHandler = new ErrorHandler();
        set_error_handler([$errorHandler, 'callback'], E_NOTICE | E_WARNING);
        foreach ($paths as $rule) {
            $escaped = str_replace(array_keys($reserved), array_values($reserved), $rule);
            if (preg_match('#^' . $escaped . '#', $path) === 1) {
                restore_error_handler();
                return mb_strlen($rule);
            }
        }
        restore_error_handler();
        return false;
    }
557639
public function writePath(array $path) {
        try {
            $this->writeShort(count($path));
            foreach ($path as $p) {
                $this->writeShort($p);
            }
        } catch (BinaryStreamAccessException $e) {
            $msg = "An error occured while writing the path.";
    		throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::PATH, $e);
        }
    }
215303
public  function addClassPath($path) {
        if(!is_array($path)) {
            $path = array($path);
        }
        foreach($path as $item) {
            $this->classPaths[] = $item;
        }
    }
1025835
public function addFolder(string $path)
    {
        if (!\is_dir($path)) {
            throw new \RuntimeException(\sprintf('The path "%s" does not exist or is not a directory.', $path));
        }
        $this->paths[] = $path;
    }
1132062
public function addVariable(Variable $variable) {
        $variables = $this->getVariables();
        $key = $variable->getName();
        if(array_key_exists($key, $variables)) {
            throw new \Exception('A Variable with the name of: ' . $variable->getName() . ' already exists');
        }
        $variables[$key] = $variable;
        ksort($variables);
        $this->setVariables($variables);
    }
1007742
public function setPath(string $path) : void
    {
        if (!is_writable($path)) {
            throw new Exception("The path to the cache is not writable.");
        }

        $this->cachePath = $path;
    }
590718
public function add_path(string $path)
    {
        $path = \trailingslashit($path);
        $this->paths[] = $path;
        $this->parse_files($path);
    }
1346163
public function addTreeToZip($zip, $path)
    {
        $path = rtrim($path, '/');
        if ($this->folderExists('', $path)) {
            $files = $this->adapter->listContents($path);
            if (empty($files)) {
                $newPath = str_replace(DIRECTORY_SEPARATOR, '/', $path);
                if (!$zip->addEmptyDir($newPath)) {
                    throw new \Exception("Can not include folder '$newPath' in zip file.");
                }

                return;
            }
            foreach ($files as $file) {
                if ($file['type'] === 'dir') {
                    static::addTreeToZip($zip, $file['path']);
                } elseif ($file['type'] === 'file') {
                    $newPath = str_replace(DIRECTORY_SEPARATOR, '/', $file['path']);
                    $fileObj = $this->adapter->read($newPath);
                    if (!empty($fileObj) && isset($fileObj['contents'])) {
                        if (!$zip->addFromString($file['path'], $fileObj['contents'])) {
                            throw new \Exception("Can not include file '$newPath' in zip file.");
                        }
                    } else {
                        throw new InternalServerErrorException("Could not read file '" . $file . "'");
                    }
                }
            }
        }
    }
1099639
public function setPath($path)
    {
        // clear out the prior search dirs
        $this->configList[self::TPL_PATH_LIST] = [];
        // always add the fallback directories as last resort
        $this->addPath('.');
        // actually add the user-specified directory
        $this->addPath($path);
    }
796236
function addPath($path, $prepend = false)
    {
        $this->write(tap($this->read(), function (&$config) use ($path, $prepend) {
            $method = $prepend ? 'prepend' : 'push';

            $config['paths'] = collect($config['paths'])->{$method}($path)->unique()->all();
        }));
    }
1294527
public function add(string $path, array $values): void
    {
        $get = (array)$this->get($path);
        $this->set($path, $this->arrayMergeRecursiveDistinct($get, $values));
    }
159091
public static function add($key, $path)
    {
        self::$_registeredNamespaces[$key] = true;
        self::$_options['loader']->addPsr4($key, $path);
    }
796828
public function addCommands($path)
	{
		if(($commands=$this->findCommands($path))!==array())
		{
			foreach($commands as $name=>$file)
			{
				if(!isset($this->commands[$name]))
					$this->commands[$name]=$file;
			}
		}
	}
328209
public function publish(string $path)
    {
        if (!is_dir($path)) {
            throw new \Exception("Bad path ($path)");
        }
        $this->recurseCopy($path, base_path('public/'));
    }
29151
public function setPath($path)
    {
        if ($this->isReference()) {
            throw $this->tooManyAttributes();
        }
        $this->createPathElement()->setPath($path);
    }