Deployer\Server\Environment::checkIfNameIsProtected PHP Метод

checkIfNameIsProtected() приватный Метод

Checks whether the given name was registered as protected, or if there is a protected parameter which would be overwritten.
private checkIfNameIsProtected ( string $name )
$name string
    private function checkIfNameIsProtected($name)
    {
        $length = strlen($name);
        foreach ($this->protectedNames as $protectedName) {
            $len = strlen($protectedName);
            if ($name === $protectedName) {
                throw new \RuntimeException("The parameter `{$name}` cannot be set, because it's protected.");
            } elseif ($len < $length && '.' === $name[$len] && 0 === strpos($name, $protectedName)) {
                throw new \RuntimeException("The parameter `{$name}` cannot be set, because `{$protectedName}` is protected.");
            } elseif ($len > $length && '.' === $protectedName[$length] && 0 === strpos($protectedName, $name)) {
                throw new \RuntimeException("The parameter `{$name}` could not be set, because a protected parameter named `{$protectedName}` already exists.");
            }
        }
    }