70 protected function __construct($typeName, $flags, $allowsCovariance, $allowsContravariance)
72 $this->typeName = $typeName !==
null
76 $this->isNullable = (bool)($flags & self::NULLABLE);
77 $this->isByReference = (bool)($flags & self::REFERENCE);
78 $this->isWeak = (bool)($flags & self::WEAK);
79 $this->allowsCovariance = (bool)$allowsCovariance;
80 $this->allowsContravariance = (bool)$allowsContravariance;
94 if ($byReference xor $this->isByReference) {
99 if ($typeName === $this->typeName && $nullable === $this->isNullable) {
104 if ($this->allowsCovariance
105 &&
MatchTester::isMatch($this->typeName, $this->isNullable, $typeName, $nullable, $this->isWeak)) {
110 if ($this->allowsContravariance
111 &&
MatchTester::isMatch($typeName, $nullable, $this->typeName, $this->isNullable, $this->isWeak)) {
117 && $nullable === $this->isNullable
118 && $typeName !==
null
119 && $this->typeName !==
null