From c4ba06b58c0d22436410b9ce7d171aa2dfaf81ed Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Tue, 26 Nov 2013 21:32:08 +1030 Subject: [PATCH] Add Restriction Interface --- src/API/PermissionsAPI.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/API/PermissionsAPI.php b/src/API/PermissionsAPI.php index bd5556124..20d92bf92 100644 --- a/src/API/PermissionsAPI.php +++ b/src/API/PermissionsAPI.php @@ -156,10 +156,17 @@ class PlayerPermissions implements ArrayAccess //Thinking of doing $player->permissions[] = new EventRestriction("player.move"); //$player->permissions->apply(new EventRestriction("player.move")); +interface Restriction +{ + public function __construct($restriction); + + public function __toString(); +} + /** * Class EventRestriction */ -class EventRestriction +class EventRestriction implements Restriction { /** * @var string $event @@ -186,7 +193,7 @@ class EventRestriction /** * Class CommandRestriction */ -class CommandRestriction +class CommandRestriction implements Restriction { /** * @var string $command