Reformat code te be PSR-2 compatible
This commit is contained in:
parent
a85ef65aba
commit
93cc82c4bf
@ -71,6 +71,7 @@ class SiteController extends Controller
|
||||
public function actionLogout()
|
||||
{
|
||||
Yii::$app->user->logout();
|
||||
|
||||
return $this->goHome();
|
||||
}
|
||||
|
||||
@ -79,6 +80,7 @@ class SiteController extends Controller
|
||||
$model = new ContactForm();
|
||||
if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
|
||||
Yii::$app->session->setFlash('contactFormSubmitted');
|
||||
|
||||
return $this->refresh();
|
||||
} else {
|
||||
return $this->render('contact', [
|
||||
|
@ -55,6 +55,7 @@ class ContactForm extends Model
|
||||
->setSubject($this->subject)
|
||||
->setTextBody($this->body)
|
||||
->send();
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -69,6 +69,7 @@ class LoginForm extends Model
|
||||
if ($this->_user === false) {
|
||||
$this->_user = User::findByUsername($this->username);
|
||||
}
|
||||
|
||||
return $this->_user;
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ class User extends \yii\base\Object implements \yii\web\IdentityInterface
|
||||
return new static($user);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -61,6 +62,7 @@ class User extends \yii\base\Object implements \yii\web\IdentityInterface
|
||||
return new static($user);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,7 @@ class LoginFormTest extends TestCase
|
||||
{
|
||||
$loginForm = $this->getMock('app\models\LoginForm', ['getUser']);
|
||||
$loginForm->expects($this->any())->method('getUser')->will($this->returnValue($user));
|
||||
|
||||
return $loginForm;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user