diff options
author | Valentin Popov <info@valentineus.link> | 2019-05-11 12:49:04 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2019-05-11 12:54:14 +0300 |
commit | c42e13d182855d20af534bf8d84a5c142e48f851 (patch) | |
tree | 743408c5ad416d6f11400c599d50247e2c78dae4 /classes/local/record.php | |
parent | 7dc023b05a9292cb9e5ea4fa65e86668c857cd82 (diff) | |
download | local_webhooks-c42e13d182855d20af534bf8d84a5c142e48f851.tar.xz local_webhooks-c42e13d182855d20af534bf8d84a5c142e48f851.zip |
Fixed violations CI
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'classes/local/record.php')
-rw-r--r-- | classes/local/record.php | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/classes/local/record.php b/classes/local/record.php index 3e74571..36b63c1 100644 --- a/classes/local/record.php +++ b/classes/local/record.php @@ -20,10 +20,6 @@ defined('MOODLE_INTERNAL') || die(); use stdClass; use function defined; -use function is_array; -use function is_bool; -use function is_int; -use function is_string; /** * It's a class description record. @@ -88,38 +84,12 @@ final class record extends stdClass { * @param array|null $conditions */ public function __construct(array $conditions = null) { - if (isset($conditions['events']) && is_array($conditions['events'])) { - $this->events = []; - - foreach ($conditions['events'] as $event) { - if (is_string($event)) { - $this->events[] = $event; - } - } - } - - if (isset($conditions['header']) && is_string($conditions['header'])) { - $this->header = $conditions['header']; - } - - if (isset($conditions['id']) && is_int($conditions['id'])) { - $this->id = $conditions['id']; - } - - if (isset($conditions['name']) && is_string($conditions['name'])) { - $this->name = $conditions['name']; - } - - if (isset($conditions['point']) && is_string($conditions['point'])) { - $this->point = $conditions['point']; - } - - if (isset($conditions['status']) && is_bool($conditions['status'])) { - $this->status = $conditions['status']; - } - - if (isset($conditions['token']) && is_string($conditions['token'])) { - $this->token = $conditions['token']; - } + $this->events = $conditions['events'] ?? null; + $this->header = $conditions['header'] ?? null; + $this->id = $conditions['id'] ?? null; + $this->name = $conditions['name'] ?? null; + $this->point = $conditions['point'] ?? null; + $this->status = $conditions['status'] ?? null; + $this->token = $conditions['token'] ?? null; } }
\ No newline at end of file |