-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScraperAdapter.php
More file actions
72 lines (67 loc) · 2.09 KB
/
ScraperAdapter.php
File metadata and controls
72 lines (67 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
declare(strict_types=1);
namespace BOA\Programs;
use BVP\Scraper\Scraper;
use Carbon\CarbonInterface;
/**
* @author shimomo
*/
final class ScraperAdapter implements ScraperInterface
{
/**
* @param \BVP\Scraper\Scraper $scraper
*/
public function __construct(private readonly Scraper $scraper)
{
//
}
/**
* @psalm-type ScrapedBoat = array{
* racer_boat_number: int,
* racer_name: string,
* racer_number: int,
* racer_class_number: int,
* racer_branch_number: int,
* racer_birthplace_number: int,
* racer_age: int,
* racer_weight: float,
* racer_flying_count: int,
* racer_late_count: int,
* racer_average_start_timing: float,
* racer_national_top_1_percent: float,
* racer_national_top_2_percent: float,
* racer_national_top_3_percent: float,
* racer_local_top_1_percent: float,
* racer_local_top_2_percent: float,
* racer_local_top_3_percent: float,
* racer_assigned_motor_number: int,
* racer_assigned_motor_top_2_percent: float,
* racer_assigned_motor_top_3_percent: float,
* racer_assigned_boat_number: int,
* racer_assigned_boat_top_2_percent: float,
* racer_assigned_boat_top_3_percent: float
* }
* @psalm-type ScrapedRace = array{
* race_date: string,
* race_stadium_number: int,
* race_number: int,
* race_closed_at: string,
* race_grade_number: int,
* race_title: string,
* race_subtitle: string,
* race_distance: int,
* boats: array<int, ScrapedBoat>
* }
* @psalm-type ScrapedRaces = array<int, ScrapedRace>
* @psalm-type ScrapedStadiumRaces = array<int, ScrapedRaces>
*
* @param \Carbon\CarbonInterface $date
* @return ScrapedStadiumRaces
*/
#[\Override]
public function scrapePrograms(CarbonInterface $date): array
{
/** @psalm-var ScrapedStadiumRaces */
return $this->scraper->scrapePrograms($date);
}
}