![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/MarketplaceBundle/DTO/ |
<?php declare(strict_types=1); namespace Mautic\MarketplaceBundle\DTO; use Mautic\MarketplaceBundle\Collection\MaintainerCollection; use Mautic\MarketplaceBundle\Collection\VersionCollection; final class PackageDetail { public function __construct( public PackageBase $packageBase, public VersionCollection $versions, public MaintainerCollection $maintainers, public GitHubInfo $githubInfo, public int $monthlyDownloads, public int $dailyDownloads, public \DateTimeInterface $time ) { } public static function fromArray(array $array): self { return new self( new PackageBase( $array['name'], "https://packagist.org/packages/{$array['name']}", $array['repository'], $array['description'], (int) $array['downloads']['total'], (int) $array['favers'], $array['type'] ?? null, $array['display_name'] ?? null ), VersionCollection::fromArray($array['versions']), MaintainerCollection::fromArray($array['maintainers']), new GitHubInfo( $array['github_stars'], $array['github_watchers'], $array['github_forks'], $array['github_open_issues'] ), $array['downloads']['monthly'], $array['downloads']['daily'], new \DateTimeImmutable($array['time']) ); } }