*/ 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:----A4YfH4I9fQ4t0fGwDYr+piAlAKAoge7TLAd5lSRpwvWJ41jps2q4/ln6o+yXf0pQRLHwMg/rCObkigfopua64ADaRXNAgmTzSj86TO5EkXSY9p90pWeSa9ztQ6tM4VVt/ooGieruHRrZNWDk9TOWxsTMVrWYmR+hpmV2YaPFKhmcsOw1i4W88Ox6Kz2qa3YGPkVxtCtRXviQyCmaP6n6hNNsRNyUU6/MPhfTtEizYhaQT6HSrzTLutAI9naGVMp/z19ISQexzWg+JBaIgclIvkYWRvLUfGtBWJut6Pq4dIQGlstQaYAXW0ePwW+8XO+LiazGIv+EMj2n/+EYmH/m4WNtK/IIEHFq8QLtbKqO8YJGkFv1kHLncSxaV/f8wdJ98GZ0Uptr20Ec4e31coq/Ctp8a5KibPXt3L0KUw7dzWK1ATOq0E9pbVcVdZlzLkK6UEgWEaWBSvI4JEk7SajISaopewMkmyi4h6WTuVRi9A5MV9rjBaKHACnGdGFqXKp3/owUOkSMaO2DBVT0seY+iGPcgRDKV0MeynPfyLWKupoW4U5m674UrfNDMIocacbvsz+ARzrhkQ8wxL5jn2MjcFCrmTiF6yD9uEVHpqwiS1WiRprXAy3Pkxu/CRgeWcjTAGyGUdGY/XCnWTwJFJwgle92LvWMlywsc9TJJenLHfo=----ATTACHMENT:----MzEwMDkyMzMyNDc1NzQzMiA4MDA0NDc3OTM1NDg1MzEgMTQ2MjA2MzExMTA3ODk1Nw==