@@ 49-58 (lines=10) @@ | ||
46 | * |
|
47 | * @return DownloadStatistics |
|
48 | */ |
|
49 | public function getDownloadsLastWeek(string $packageName): DownloadStatistics |
|
50 | { |
|
51 | $package = new Package($packageName); |
|
52 | ||
53 | $resource = $this->repository->getResourceByPath( |
|
54 | '/downloads/point/last-week/' . $package |
|
55 | ); |
|
56 | ||
57 | return DownloadStatistics::fromJson($package, $resource); |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * @param string $packageName |
|
@@ 65-74 (lines=10) @@ | ||
62 | * |
|
63 | * @return DownloadStatistics |
|
64 | */ |
|
65 | public function getDownloadsLastMonth(string $packageName): DownloadStatistics |
|
66 | { |
|
67 | $package = new Package($packageName); |
|
68 | ||
69 | $resource = $this->repository->getResourceByPath( |
|
70 | '/downloads/point/last-month/' . $package |
|
71 | ); |
|
72 | ||
73 | return DownloadStatistics::fromJson($package, $resource); |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * @param string $packageName |
|
@@ 81-90 (lines=10) @@ | ||
78 | * |
|
79 | * @return DownloadStatistics |
|
80 | */ |
|
81 | public function getDownloadsLastYear(string $packageName): DownloadStatistics |
|
82 | { |
|
83 | $package = new Package($packageName); |
|
84 | ||
85 | $resource = $this->repository->getResourceByPath( |
|
86 | '/downloads/point/last-year/' . $package |
|
87 | ); |
|
88 | ||
89 | return DownloadStatistics::fromJson($package, $resource); |
|
90 | } |
|
91 | ||
92 | /** |
|
93 | * @param string $packageName |