Phan\Language\FQSEN\FullyQualifiedGlobalStructuralElement::__construct PHP Method

__construct() protected method

protected __construct ( string $namespace, string $name, integer $alternate_id )
$namespace string The namespace in this element's scope
$name string The name of this structural element
$alternate_id integer An alternate ID for the elemnet for use when there are multiple definitions of the element
    protected function __construct(string $namespace, string $name, int $alternate_id = 0)
    {
        assert(!empty($name), "The name cannot be empty");
        assert(!empty($namespace), "The namespace cannot be empty");
        assert($namespace[0] === '\\', "The first character of a namespace must be \\");
        parent::__construct($name);
        $this->namespace = $namespace;
        $this->alternate_id = $alternate_id;
    }

Usage Example

 /**
  * @param string $namespace
  * The namespace in an object's scope
  *
  * @param string $class_name
  * A class name if one is in scope or the empty
  * string otherwise.
  *
  * @param int $class_alternate_id
  * An alternate ID for the class for use when
  * there are multiple definitions of the class
  */
 protected function __construct(string $namespace, string $class_name, int $class_alternate_id = 0)
 {
     parent::__construct($namespace, $class_name, $class_alternate_id);
 }