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
Pull Request — master (#64)
by
unknown
02:31
created

AppearanceHelpers::setIosSound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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