Code Duplication    Length = 37-40 lines in 2 locations

src/wormling/phparia/Events/PeerStatusChange.php 1 location

@@ 30-69 (lines=40) @@
27
 *
28
 * @author Brian Smith <[email protected]>
29
 */
30
class PeerStatusChange extends Event
31
{
32
    /**
33
     * @var Endpoint
34
     */
35
    private $endpoint;
36
37
    /**
38
     * @var Peer
39
     */
40
    private $peer;
41
42
    /**
43
     * @return Endpoint
44
     */
45
    public function getEndpoint()
46
    {
47
        return $this->endpoint;
48
    }
49
50
    /**
51
     * @return Peer
52
     */
53
    public function getPeer()
54
    {
55
        return $this->peer;
56
    }
57
58
    /**
59
     * @param AriClient $client
60
     * @param string $response
61
     */
62
    public function __construct(AriClient $client, $response)
63
    {
64
        parent::__construct($client, $response);
65
66
        $this->endpoint = $this->getResponseValue('endpoint', '\phparia\Resources\Endpoint', $client);
67
        $this->peer = $this->getResponseValue('peer', '\phparia\Resources\Peer', $client);
68
    }
69
}
70

src/wormling/phparia/Events/TextMessageReceived.php 1 location

@@ 30-66 (lines=37) @@
27
 *
28
 * @author Brian Smith <[email protected]>
29
 */
30
class TextMessageReceived extends Event
31
{
32
    /**
33
     * @var Endpoint  (optional)
34
     */
35
    private $endpoint;
36
37
    /**
38
     * @var TextMessage
39
     */
40
    private $message;
41
42
    public function getEndpoint()
43
    {
44
        return $this->endpoint;
45
    }
46
47
    /**
48
     * @return TextMessage
49
     */
50
    public function getMessage()
51
    {
52
        return $this->message;
53
    }
54
55
    /**
56
     * @param AriClient $client
57
     * @param string $response
58
     */
59
    public function __construct(AriClient $client, $response)
60
    {
61
        parent::__construct($client, $response);
62
63
        $this->endpoint = $this->getResponseValue('endpoint', '\phparia\Resources\Endpoint', $client);
64
        $this->message = $this->getResponseValue('message', '\phparia\Resources\TextMessage');
65
    }
66
}
67