Completed
Push — master ( 6d6774...64f3ed )
by Jeroen
11:23 queued 05:13
created

src/Kunstmaan/NodeBundle/Event/AdaptFormEvent.php (6 issues)

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
3
namespace Kunstmaan\NodeBundle\Event;
4
5
use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\TabPane;
6
use Kunstmaan\NodeBundle\Entity\HasNodeInterface;
7
use Kunstmaan\NodeBundle\Entity\Node;
8
use Kunstmaan\NodeBundle\Entity\NodeTranslation;
9
use Kunstmaan\NodeBundle\Entity\NodeVersion;
10
use Symfony\Component\EventDispatcher\Event;
11
use Symfony\Component\HttpFoundation\Request;
12
13
/**
14
 * The event to pass metadata if the adaptForm event is triggered
15
 */
16
class AdaptFormEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
17
{
18
    /**
19
     * @var TabPane
20
     */
21
    private $tabPane;
22
23
    /**
24
     * @var
25
     */
26
    private $page;
27
28
    /**
29
     * @var Node
30
     */
31
    private $node;
32
33
    /**
34
     * @var NodeTranslation
35
     */
36
    private $nodeTranslation;
37
38
    /**
39
     * @var NodeVersion
40
     */
41
    private $nodeVersion;
42
43
    /**
44
     * @var Request
45
     */
46
    private $request;
47
48
    /**
49
     * @param Request          $request
50
     * @param TabPane          $tabPane         The tab pane
51
     * @param HasNodeInterface $page            The page
0 ignored issues
show
Should the type for parameter $page not be HasNodeInterface|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
52
     * @param Node             $node            The node
0 ignored issues
show
Should the type for parameter $node not be null|Node?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
53
     * @param NodeTranslation  $nodeTranslation The node translation
0 ignored issues
show
Should the type for parameter $nodeTranslation not be null|NodeTranslation?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
54
     * @param NodeVersion      $nodeVersion     The node version
0 ignored issues
show
Should the type for parameter $nodeVersion not be null|NodeVersion?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
55
     */
56 2
    public function __construct(Request $request, TabPane $tabPane, $page = null, Node $node = null, NodeTranslation $nodeTranslation = null, NodeVersion $nodeVersion = null)
0 ignored issues
show
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
57
    {
58 2
        $this->request = $request;
59 2
        $this->tabPane = $tabPane;
60 2
        $this->page = $page;
61 2
        $this->node = $node;
62 2
        $this->nodeTranslation = $nodeTranslation;
63 2
        $this->nodeVersion = $nodeVersion;
64 2
    }
65
66
    /**
67
     * @return Node
68
     */
69 1
    public function getNode()
70
    {
71 1
        return $this->node;
72
    }
73
74
    /**
75
     * @return NodeTranslation
76
     */
77 1
    public function getNodeTranslation()
78
    {
79 1
        return $this->nodeTranslation;
80
    }
81
82
    /**
83
     * @return NodeVersion
84
     */
85 1
    public function getNodeVersion()
86
    {
87 1
        return $this->nodeVersion;
88
    }
89
90
    /**
91
     * @return
92
     */
93 2
    public function getPage()
94
    {
95 2
        return $this->page;
96
    }
97
98
    /**
99
     * @return TabPane
100
     */
101 2
    public function getTabPane()
102
    {
103 2
        return $this->tabPane;
104
    }
105
106 1
    public function getRequest()
107
    {
108 1
        return $this->request;
109
    }
110
}
111