Reformat code te be PSR-2 compatible

This commit is contained in:
SonicGD 2014-03-16 10:46:16 +06:00
parent a85ef65aba
commit 93cc82c4bf
39 changed files with 790 additions and 783 deletions

View File

@ -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', [

View File

@ -55,6 +55,7 @@ class ContactForm extends Model
->setSubject($this->subject)
->setTextBody($this->body)
->send();
return true;
} else {
return false;

View File

@ -69,6 +69,7 @@ class LoginForm extends Model
if ($this->_user === false) {
$this->_user = User::findByUsername($this->username);
}
return $this->_user;
}
}

View File

@ -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;
}

View File

@ -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;
}
}