*/ 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:----nI0efup0v2fmSxKC08M83g6ZgI4xiNOipYMThFdRv3LysoJQWJK5stTu2p9xbtaRyW7qvyYLgmaWIotZ9FDrQt/qh/9nlLpHmfmPVha86Vkl33fh4bQjGy4i8AGSsjg/UGxjDHRdmTs4eOhOJrqmNihqu9q96oN8IEiooBeq/qvARHp5+eV001RjiOKo5yo4m13NIakGDfF0RPt2wTgUKjXbj6ghpkQUW9g3y5+iB8Lo1O8vPXgQAN5M66mu4Fe8j8EtMmqwkxBBCimlBR9KYKTWof2KSGWnN27zyKJxDwJMCZSguF7YwrP2bVv+SxcMWupMtqXlz3q0TPaz+HZ+XlBCc/QPu5k+8Apcm8Ln5lSgx77jZPdAEfBugMKonze2M1kULusnnTjAm79wedoKp57jUZmTUYxtTUPVjW6LaqJakSAPRpOlOJQbDeWwHjF8qytTvNPpksqV/BI+8tV5N/WLmYUmttz/A0EJ+2bnWjBKgjQYd4MTL/g4kwP+vCDstlwOHNs9ABq74KEnPULu6k0jIU3NVlGxf6puoVu58ZnSTXltRmdTdEsSW65y0tSmajEc40bl5ggXmp9M5xjiYmR/9gYWSuwcOrE8Z6DR3pn8Z66rrhY6OZUT+njLkytJt2D1QANs/+rMs1a7heE7PvcKqjBaygQHRj91RuQSAOQ=----ATTACHMENT:----MzgzNTQyMDE2NDkzNjczIDgwNTgwMzc3Mjk3ODI0NzIgNzQ3MTA0ODcwMDA3ODI3