Passed
Push — develop ( 3c5942...636dd4 )
by Nikolay
04:57
created

UsersController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A availableAction() 0 8 2
1
<?php
2
namespace MikoPBX\AdminCabinet\Controllers;
3
use MikoPBX\AdminCabinet\Controllers\BaseController;
4
use MikoPBX\Common\Models\Users;
5
6
/**
7
 * Copyright (C) MIKO LLC - All Rights Reserved
8
 * Unauthorized copying of this file, via any medium is strictly prohibited
9
 * Proprietary and confidential
10
 * Written by Nikolay Beketov, 5 2018
11
 *
12
 */
13
14
15
16
class UsersController extends BaseController {
17
18
    /**
19
     * Проверка на доступность емейл адреса
20
     */
21
    public function availableAction($email):void
22
    {
23
        $result = true;
24
        $extension = Users::findFirstByEmail($email);
25
        if ($extension) {
26
            $result = false;
27
        }
28
        $this->view->emailAvailable=$result;
29
    }
30
31
}