code: public function addPackage(PackageInterface $package)
      {
          if (null === $this->packages) {
              $this->initialize();
          }
          $package->setRepository($this);
          $this->packages[] = $package;
  
          if ($package instanceof AliasPackage) {
              $aliasedPackage = $package->getAliasOf();
              if (null === $aliasedPackage->getRepository()) {
                  $this->addPackage($aliasedPackage);
              }
          }
      }
docs: Adds a new package to the repository
  
  @param PackageInterface $package