Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
assertchris committed Apr 22, 2024
1 parent 5647de4 commit e767991
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/Illuminate/View/AnonymousComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Illuminate\View;

use ReflectionClass;

class AnonymousComponent extends Component
{
/**
Expand Down
6 changes: 5 additions & 1 deletion src/Illuminate/View/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ abstract class Component
*/
public static function ignoredParameterNames(): array
{
if (!isset(static::$ignoredParameterNames[static::class])) {
if (! isset(static::$ignoredParameterNames[static::class])) {
$constructor = (new ReflectionClass(
static::class
))->getConstructor();

if (!$constructor) {
static::$ignoredParameterNames[static::class] = [];
}

static::$ignoredParameterNames[static::class] = collect($constructor->getParameters())
->map->getName()
->all();
Expand Down

0 comments on commit e767991

Please sign in to comment.