Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix accessor attributes not working on PHP < 8.1
Browse files Browse the repository at this point in the history
pindab0ter committed Jan 24, 2023
1 parent 8d900b3 commit b1f85ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
@@ -1119,6 +1119,9 @@ protected function hasCamelCaseModelProperties()

protected function getAttributeReturnType(Model $model, \ReflectionMethod $reflectionMethod): Collection
{
// Private/protected ReflectionMethods require setAccessible prior to PHP 8.1
$reflectionMethod->setAccessible(true);

/** @var Attribute $attribute */
$attribute = $reflectionMethod->invoke($model);

0 comments on commit b1f85ab

Please sign in to comment.