for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This is the model class for table "verification".
*
* The followings are the available columns in table 'verification':
* @property integer $account_id
* @property integer $type
* @property string $code
* @property string $data
*/
class Verification extends CActiveRecord
{
const TYPE_REGISTER = 1;
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
const TYPE_CHANGE_EMAIL = 2;
const TYPE_RESET_PASSWORD = 3;
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Verification the static model class
public static function model($className = __CLASS__)
return parent::model($className);
}
* @return string the associated database table name
public function tableName()
return 'verification';
* Generates a random code
public function generateCode()
return md5(mt_rand());
* Validates the code
public function validateCode($code)
return $code===$this->code;
This check marks files that end in a newline character, i.e. an empy line.
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.