src/Collection/LazyModelCollection.php 1 location
|
@@ 216-224 (lines=9) @@
|
213 |
|
/** |
214 |
|
* @throws \LogicException |
215 |
|
*/ |
216 |
|
private function jsonSerializableOrException() |
217 |
|
{ |
218 |
|
$reflectionClass = new \ReflectionClass($this->modelClass); |
219 |
|
if (!$reflectionClass->implementsInterface(\JsonSerializable::class)) { |
220 |
|
throw new \LogicException( |
221 |
|
sprintf('Model %s does not implement %s', $this->modelClass, \JsonSerializable::class) |
222 |
|
); |
223 |
|
} |
224 |
|
} |
225 |
|
|
226 |
|
/** |
227 |
|
* @return string |
src/Collection/ModelCollection.php 1 location
|
@@ 164-172 (lines=9) @@
|
161 |
|
/** |
162 |
|
* @throws \LogicException |
163 |
|
*/ |
164 |
|
private function jsonSerializableOrException() |
165 |
|
{ |
166 |
|
$reflectionClass = new \ReflectionClass($this->modelClass); |
167 |
|
if (!$reflectionClass->implementsInterface(\JsonSerializable::class)) { |
168 |
|
throw new \LogicException( |
169 |
|
sprintf('Model %s does not implement %s', $this->modelClass, \JsonSerializable::class) |
170 |
|
); |
171 |
|
} |
172 |
|
} |
173 |
|
|
174 |
|
/** |
175 |
|
* @return string |