protected function assignProperty($name, $value)
    {
        if (!empty($this->propertyTypes[$name]) && $value !== null) {
            if (!($value instanceof $this->propertyTypes[$name])) {
                throw new Exception(
                    sprintf("You can't put an instance of %s in the parameter $%s of type %s",
                        get_class($value), $name, $this->propertyTypes[$name]
                    )
                );
            }
        }
        if ($this->frozen && in_array($name, $this->restrictedProperties)) {
            throw new Exception(
                sprintf("You can't change the protected or private parameter $%s of type %s",
                    $name, !empty($this->propertyTypes[$name]) ? $this->propertyTypes[$name] : "scalar"
                )
            );
        }
        $this->$name = $value;
    }