GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 6c5ffd...9c9abb )
by Alexander
02:23
created

PayloadHandler::getPayloadMaxLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * (c) Alexander Zhukov <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Zbox\UnifiedPush\Notification;
11
12
use Zbox\UnifiedPush\Message\MessageInterface;
13
use Zbox\UnifiedPush\Exception\InvalidArgumentException;
14
15
/**
16
 * Class PayloadHandler
17
 * @package Zbox\UnifiedPush\Notification
18
 */
19
abstract class PayloadHandler implements PayloadHandlerInterface
20
{
21
    /**
22
     * @var MessageInterface
23
     */
24
    protected $message;
25
26
    /**
27
     * @param MessageInterface $message
28
     * @return bool
29
     */
30
    abstract public function isSupported(MessageInterface $message);
31
32
    /**
33
     * @param MessageInterface $message
34
     * @return $this
35
     */
36
    public function setMessage(MessageInterface $message)
37
    {
38
        if (!$this->isSupported($message)) {
39
            throw new InvalidArgumentException('Message type is not supported');
40
        }
41
42
        $this->message = $message;
43
44
        return $this;
45
    }
46
47
    /**
48
     * Gets maximum size allowed for notification payload
49
     *
50
     * @return int
51
     */
52
    public function getPayloadMaxLength()
53
    {
54
        return static::PAYLOAD_MAX_LENGTH;
55
    }
56
57
    /**
58
     * @return array
59
     */
60
    public function getCustomNotificationData()
61
    {
62
        return array();
63
    }
64
}
65