| @@ 139-145 (lines=7) @@ | ||
| 136 | * | |
| 137 | * @return ClassEnsurance | |
| 138 | */ | |
| 139 | public function isParentOf(string $class): ClassEnsurance | |
| 140 |     { | |
| 141 | $this->enforce(array_key_exists($this->class, class_parents($class, true))) | |
| 142 |              ->orThrow('"%s" is not a parent of "%s"', $this->class, $class); | |
| 143 | ||
| 144 | return $this; | |
| 145 | } | |
| 146 | ||
| 147 | /** | |
| 148 | * @param string $class | |
| @@ 152-158 (lines=7) @@ | ||
| 149 | * | |
| 150 | * @return ClassEnsurance | |
| 151 | */ | |
| 152 | public function isNotParentOf(string $class): ClassEnsurance | |
| 153 |     { | |
| 154 | $this->enforce(!array_key_exists($this->class, class_parents($class, true))) | |
| 155 |              ->orThrow('"%s" is a parent of "%s"', $this->class, $class); | |
| 156 | ||
| 157 | return $this; | |
| 158 | } | |
| 159 | ||
| 160 | /** | |
| 161 | * @param string $trait | |