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 (#58)
by Lukas
01:54
created

AppearanceHelpers::incrementIosBadgeCount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace NotificationChannels\OneSignal\Traits\Categories;
4
5
6
trait AppearanceHelpers
7
{
8
9
    /**
10
     * Set the iOS badge increment count.
11
     *
12
     * @param int $count
13
     *
14
     * @return $this
15
     */
16 1
    public function incrementIosBadgeCount(int $count = 1)
17
    {
18 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...
19 1
            ->setParameter('ios_badgeCount', $count);
20
    }
21
22
    /**
23
     * Set the iOS badge decrement count.
24
     *
25
     * @param int $count
26
     *
27
     * @return $this
28
     */
29 1
    public function decrementIosBadgeCount(int $count = 1)
30
    {
31 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...
32 1
            ->setParameter('ios_badgeCount', -1 * $count);
33
    }
34
35
    /**
36
     * Set the iOS badge count.
37
     *
38
     * @param int $count
39
     *
40
     * @return $this
41
     */
42 1
    public function setIosBadgeCount(int $count)
43
    {
44 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...
45 1
            ->setParameter('ios_badgeCount', $count);
46
    }
47
48
    /**
49
     * Set the iOS Sound.
50
     *
51
     * @param string $soundUrl
52
     *
53
     * @return $this
54
     */
55
    public function setIosSound(string $soundUrl)
56
    {
57
        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...
58
    }
59
60
    /**
61
     * Set the Android Sound.
62
     *
63
     * @param string $soundUrl
64
     *
65
     * @return $this
66
     */
67
    public function setAndroidSound(string $soundUrl)
68
    {
69
        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...
70
    }
71
72
    /**
73
     * Set the Windows Sound.
74
     *
75
     * @param string $soundUrl
76
     *
77
     * @return $this
78
     */
79
    public function setWindowsSound(string $soundUrl)
80
    {
81
        return $this->setParameter('wp_sound', $soundUrl)->setParameter('wp_wns_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...
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
     * @return $this
104
     */
105 6
    public function icon(string $iconPath){
106 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...
107 6
            ->setParameter('chrome_icon', $iconPath)
108 6
            ->setParameter('adm_small_icon', $iconPath)
109 6
            ->setParameter('small_icon', $iconPath);
110
    }
111
}