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.

Deprecated::buttons()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NotificationChannels\OneSignal\Traits;
4
5
use NotificationChannels\OneSignal\OneSignalButton;
6
use NotificationChannels\OneSignal\OneSignalWebButton;
7
8
trait Deprecated
9
{
10
    /**
11
     * Set the message body.
12
     *
13
     * @param mixed $value
14
     *
15
     * @deprecated use setBody instead
16
     *
17
     * @return $this
18
     */
19
    public function body($value)
20
    {
21
        return $this->setBody($value);
0 ignored issues
show
Bug introduced by
It seems like setBody() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
22
    }
23
24
    /**
25
     * Set the message subject.
26
     *
27
     * @param mixed $value
28
     *
29
     * @deprecated Use setSubject instead
30
     *
31
     * @return $this
32
     */
33 9
    public function subject($value)
34
    {
35 9
        return $this->setParameter('headings', $this->parseValueToArray($value));
0 ignored issues
show
Bug introduced by
It seems like parseValueToArray() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
Bug introduced by
It seems like setParameter() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
36
    }
37
38
    /**
39
     * Set the message url.
40
     *
41
     * @param string $value
42
     *
43
     * @deprecated use setUrl Instead
44
     *
45
     * @return $this
46
     */
47 9
    public function url($value)
48
    {
49 9
        return $this->setUrl($value);
0 ignored issues
show
Bug introduced by
It seems like setUrl() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
50
    }
51
52
    /**
53
     * Add a web button to the message.
54
     *
55
     * @param OneSignalWebButton $button
56
     *
57
     * @deprecated use setWebButton instead
58
     *
59
     * @return $this
60
     */
61 1
    public function webButton(OneSignalWebButton $button)
62
    {
63 1
        return $this->setWebButton($button);
0 ignored issues
show
Bug introduced by
The method setWebButton() does not exist on NotificationChannels\OneSignal\Traits\Deprecated. Did you maybe mean webButton()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
64
    }
65
66
    /**
67
     * Adds more than one web button to the message.
68
     *
69
     * @param array[OnSignalWebButton] $buttons
0 ignored issues
show
Documentation introduced by
The doc-type array[OnSignalWebButton] could not be parsed: Expected "]" at position 2, but found "OnSignalWebButton". (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
70
     *
71
     * @deprecated use setWebButtons instead
72
     *
73
     * @return $this
74
     */
75
    public function webButtons(array $buttons)
76
    {
77
        return $this->setWebButtons($buttons);
0 ignored issues
show
Bug introduced by
The method setWebButtons() does not exist on NotificationChannels\OneSignal\Traits\Deprecated. Did you maybe mean webButton()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
78
    }
79
80
    /**
81
     * Add a native button to the message.
82
     *
83
     * @param OneSignalButton $button
84
     *
85
     * @deprecated use setButton instead
86
     * @return $this
87
     */
88
    public function button(OneSignalButton $button)
89
    {
90
        return $this->setButton($button);
0 ignored issues
show
Bug introduced by
The method setButton() does not exist on NotificationChannels\OneSignal\Traits\Deprecated. Did you maybe mean button()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
91
    }
92
93
    /**
94
     * Adds more than one native button to the message.
95
     *
96
     * @param array $buttons
97
     *
98
     * @deprecated use setButtons instead
99
     *
100
     * @return $this
101
     */
102
    public function buttons(array $buttons)
103
    {
104
        return $this->setButtons($buttons);
0 ignored issues
show
Bug introduced by
The method setButtons() does not exist on NotificationChannels\OneSignal\Traits\Deprecated. Did you maybe mean button()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
105
    }
106
}
107