1 | <?php |
||
14 | trait HasCast |
||
15 | { |
||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $cast; |
||
20 | |||
21 | abstract public function getName(); |
||
22 | |||
23 | /** |
||
24 | * @return string |
||
25 | */ |
||
26 | public function getCast() |
||
30 | |||
31 | /** |
||
32 | * @param string $cast |
||
33 | * @return $this |
||
34 | */ |
||
35 | public function setCast(string $cast) |
||
41 | |||
42 | /** |
||
43 | * @return bool |
||
44 | */ |
||
45 | protected function isCastable() |
||
49 | |||
50 | /** |
||
51 | * Determine whether a value is Date / DateTime castable for inbound manipulation. |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | protected function isDateCastable() |
||
59 | |||
60 | /** |
||
61 | * @return bool |
||
62 | */ |
||
63 | protected function isJsonCastable() |
||
67 | |||
68 | /** |
||
69 | * @return bool |
||
70 | */ |
||
71 | protected function isCommaCastable() |
||
75 | |||
76 | /** |
||
77 | * Cast the given value to JSON. |
||
78 | * |
||
79 | * @param mixed $value |
||
80 | * @return string |
||
81 | */ |
||
82 | protected function castValueAsJson($value) |
||
99 | |||
100 | /** |
||
101 | * Encode the given value as JSON. |
||
102 | * |
||
103 | * @param $value |
||
104 | * @return string |
||
105 | */ |
||
106 | protected function asJson($value) |
||
110 | |||
111 | /** |
||
112 | * Decode the given JSON back into an array or object. |
||
113 | * |
||
114 | * @param string $value |
||
115 | * @param bool $asObject |
||
116 | * @return mixed |
||
117 | */ |
||
118 | protected function fromJson($value, $asObject = false) |
||
122 | |||
123 | /** |
||
124 | * Cast the given value to string with comma. |
||
125 | * |
||
126 | * @param mixed $value |
||
127 | * @return string |
||
128 | */ |
||
129 | protected function castValueAsCommaSeparated($value) |
||
137 | |||
138 | /** |
||
139 | * Join the given value with a comma |
||
140 | * |
||
141 | * @param array $value |
||
142 | * @return string |
||
143 | */ |
||
144 | protected function asCommaSeparated(array $value) |
||
148 | |||
149 | /** |
||
150 | * Split the given value by comma |
||
151 | * |
||
152 | * @param string $value |
||
153 | * @return array |
||
154 | */ |
||
155 | protected function fromCommaSeparated(string $value) |
||
159 | |||
160 | /** |
||
161 | * @param $value |
||
162 | * @return \Carbon\Carbon |
||
163 | */ |
||
164 | protected function castValueAsDateTime($value) |
||
168 | |||
169 | protected function isElementOfDate() |
||
173 | |||
174 | /** |
||
175 | * Cast a value to a native PHP type. |
||
176 | * |
||
177 | * @param $value |
||
178 | * @return array |
||
179 | */ |
||
180 | protected function castValue($value) |
||
216 | } |
||
217 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.