PocketMine-MP 5.42.2 git-40e2639b20bdc4ddba49d9f7f5fa0d5e92aa266f
Loading...
Searching...
No Matches
ReturnInfo.php
1<?php declare(strict_types=1);
2
3namespace DaveRandom\CallbackValidator;
4
6
7final class ReturnInfo{
8 public function __construct(
9 public readonly ?BaseType $type,
10 public readonly bool $byReference = false
11 ){}
12
13 public function isSatisfiedBy(ReturnInfo $other) : bool{
14 return $this->byReference === $other->byReference && MatchTester::isCovariant($this->type, $other->type);
15 }
16
20 public function __toString(){
21 return $this->type?->stringify() ?? '';
22 }
23}