-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1.php
More file actions
31 lines (26 loc) · 717 Bytes
/
Copy path1.php
File metadata and controls
31 lines (26 loc) · 717 Bytes
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
<?php declare(strict_types = 1);
use function PHPStan\dumpPhpDocType;
use function PHPStan\dumpType;
use function PHPStan\Testing\assertType;
class UsersBuilder
{
public function buildUser(int $id, string $name, string $birthday): array
{
$result = [
'ID' => $id,
'Name' => $name,
'BirthDay' => new DateTimeImmutable($birthday),
];
return $result;
}
public function fetchUsers(): array
{
// 仮実装なので仮データを返す
$users = [];
$users[] = $this->buildUser(1, 'Miku', '2007-08-31');
$users[] = $this->buildUser(2, 'Rin', '2007-12-27');
$users[] = $this->buildUser(3, 'Len', '2007-12-27');
$users[] = $this->buildUser(4, 'Luka', '2009-01-30');
return $users;
}
}