1 | <?php |
||
13 | class Date extends Input |
||
14 | { |
||
15 | protected $type = 'date'; |
||
16 | |||
17 | protected $cast = 'date'; |
||
18 | |||
19 | protected $defaultValue = ''; |
||
20 | |||
21 | /** |
||
22 | * Date Picker format |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $pickerFormat = 'yyyy-MM-dd'; |
||
27 | |||
28 | /** |
||
29 | * Datetime timezone. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $timezone; |
||
34 | |||
35 | protected $editable = false; |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | public function getFormat() |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | protected function convertPickerFormat() |
||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | protected function getPickerFormat() |
||
67 | |||
68 | /** |
||
69 | * @param string $value |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function setPickerFormat(string $value) |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | protected function getTimezone() |
||
91 | |||
92 | /** |
||
93 | * @param string $timezone |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function setTimezone(string $timezone) |
||
103 | |||
104 | /** |
||
105 | * @return bool |
||
106 | */ |
||
107 | protected function isEditable() |
||
111 | |||
112 | /** |
||
113 | * Allow edit |
||
114 | * |
||
115 | * @return $this |
||
116 | */ |
||
117 | public function enableEdit() |
||
123 | |||
124 | public function toArray() |
||
132 | |||
133 | /** |
||
134 | * Return a timestamp as DateTime object. |
||
135 | * |
||
136 | * @param mixed $value |
||
137 | * @return Carbon |
||
138 | */ |
||
139 | protected function asDateTime($value) |
||
158 | |||
159 | /** |
||
160 | * Convert a DateTime to a storable string. |
||
161 | * |
||
162 | * @param \DateTime|int $value |
||
163 | * @return string |
||
164 | */ |
||
165 | public function fromDateTime($value) |
||
171 | } |
||
172 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.