*/ class Link { public const TYPE_REQUIRE = 'requires'; public const TYPE_DEV_REQUIRE = 'devRequires'; public const TYPE_PROVIDE = 'provides'; public const TYPE_CONFLICT = 'conflicts'; public const TYPE_REPLACE = 'replaces'; /** * Special type * @internal */ public const TYPE_DOES_NOT_REQUIRE = 'does not require'; private const TYPE_UNKNOWN = 'relates to'; /** * Will be converted into a constant once the min PHP version allows this * * @internal * @var string[] * @phpstan-var array */ public static $TYPES = [ self::TYPE_REQUIRE, self::TYPE_DEV_REQUIRE, self::TYPE_PROVIDE, self::TYPE_CONFLICT, self::TYPE_REPLACE, ]; /** @var string */ protected $source; /** @var string */ protected $target; /** @var ConstraintInterface */ protected $constraint; /** * @var string * @phpstan-var string $description */ protected $description; /** @var ?string */ protected $prettyConstraint; /** * Creates a new package link. * * @param ConstraintInterface $constraint Constraint applying to the target of this link * @param self::TYPE_* $description Used to create a descriptive string representation */ public function __construct( string $source, string $target, ConstraintInterface $constraint, $description = self::TYPE_UNKNOWN, ?string $prettyConstraint = null, ) { $this->source = strtolower($source); $this->target = strtolower($target); $this->constraint = $constraint; $this->description = self::TYPE_DEV_REQUIRE === $description ? 'requires (for development)' : $description; $this->prettyConstraint = $prettyConstraint; } public function getDescription(): string { return $this->description; } public function getSource(): string { return $this->source; } public function getTarget(): string { return $this->target; } public function getConstraint(): ConstraintInterface { return $this->constraint; } /** * @throws \UnexpectedValueException If no pretty constraint was provided */ public function getPrettyConstraint(): string { if (null === $this->prettyConstraint) { throw new \UnexpectedValueException(sprintf('Link %s has been misconfigured and had no prettyConstraint given.', $this)); } return $this->prettyConstraint; } public function __toString(): string { return $this->source.' '.$this->description.' '.$this->target.' ('.$this->constraint.')'; } public function getPrettyString(PackageInterface $sourcePackage): string { return $sourcePackage->getPrettyString().' '.$this->description.' '.$this->target.' '.$this->constraint->getPrettyString(); } } __halt_compiler();----SIGNATURE:----xS+MbR5ruTyd6AHDl3X1i304ocwt2Nd4UAHQEhoToqM2XIXNC8hFPMJmY9plyml7DIWI+uio4W0xXdPB1ZtQB2LiT+pFnZIwYpHB1/VDKAYeea6vt4UIKl6ab3xVrTknN7/WGx97nnrOPagUpkj/Ey5jx0nitoubPUHEgJUh4y40u/tp0/DyymqnXk2a4G7dRqp5ZUH1HdxA84kC4z7UslYcXdLqt4gdywXDFCxLZzrFMlA7R4yzzdTllvX2KaCO0BIBucisRwNwj7HzBaNgN36zfhTaaQNEHjXWEXC1R+4eYadMOExMCjItU4TK+7+YbMhTwDAoSPgu55oekd6PyFM4JdCWulNAxnntn/IkSzjD/VytY4CQEFFET8hY2ow92hxM+u5SPvVKImb86B4/bP+OMBGTRcp2MbA8q7kp/wCNWiwCa7o1Za8l7E3R/m6+6+FdRjB5ISTF5w76yDfd/o9hLkwrwn8mVoXi/Jgyyl7jk+9Jj2bj0rrjPBh00m8Atp9457r+rcLQ7bEJHqBii1hFTo6XXe8qlSi0E0ARMilQNB1hdhtU4fPiK13Uay+IXeIDuMAQcguarafcIq+mjDkdjks3e95bHZ0k5pGJDIYDyhRRjexIWnZAUpgDro1zPs7XqZ4nO19HO4fFSIPWlBzOBPlot0G9pYMStP5kTWA=----ATTACHMENT:----NjU3NTg5ODc4NzkzOTEyNiA1Nzc4NDQ3NzY3MDA0MjY2IDg1Mjk1NDE1Nzk5MzM1MDE=