LocalDoorsRepository.php 1.29 KB
Newer Older
1
2
3
4
5
<?php


namespace Source\Gateways\Doors;

6
use Carbon\Carbon;
7
use Source\Entities\Door;
8
use Source\Entities\HashedSearchable;
9

Jacob Priddy's avatar
Jacob Priddy committed
10
11
12
class LocalDoorsRepository extends InMemoryDoorsRepository
{
    public function __construct()
13
14
15
16
17
18
19
20
21
    {
        $this->doors[] = static::getAmazonDoor();
        $this->doors[] = static::getTheBatCave();
    }

    /**
     * @return \Source\Entities\Door
     */
    public static function getAmazonDoor(): Door
Jacob Priddy's avatar
Jacob Priddy committed
22
    {
23
        $salt = config('app.key');
24
25
26
27
28

        return new Door(
            1,
            'The Amazon',
            'chicken izta door',
29
            HashedSearchable::hash($salt, 'door_1_api_token'),
30
31
            true,
            'Administrative note for this door',
32
33
34
            'door version here',
            null,
            null,
35
            Carbon::now()->subHour()
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        );
    }

    /**
     * @return \Source\Entities\Door
     */
    public static function getTheBatCave(): Door
    {
        $salt = config('app.key');

        return new Door(
            2,
            'Bat Cave',
            'Bruce\' lair',
50
            HashedSearchable::hash($salt, 'door_2_api_token'),
51
52
            false,
            'Mac address: 00:1A:C2:7B:00:47. Hidden door.',
53
54
55
56
            null,
            null,
            null,
            Carbon::now()->subWeek()
57
        );
58
59
    }
}