InteractsWithCookies::addCookie()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
1
<?php
2
3
namespace BeyondCode\DuskDashboard\Dusk\Concerns;
4
5
trait InteractsWithCookies
6
{
7
    /** {@inheritdoc} */
8
    public function cookie($name, $value = null, $expiry = null, array $options = [])
9
    {
10
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
0 ignored issues
show
Bug introduced by
The property actionCollector does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
11
12
        return parent::cookie($name, $value, $expiry, $options);
13
    }
14
15
    /** {@inheritdoc} */
16
    public function plainCookie($name, $value = null, $expiry = null, array $options = [])
17
    {
18
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
19
20
        return parent::plainCookie($name, $value, $expiry, $options);
21
    }
22
23
    /** {@inheritdoc} */
24
    public function addCookie($name, $value, $expiry = null, array $options = [], $encrypt = true)
25
    {
26
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
27
28
        return parent::addCookie($name, $value, $expiry, $options, $encrypt);
29
    }
30
31
    /** {@inheritdoc} */
32
    public function deleteCookie($name)
33
    {
34
        $this->actionCollector->collect(__FUNCTION__, func_get_args(), $this);
35
36
        return parent::deleteCookie($name);
37
    }
38
}
39