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