This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
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 Victoire\Bundle\BlogBundle\Entity; |
||
4 | |||
5 | use Doctrine\ORM\Mapping as ORM; |
||
6 | use Gedmo\Mapping\Annotation as Gedmo; |
||
7 | use JMS\Serializer\Annotation as Serializer; |
||
8 | use Knp\DoctrineBehaviors\Model\Translatable\Translation; |
||
9 | use Symfony\Component\Validator\Constraints as Assert; |
||
10 | use Victoire\Bundle\CoreBundle\Annotations as VIC; |
||
11 | use Victoire\Bundle\MediaBundle\Entity\Media; |
||
12 | |||
13 | /** |
||
14 | * Victoire ViewTranslation. |
||
15 | * |
||
16 | * @ORM\Entity() |
||
17 | * @ORM\Table(name="vic_article_translations") |
||
18 | */ |
||
19 | class ArticleTranslation |
||
20 | { |
||
21 | use Translation; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | * |
||
26 | * @Assert\NotBlank() |
||
27 | * @ORM\Column(name="name", type="string", length=255) |
||
28 | * @Serializer\Groups({"search"}) |
||
29 | * @VIC\BusinessProperty({"textable", "seoable"}) |
||
30 | */ |
||
31 | protected $name; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | * |
||
36 | * @Assert\NotBlank(groups={"edition"}) |
||
37 | * @Gedmo\Slug(handlers={ |
||
38 | * @Gedmo\SlugHandler(class="Victoire\Bundle\BusinessEntityBundle\Handler\TwigSlugHandler" |
||
39 | * )},fields={"name"}, updatable=false, unique=false) |
||
40 | * @ORM\Column(name="slug", type="string", length=255) |
||
41 | * @VIC\BusinessProperty("businessParameter") |
||
42 | */ |
||
43 | protected $slug; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | * |
||
48 | * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\MediaBundle\Entity\Media") |
||
49 | * @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="CASCADE") |
||
50 | * @VIC\BusinessProperty("imageable") |
||
51 | */ |
||
52 | private $image; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | * |
||
57 | * @ORM\Column(name="description", type="text", nullable=true) |
||
58 | * @VIC\BusinessProperty({"textable", "seoable"}) |
||
59 | */ |
||
60 | private $description; |
||
61 | |||
62 | /** |
||
63 | * Get name. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getName() |
||
68 | { |
||
69 | return $this->name; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Set name. |
||
74 | * |
||
75 | * @param string $name |
||
76 | * |
||
77 | * @return View |
||
78 | */ |
||
79 | public function setName($name) |
||
80 | { |
||
81 | $this->name = $name; |
||
82 | |||
83 | return $this; |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * Set slug. |
||
88 | * |
||
89 | * @param string $slug |
||
90 | * |
||
91 | * @return View |
||
92 | */ |
||
93 | public function setSlug($slug) |
||
94 | { |
||
95 | $this->slug = $slug; |
||
96 | |||
97 | return $this; |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * Get slug. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getSlug() |
||
106 | { |
||
107 | return $this->slug; |
||
108 | } |
||
109 | |||
110 | /** |
||
111 | * Get description. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getDescription() |
||
116 | { |
||
117 | return $this->description; |
||
118 | } |
||
119 | |||
120 | /** |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
121 | * Set category. |
||
122 | * |
||
123 | * @param string $category |
||
0 ignored issues
–
show
There is no parameter named
$category . Was it maybe removed?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. Consider the following example. The parameter /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not. ![]() |
|||
124 | * |
||
125 | * @return Article |
||
126 | */ |
||
127 | public function setDescription($description) |
||
128 | { |
||
129 | $this->description = $description; |
||
130 | |||
131 | return $this; |
||
132 | } |
||
133 | |||
134 | /** |
||
135 | * Set image. |
||
136 | * |
||
137 | * @param Media $image |
||
138 | * |
||
139 | * @return ArticleTranslation |
||
140 | */ |
||
141 | public function setImage(Media $image = null) |
||
142 | { |
||
143 | $this->image = $image; |
||
0 ignored issues
–
show
It seems like
$image can also be of type object<Victoire\Bundle\MediaBundle\Entity\Media> . However, the property $image is declared as type string . Maybe add an additional type check?
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly. For example, imagine you have a variable Either this assignment is in error or a type check should be added for that assignment. class Id
{
public $id;
public function __construct($id)
{
$this->id = $id;
}
}
class Account
{
/** @var Id $id */
public $id;
}
$account_id = false;
if (starsAreRight()) {
$account_id = new Id(42);
}
$account = new Account();
if ($account instanceof Id)
{
$account->id = $account_id;
}
![]() |
|||
144 | |||
145 | return $this; |
||
146 | } |
||
147 | |||
148 | /** |
||
149 | * Get image. |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getImage() |
||
154 | { |
||
155 | return $this->image; |
||
156 | } |
||
157 | } |
||
158 |