Skip to content

Commit

Permalink
Fix accessor attributes not working on PHP < 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pindab0ter committed Jan 5, 2023
1 parent ff66fdf commit 6bc3404
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
Expand Up @@ -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);

Expand Down

0 comments on commit 6bc3404

Please sign in to comment.