Commit f42af951 by Johnny Theill

Fix newlines and missing parameter description

parent 63272f41
...@@ -72,4 +72,4 @@ class SiteController extends Controller ...@@ -72,4 +72,4 @@ class SiteController extends Controller
Yii::$app->user->logout(); Yii::$app->user->logout();
return $this->goHome(); return $this->goHome();
} }
} }
\ No newline at end of file
<?php <?php
namespace common\models; namespace common\models;
use yii\base\Model;
use Yii; use Yii;
use yii\base\Model;
/** /**
* Login form * Login form
...@@ -44,12 +44,13 @@ class LoginForm extends Model ...@@ -44,12 +44,13 @@ class LoginForm extends Model
/** /**
* Logs in a user using the provided username and password. * Logs in a user using the provided username and password.
*
* @return boolean whether the user is logged in successfully * @return boolean whether the user is logged in successfully
*/ */
public function login() public function login()
{ {
if ($this->validate()) { if ($this->validate()) {
return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0); return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
} else { } else {
return false; return false;
} }
...@@ -67,4 +68,4 @@ class LoginForm extends Model ...@@ -67,4 +68,4 @@ class LoginForm extends Model
} }
return $this->_user; return $this->_user;
} }
} }
\ No newline at end of file
...@@ -30,8 +30,8 @@ class User extends ActiveRecord implements IdentityInterface ...@@ -30,8 +30,8 @@ class User extends ActiveRecord implements IdentityInterface
/** /**
* Creates a new user * Creates a new user
* *
* @param $attributes * @param array $attributes the attributes given by field => value
* @return static|null * @return static|null the newly created model, or null on failure
*/ */
public static function create($attributes) public static function create($attributes)
{ {
...@@ -195,4 +195,4 @@ class User extends ActiveRecord implements IdentityInterface ...@@ -195,4 +195,4 @@ class User extends ActiveRecord implements IdentityInterface
['email', 'unique'], ['email', 'unique'],
]; ];
} }
} }
\ No newline at end of file
...@@ -153,4 +153,4 @@ class SiteController extends Controller ...@@ -153,4 +153,4 @@ class SiteController extends Controller
'model' => $model, 'model' => $model,
]); ]);
} }
} }
\ No newline at end of file
...@@ -61,4 +61,4 @@ class ContactForm extends Model ...@@ -61,4 +61,4 @@ class ContactForm extends Model
return false; return false;
} }
} }
} }
\ No newline at end of file
...@@ -52,4 +52,4 @@ class PasswordResetRequestForm extends Model ...@@ -52,4 +52,4 @@ class PasswordResetRequestForm extends Model
return false; return false;
} }
} }
\ No newline at end of file
...@@ -60,4 +60,4 @@ class ResetPasswordForm extends Model ...@@ -60,4 +60,4 @@ class ResetPasswordForm extends Model
$user->removePasswordResetToken(); $user->removePasswordResetToken();
return $user->save(); return $user->save();
} }
} }
\ No newline at end of file
...@@ -46,4 +46,4 @@ class SignupForm extends Model ...@@ -46,4 +46,4 @@ class SignupForm extends Model
} }
return null; return null;
} }
} }
\ No newline at end of file
...@@ -91,4 +91,4 @@ class SiteController extends Controller ...@@ -91,4 +91,4 @@ class SiteController extends Controller
{ {
return $this->render('about'); return $this->render('about');
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment