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.

DeliveryHelpers   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 62
ccs 0
cts 10
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setSendAfter() 0 4 1
A setDelayedOption() 0 4 1
A setDeliveryTimeOfDay() 0 4 1
A setTtl() 0 4 1
A setPriority() 0 4 1
1
<?php
2
3
namespace NotificationChannels\OneSignal\Traits\Categories;
4
5
trait DeliveryHelpers
6
{
7
    /**
8
     * Set the send after.
9
     *
10
     * @param string $date
11
     *
12
     * @return $this
13
     */
14
    public function setSendAfter(string $date)
15
    {
16
        return $this->setParameter('send_after', $date);
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
    }
18
19
    /**
20
     * Set the deplayed option.
21
     *
22
     * @param string $delayedOption
23
     *
24
     * @return $this
25
     */
26
    public function setDelayedOption(string $delayedOption)
27
    {
28
        return $this->setParameter('delayed_option', $delayedOption);
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...
29
    }
30
31
    /**
32
     * Set the delivery at time of the day. Use with delayed option = timezone.
33
     *
34
     * @param string $timeOfDay
35
     *
36
     * @return $this
37
     */
38
    public function setDeliveryTimeOfDay(string $timeOfDay)
39
    {
40
        return $this->setParameter('delivery_time_of_day', $timeOfDay);
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...
41
    }
42
43
    /**
44
     * Set the Time to Live in Seconds.
45
     *
46
     * @param int $ttl
47
     *
48
     * @return $this
49
     */
50
    public function setTtl(int $ttl)
51
    {
52
        return $this->setParameter('ttl', $ttl);
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...
53
    }
54
55
    /**
56
     * Set the Priority.
57
     *
58
     * @param int $priority
59
     *
60
     * @return $this
61
     */
62
    public function setPriority(int $priority)
63
    {
64
        return $this->setParameter('priority', $priority);
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...
65
    }
66
}
67