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.

AppearanceHelpers::icon()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace NotificationChannels\OneSignal\Traits\Categories;
4
5
trait AppearanceHelpers
6
{
7
    /**
8
     * Set the iOS badge increment count.
9
     *
10
     * @param int $count
11
     *
12
     * @return $this
13
     */
14 1
    public function incrementIosBadgeCount(int $count = 1)
15
    {
16 1
        return $this->setParameter('ios_badgeType', 'Increase')
0 ignored issues
show
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...
17 1
            ->setParameter('ios_badgeCount', $count);
18
    }
19
20
    /**
21
     * Set the iOS badge decrement count.
22
     *
23
     * @param int $count
24
     *
25
     * @return $this
26
     */
27 1
    public function decrementIosBadgeCount(int $count = 1)
28
    {
29 1
        return $this->setParameter('ios_badgeType', 'Increase')
0 ignored issues
show
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...
30 1
            ->setParameter('ios_badgeCount', -1 * $count);
31
    }
32
33
    /**
34
     * Set the iOS badge count.
35
     *
36
     * @param int $count
37
     *
38
     * @return $this
39
     */
40 1
    public function setIosBadgeCount(int $count)
41
    {
42 1
        return $this->setParameter('ios_badgeType', 'SetTo')
0 ignored issues
show
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...
43 1
            ->setParameter('ios_badgeCount', $count);
44
    }
45
46
    /**
47
     * Set the iOS Sound.
48
     *
49
     * @param string $soundUrl
50
     *
51
     * @return $this
52
     */
53
    public function setIosSound(string $soundUrl)
54
    {
55
        return $this->setParameter('ios_sound', $soundUrl);
0 ignored issues
show
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...
56
    }
57
58
    /**
59
     * Set the Android Sound.
60
     *
61
     * @param string $soundUrl
62
     *
63
     * @return $this
64
     */
65
    public function setAndroidSound(string $soundUrl)
66
    {
67
        return $this->setParameter('android_sound', $soundUrl);
0 ignored issues
show
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...
68
    }
69
70
    /**
71
     * Set the Windows Sound.
72
     *
73
     * @param string $soundUrl
74
     *
75
     * @return $this
76
     */
77
    public function setWindowsSound(string $soundUrl)
78
    {
79
        return $this->setParameter('wp_sound', $soundUrl)
0 ignored issues
show
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...
80
            ->setParameter('wp_wns_sound', $soundUrl);
81
    }
82
83
    /**
84
     * Set the Sound for all Systems.
85
     *
86
     * @param string $soundUrl
87
     *
88
     * @return $this
89
     */
90
    public function setSound(string $soundUrl)
91
    {
92
        return $this->setAndroidSound($soundUrl)
93
            ->setIosSound($soundUrl)
94
            ->setWindowsSound($soundUrl);
95
    }
96
97
    /**
98
     * Set the message icon.
99
     *
100
     * @param string $iconPath
101
     *
102
     * @deprecated use setIcon instead
103
     *
104
     * @return $this
105
     */
106 9
    public function icon(string $iconPath)
107
    {
108 9
        return $this->setIcon($iconPath);
109
    }
110
111
    /**
112
     * Set the message icon.
113
     *
114
     * @param string $iconPath
115
     *
116
     * @return $this
117
     */
118 10
    public function setIcon(string $iconPath)
119
    {
120 10
        return $this->setParameter('chrome_web_icon', $iconPath)
0 ignored issues
show
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...
121 10
            ->setParameter('chrome_icon', $iconPath)
122 10
            ->setParameter('adm_small_icon', $iconPath)
123 10
            ->setParameter('small_icon', $iconPath);
124
    }
125
}
126