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.

GroupingHelpers::setAmazonGroup()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace NotificationChannels\OneSignal\Traits\Categories;
4
5
trait GroupingHelpers
6
{
7
    /**
8
     * Set the Android Grouping Parameters.
9
     *
10
     * @param string $group
11
     * @param array  $groupMessage
12
     *
13
     * @return $this
14
     */
15
    public function setAndroidGroup(string $group, array $groupMessage)
16
    {
17
        return $this->setParameter('android_group', $group)
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
            ->setParameter('android_group_message', $groupMessage);
19
    }
20
21
    /**
22
     * Set the Amazon (FireOS) Grouping Parameters.
23
     *
24
     * @param string $group
25
     * @param array  $groupMessage
26
     *
27
     * @return $this
28
     */
29
    public function setAmazonGroup(string $group, array $groupMessage)
30
    {
31
        return $this->setParameter('adm_group', $group)
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
            ->setParameter('adm_group_message', $groupMessage);
33
    }
34
35
    /**
36
     * Set the Grouping Parameters for all available Systems (currently Android and Amazon (FireOs)).
37
     *
38
     * @param string $group
39
     * @param array  $groupMessage
40
     *
41
     * @return $this
42
     */
43
    public function setGroup(string $group, array $groupMessage)
44
    {
45
        return $this->setAndroidGroup($group, $groupMessage)
46
            ->setAmazonGroup($group, $groupMessage);
47
    }
48
}
49