Example #1
0
 /**
  * Constructor.
  *
  * @param string             $name
  * @param string             $type
  * @param PackageInterface   $package
  * @param Link               $link
  * @param Dependency[]|false $children
  */
 public function __construct($name, $type, PackageInterface $package, Link $link, $children)
 {
     $this->name = $name;
     $this->type = $type;
     $this->package = $package;
     $this->link = $link;
     $this->setChildren($children);
     $this->relationship = (new DependencyRelationship())->setSourceName($package->getPrettyName())->setSourceVersion($package->getPrettyVersion())->setTargetName($link->getTarget())->setTargetVersion($link->getPrettyConstraint())->setReason($link->getDescription());
 }