This method 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...
19
{
20
foreach ($data as $key => $value) {
21
if ($key === 'url') {
22
continue;
23
}
24
$this->{$key} = $value;
25
}
26
27
return $this;
28
}
29
30
/**
31
* Convert the Model to an array.
32
*
33
* @return array
34
*/
35
public function toArray(): array
36
{
37
return (array) $this;
38
}
39
40
/**
41
* Up to Date.
42
*
43
* Checks the version of the current plugin vs. the
44
* version supplied and returns true or false.
45
*
46
* If the plugin is greater than or equal to the current version,
47
* return true, else return false.
48
*
49
* @param $version
50
* @return bool
51
*/
52
public function upToDate($version): bool
53
{
54
if (version_compare($this->version, $version, '>=')) {
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.