Skip to content

Commit

Permalink
Update renderable prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
rozsival committed Jan 16, 2020
1 parent ce62cb7 commit 18fc1c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/PropsControl/Helpers/PropTypes.php
Expand Up @@ -36,9 +36,19 @@ public static function controllable(): Type
return Expect::type(Control::class);
}

public static function html(): Type
{
return Expect::type(Html::class);
}

public static function pureRenderable(): AnyOf
{
return Expect::anyOf(Expect::string(), self::html());
}

public static function renderable(): AnyOf
{
return Expect::anyOf(self::controllable(), Expect::string(), Expect::type(Html::class));
return Expect::anyOf(self::controllable(), self::pureRenderable());
}

}

0 comments on commit 18fc1c9

Please sign in to comment.