2018-02-23 21:39:33 +01:00
|
|
|
<?php
|
2021-12-15 04:58:32 +01:00
|
|
|
|
2018-02-23 21:39:33 +01:00
|
|
|
namespace Psalm\Storage;
|
|
|
|
|
2022-01-20 23:33:06 +01:00
|
|
|
use Psalm\Type\Atomic;
|
2021-07-11 18:03:21 +02:00
|
|
|
|
2022-10-03 11:32:15 +02:00
|
|
|
/**
|
|
|
|
* @psalm-immutable
|
|
|
|
*/
|
2022-01-20 23:33:06 +01:00
|
|
|
abstract class Assertion
|
2018-02-23 21:39:33 +01:00
|
|
|
{
|
2022-10-03 11:32:15 +02:00
|
|
|
use ImmutableNonCloneableTrait;
|
|
|
|
|
2022-01-20 23:33:06 +01:00
|
|
|
abstract public function getNegation(): Assertion;
|
|
|
|
|
|
|
|
abstract public function isNegationOf(self $assertion): bool;
|
2018-02-23 21:39:33 +01:00
|
|
|
|
2022-01-20 23:33:06 +01:00
|
|
|
abstract public function __toString(): string;
|
2018-02-23 21:39:33 +01:00
|
|
|
|
2022-01-20 23:33:06 +01:00
|
|
|
public function isNegation(): bool
|
2018-02-23 21:39:33 +01:00
|
|
|
{
|
2022-01-20 23:33:06 +01:00
|
|
|
return false;
|
2018-02-23 21:39:33 +01:00
|
|
|
}
|
2019-01-23 05:42:54 +01:00
|
|
|
|
2022-01-20 23:33:06 +01:00
|
|
|
public function hasEquality(): bool
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2019-06-23 05:30:40 +02:00
|
|
|
|
2022-01-20 23:33:06 +01:00
|
|
|
public function getAtomicType(): ?Atomic
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2019-01-23 05:42:54 +01:00
|
|
|
|
2022-10-03 11:32:15 +02:00
|
|
|
/**
|
|
|
|
* @return static
|
|
|
|
*/
|
|
|
|
public function setAtomicType(Atomic $type): self
|
2022-01-20 23:33:06 +01:00
|
|
|
{
|
2022-10-03 11:32:15 +02:00
|
|
|
return $this;
|
2019-01-23 05:42:54 +01:00
|
|
|
}
|
2018-02-23 21:39:33 +01:00
|
|
|
}
|