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\FormBundle\Entity\PageParts; |
||
4 | |||
5 | use Doctrine\ORM\Mapping as ORM; |
||
6 | use Kunstmaan\FormBundle\Form\SubmitButtonPagePartAdminType; |
||
7 | use Kunstmaan\PagePartBundle\Entity\AbstractPagePart; |
||
8 | |||
9 | /** |
||
10 | * This page part adds a submit button to the forms |
||
11 | * |
||
12 | * @ORM\Entity |
||
13 | * @ORM\Table(name="kuma_submit_button_page_parts") |
||
14 | */ |
||
15 | class SubmitButtonPagePart extends AbstractPagePart |
||
16 | { |
||
17 | /** |
||
18 | * The label on the submit button |
||
19 | * |
||
20 | * @ORM\Column(type="string", nullable=true) |
||
21 | */ |
||
22 | protected $label; |
||
23 | |||
24 | /** |
||
25 | * Set the label |
||
26 | * |
||
27 | * @param int $label |
||
28 | * |
||
29 | * @return SubmitButtonPagePart |
||
30 | */ |
||
31 | 2 | public function setLabel($label) |
|
32 | { |
||
33 | 2 | $this->label = $label; |
|
34 | |||
35 | 2 | return $this; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * Get the label |
||
40 | * |
||
41 | * @return string |
||
0 ignored issues
–
show
|
|||
42 | */ |
||
43 | 2 | public function getLabel() |
|
44 | { |
||
45 | 2 | return $this->label; |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * Return a string representation of this page part |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function __toString() |
|
54 | { |
||
55 | 1 | return 'SubmitButtonPagePart'; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * Return the frontend view |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function getDefaultView() |
|
64 | { |
||
65 | 1 | return '@KunstmaanForm/SubmitButtonPagePart/view.html.twig'; |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * Return the backend view |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | 1 | public function getAdminView() |
|
74 | { |
||
75 | 1 | return '@KunstmaanForm/SubmitButtonPagePart/view-admin.html.twig'; |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * Returns the default form type for this FormSubmissionField |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 1 | public function getDefaultAdminType() |
|
84 | { |
||
85 | 1 | return SubmitButtonPagePartAdminType::class; |
|
86 | } |
||
87 | } |
||
88 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.