Added an example code

This commit is contained in:
Cédric Belin
2018-11-02 00:03:45 +01:00
parent 3891e435c1
commit 3ffe5d6b9c
6 changed files with 27 additions and 58 deletions

View File

@ -1,13 +1,11 @@
<?php
declare(strict_types=1);
namespace yii\gitea\models;
use yii\base\{Model};
namespace Gitea\Models;
/**
* Represents a set of permissions.
*/
class Permission extends Model {
class Permission {
/**
* @var bool Value indicating whether administrator access is allowed.
@ -36,14 +34,4 @@ class Permission extends Model {
'push' => isset($map->push) && is_bool($map->push) ? $map->push : false
]);
}
/**
* Returns the validation rules for attributes.
* @return array[] The validation rules.
*/
function rules(): array {
return [
[['admin', 'pull', 'push'], 'boolean', 'falseValue' => false, 'trueValue' => true]
];
}
}