Passed
Push — master ( 73f61b...6db8b4 )
by David
51s
created

lib/GitHub/Receiver/Activity/AbstractActivity.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace FlexyProject\GitHub\Receiver\Activity;
3
4
use FlexyProject\GitHub\AbstractApi;
5
use FlexyProject\GitHub\Receiver\Activity;
6
7
/**
8
 * Class AbstractActivity
9
 *
10
 * @package FlexyProject\GitHub\Receiver\Activity
11
 */
12 View Code Duplication
abstract class AbstractActivity
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
15
    protected $activity;
16
    protected $api;
17
18
    /**
19
     * Constructor
20
     *
21
     * @param Activity $activity
22
     */
23
    public function __construct(Activity $activity)
24
    {
25
        $this->setActivity($activity);
26
        $this->setApi($activity->getApi());
27
    }
28
29
    /**
30
     * Get activity
31
     *
32
     * @return Activity
33
     */
34
    public function getActivity(): Activity
35
    {
36
        return $this->activity;
37
    }
38
39
    /**
40
     * Set activity
41
     *
42
     * @param Activity $activity
43
     *
44
     * @return AbstractActivity
45
     */
46
    public function setActivity(Activity $activity): AbstractActivity
47
    {
48
        $this->activity = $activity;
49
50
        return $this;
51
    }
52
53
    /**
54
     * Get api
55
     *
56
     * @return AbstractApi
57
     */
58
    public function getApi(): AbstractApi
59
    {
60
        return $this->api;
61
    }
62
63
    /**
64
     * Set api
65
     *
66
     * @param AbstractApi $api
67
     *
68
     * @return AbstractActivity
69
     */
70
    public function setApi(AbstractApi $api): AbstractActivity
71
    {
72
        $this->api = $api;
73
74
        return $this;
75
    }
76
}