public function __construct(array $rules = []) { foreach (['allow', 'deny'] as $type) { if (empty($rules[$type])) { $rules[$type] = []; } } $this->build($rules['allow'], $rules['deny']); }