summaryrefslogtreecommitdiff
path: root/src/Message/Welcome.php
blob: 8a121f4f37af4dcdea1cd8451234570c2677d289 (plain)
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
<?php

namespace App\Message;

use App\Message\Base;

/**
 * Welcome message
 *
 * @author Phil Burton <phil@pgburton.com>
 */
class Welcome extends Base
{
    /**
     * The list of vars we need to inject
     *
     * @var array
     */
    protected $injects = ['name', 'gameCode'];

    /**
     * The array of important vars
     *
     * @var string
     */
    protected $important = ['name', 'gameCode'];

    /**
     * Inject
     * @var string
     */
    public $name;

    /**
     * Second inject
     *
     * @var string
     */
    public $gameCode;

    /**
     * Construct to set any inject vars from functions if required
     *
     * @author Phil Burton <phil@pgburton.com>
     */
    public function __construct(Handler $handler)
    {
        $this->inject = $this->getInject();
        parent::__construct($handler);
    }

    /**
     * Get our inject value
     *
     * @author Phil Burton <phil@pgburton.com>
     * @return string
     */
    public function getInject()
    {
        return (string) time();
    }
}