1 | <?php namespace Arcanesoft\Seo\Models; |
||
18 | class Page extends AbstractModel |
||
19 | { |
||
20 | /* ----------------------------------------------------------------- |
||
21 | | Traits |
||
22 | | ----------------------------------------------------------------- |
||
23 | */ |
||
24 | use Presenters\PagePresenter; |
||
25 | |||
26 | /* ----------------------------------------------------------------- |
||
27 | | Properties |
||
28 | | ----------------------------------------------------------------- |
||
29 | */ |
||
30 | /** |
||
31 | * The attributes that are mass assignable. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $fillable = ['name', 'content', 'locale']; |
||
36 | |||
37 | /** |
||
38 | * The attributes that should be cast to native types. |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $casts = [ |
||
43 | 'id' => 'integer', |
||
44 | ]; |
||
45 | |||
46 | /* ----------------------------------------------------------------- |
||
47 | | Constructor |
||
48 | | ----------------------------------------------------------------- |
||
49 | */ |
||
50 | /** |
||
51 | * Page constructor. |
||
52 | * |
||
53 | * @param array $attributes |
||
54 | */ |
||
55 | public function __construct(array $attributes = []) |
||
62 | |||
63 | /* ----------------------------------------------------------------- |
||
64 | | Relationships |
||
65 | | ----------------------------------------------------------------- |
||
66 | */ |
||
67 | /** |
||
68 | * Footer's relationship. |
||
69 | * |
||
70 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
71 | */ |
||
72 | public function footers() |
||
76 | |||
77 | /* ----------------------------------------------------------------- |
||
78 | | Main Methods |
||
79 | | ----------------------------------------------------------------- |
||
80 | */ |
||
81 | /** |
||
82 | * Create a new page. |
||
83 | * |
||
84 | * @param array $attributes |
||
85 | * |
||
86 | * @return self |
||
87 | */ |
||
88 | public static function createOne(array $attributes) |
||
95 | |||
96 | /** |
||
97 | * Update a page. |
||
98 | * |
||
99 | * @param array $attributes |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function updateOne(array $attributes) |
||
107 | |||
108 | /* ----------------------------------------------------------------- |
||
109 | | Check Methods |
||
110 | | ----------------------------------------------------------------- |
||
111 | */ |
||
112 | /** |
||
113 | * Check if the page is deleteable. |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function isDeleteable() |
||
121 | |||
122 | /* ----------------------------------------------------------------- |
||
123 | | Other Methods |
||
124 | | ----------------------------------------------------------------- |
||
125 | */ |
||
126 | public function renderContent(array $replacer) |
||
142 | |||
143 | /** |
||
144 | * Get the select input data. |
||
145 | * |
||
146 | * @return \Illuminate\Database\Eloquent\Collection |
||
147 | */ |
||
148 | public static function getSelectInputData() |
||
155 | } |
||
156 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.