diff --git a/framework/rbac/Rule.php b/framework/rbac/Rule.php index aa560c6cfd..ee13735f05 100644 --- a/framework/rbac/Rule.php +++ b/framework/rbac/Rule.php @@ -23,20 +23,6 @@ abstract class Rule extends Object */ public $name; - /** - * Constructor. - * - * @param array $name name of the rule - * @param array $config name-value pairs that will be used to initialize the object properties - */ - public function __construct($name = null, $config = []) - { - if ($name !== null) { - $this->name = $name; - } - parent::__construct($config); - } - /** * Executes the rule. * diff --git a/tests/unit/framework/rbac/ManagerTestCase.php b/tests/unit/framework/rbac/ManagerTestCase.php index 06b5f653cd..0aa6b8727f 100644 --- a/tests/unit/framework/rbac/ManagerTestCase.php +++ b/tests/unit/framework/rbac/ManagerTestCase.php @@ -181,7 +181,7 @@ abstract class ManagerTestCase extends TestCase public function testSaveRule() { $ruleName = 'isReallyReallyAuthor'; - $rule = new AuthorRule($ruleName, ['reallyReally' => true]); + $rule = new AuthorRule(['name' => $ruleName, 'reallyReally' => true]); $this->auth->saveRule($rule); /** @var AuthorRule $rule */ @@ -199,7 +199,7 @@ abstract class ManagerTestCase extends TestCase public function testGetRules() { - $rule = new AuthorRule('isReallyReallyAuthor', ['reallyReally' => true]); + $rule = new AuthorRule(['name' => 'isReallyReallyAuthor', 'reallyReally' => true]); $this->auth->saveRule($rule); $rules = $this->auth->getRules();