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.

Event::setTarget()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the PHPMongo package.
5
 *
6
 * (c) Dmytro Sokil <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sokil\Mongo;
13
14
class Event extends \Symfony\Component\EventDispatcher\Event
15
{
16
    /**
17
     * @var mixed $target target object, on which event is fired
18
     */
19
    private $target;
20
    
21
    private $cancelled = false;
22
23
    /**
24
     * Set target object, on which event is fired
25
     * @param mixed $target
26
     * @return \Sokil\Mongo\Event
27
     */
28
    public function setTarget($target)
29
    {
30
        $this->target = $target;
31
        return $this;
32
    }
33
34
    /**
35
     * Get target object, on which event is fired
36
     * @return mixed
37
     */
38
    public function getTarget()
39
    {
40
        return $this->target;
41
    }
42
    
43
    /**
44
     * Check if operation execution cancelled
45
     */
46
    public function isCancelled()
47
    {
48
        return $this->cancelled;
49
    }
50
    
51
    /**
52
     * Cancel related operation execution. If called as beforeInsert
53
     * handler, than insert will be cancelled.
54
     */
55
    public function cancel()
56
    {
57
        $this->cancelled = true;
58
        
59
        // propagation also not need
60
        $this->stopPropagation();
61
        
62
        return $this;
63
    }
64
}
65