Missing class import via use statement (line '152', column '83'). Open
$this->_updated_at = new DateTime($request['updated_at'], new DateTimeZone('UTC'));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '150', column '42'). Open
$this->_created_at = new DateTime($request['created_at'], new DateTimeZone('UTC'));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '152', column '46'). Open
$this->_updated_at = new DateTime($request['updated_at'], new DateTimeZone('UTC'));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '150', column '79'). Open
$this->_created_at = new DateTime($request['created_at'], new DateTimeZone('UTC'));
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method findByPackageId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return null;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (is_array($request)) {
$this->_id = $request['id'];
$this->_pens_version = $request['pens_version'];
$this->_package_type = $request['package_type'];
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The parameter $package_id is not named in camelCase. Open
public static function findByPackageId($package_id)
{
$table = Database::get_main_table(self::TABLE_NAME);
$sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';";
$results = Database::query($sql_query);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The property $_package_type_version is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_pens_version is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_vendor_data is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_package_name is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_id is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_created_at is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_package_type is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_client is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_updated_at is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_package_format is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_package_id is not named in camelCase. Open
class ChamiloPens extends Plugin
{
/**
* Database table to be used.
*/
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Property name "$_package_id" should not be prefixed with an underscore to indicate visibility Open
protected $_package_id = null;
- Exclude checks
Member variable "_package_id" is not in valid camel caps format Open
protected $_package_id = null;
- Exclude checks
Property name "$_id" should not be prefixed with an underscore to indicate visibility Open
protected $_id = null;
- Exclude checks
Property name "$_pens_version" should not be prefixed with an underscore to indicate visibility Open
protected $_pens_version = null;
- Exclude checks
Property name "$_package_type" should not be prefixed with an underscore to indicate visibility Open
protected $_package_type = null;
- Exclude checks
Property name "$_client" should not be prefixed with an underscore to indicate visibility Open
protected $_client = null;
- Exclude checks
Member variable "_package_type_version" is not in valid camel caps format Open
protected $_package_type_version = null;
- Exclude checks
Property name "$_package_format" should not be prefixed with an underscore to indicate visibility Open
protected $_package_format = null;
- Exclude checks
Member variable "_package_format" is not in valid camel caps format Open
protected $_package_format = null;
- Exclude checks
Property name "$_vendor_data" should not be prefixed with an underscore to indicate visibility Open
protected $_vendor_data = null;
- Exclude checks
Member variable "_created_at" is not in valid camel caps format Open
protected $_created_at = null;
- Exclude checks
Missing function doc comment Open
public function getPackageFormat()
- Exclude checks
Variable "_created_at" is not in valid camel caps format Open
$this->_created_at = new DateTime($request['created_at'], new DateTimeZone('UTC'));
- Exclude checks
Variable "_vendor_data" is not in valid camel caps format Open
$clean_vendor_data = Database::escape_string($this->_vendor_data);
- Exclude checks
Variable "package_id" is not in valid camel caps format Open
public static function findByPackageId($package_id)
- Exclude checks
Variable "_package_format" is not in valid camel caps format Open
return $this->_package_format;
- Exclude checks
Variable "_package_type" is not in valid camel caps format Open
$this->_package_type = $request->getPackageType();
- Exclude checks
Variable "_package_type_version" is not in valid camel caps format Open
$this->_package_type_version = $request['package_type_version'];
- Exclude checks
Variable "sql_query" is not in valid camel caps format Open
$results = Database::query($sql_query);
- Exclude checks
Variable "sql_query" is not in valid camel caps format Open
$sql_query = "INSERT INTO $table (pens_version, package_type, package_type_version, package_format, package_id, client, vendor_data, package_name, created_at) VALUES (".
- Exclude checks
Variable "_pens_version" is not in valid camel caps format Open
"'".$this->_pens_version."', ".
- Exclude checks
Variable "_package_id" is not in valid camel caps format Open
$this->_package_id = $request->getPackageId();
- Exclude checks
Variable "created_at" is not in valid camel caps format Open
"'".$created_at."') ON DUPLICATE KEY UPDATE ".
- Exclude checks
Variable "_pens_version" is not in valid camel caps format Open
$this->_pens_version = $request['pens_version'];
- Exclude checks
Variable "sql_query" is not in valid camel caps format Open
$sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';";
- Exclude checks
Variable "_updated_at" is not in valid camel caps format Open
$this->_updated_at = new DateTime($request['updated_at'], new DateTimeZone('UTC'));
- Exclude checks
Variable "clean_package_id" is not in valid camel caps format Open
$clean_package_id = Database::escape_string($this->_package_id);
- Exclude checks
Variable "_package_id" is not in valid camel caps format Open
$clean_package_id = Database::escape_string($this->_package_id);
- Exclude checks
Variable "clean_package_type_version" is not in valid camel caps format Open
"'".$clean_package_type_version."', ".
- Exclude checks
Variable "_package_format" is not in valid camel caps format Open
"'".$this->_package_format."', ".
- Exclude checks
Missing function doc comment Open
public function getPackageName()
- Exclude checks
Variable "_vendor_data" is not in valid camel caps format Open
$this->_vendor_data = $request->getVendorData();
- Exclude checks
Variable "clean_vendor_data" is not in valid camel caps format Open
$clean_vendor_data = Database::escape_string($this->_vendor_data);
- Exclude checks
Variable "_package_id" is not in valid camel caps format Open
return $this->_package_id;
- Exclude checks
Variable "_package_type_version" is not in valid camel caps format Open
$this->_package_type_version = $request->getPackageTypeVersion();
- Exclude checks
Variable "_package_format" is not in valid camel caps format Open
$this->_package_format = $request->getPackageFormat();
- Exclude checks
Variable "clean_client" is not in valid camel caps format Open
"'".$clean_client."', ".
- Exclude checks
Missing function doc comment Open
public function getId()
- Exclude checks
Member variable "_package_name" is not in valid camel caps format Open
protected $_package_name = null;
- Exclude checks
Property name "$_created_at" should not be prefixed with an underscore to indicate visibility Open
protected $_created_at = null;
- Exclude checks
Variable "_package_name" is not in valid camel caps format Open
$this->_package_name = $request->getFilename();
- Exclude checks
Variable "_vendor_data" is not in valid camel caps format Open
$this->_vendor_data = $request['vendor_data'];
- Exclude checks
Variable "_package_type_version" is not in valid camel caps format Open
$clean_package_type_version = Database::escape_string($this->_package_type_version);
- Exclude checks
Variable "clean_client" is not in valid camel caps format Open
$clean_client = Database::escape_string($this->_client);
- Exclude checks
Missing function doc comment Open
public function getVendorData()
- Exclude checks
Variable "clean_vendor_data" is not in valid camel caps format Open
"'".$clean_vendor_data."', ".
- Exclude checks
Variable "sql_query" is not in valid camel caps format Open
$results = Database::query($sql_query);
- Exclude checks
Variable "_pens_version" is not in valid camel caps format Open
return $this->_pens_version;
- Exclude checks
Variable "_package_type" is not in valid camel caps format Open
return $this->_package_type;
- Exclude checks
Property name "$_updated_at" should not be prefixed with an underscore to indicate visibility Open
protected $_updated_at = null;
- Exclude checks
Variable "_package_type" is not in valid camel caps format Open
$this->_package_type = $request['package_type'];
- Exclude checks
Variable "_package_type_version" is not in valid camel caps format Open
return $this->_package_type_version;
- Exclude checks
Member variable "_vendor_data" is not in valid camel caps format Open
protected $_vendor_data = null;
- Exclude checks
Property name "$_package_name" should not be prefixed with an underscore to indicate visibility Open
protected $_package_name = null;
- Exclude checks
Variable "clean_package_type_version" is not in valid camel caps format Open
$clean_package_type_version = Database::escape_string($this->_package_type_version);
- Exclude checks
Variable "created_at" is not in valid camel caps format Open
$created_at = api_get_utc_datetime();
- Exclude checks
Variable "clean_package_id" is not in valid camel caps format Open
"'".$clean_package_id."', ".
- Exclude checks
Variable "_package_name" is not in valid camel caps format Open
"'".$this->_package_name."', ".
- Exclude checks
Member variable "_pens_version" is not in valid camel caps format Open
protected $_pens_version = null;
- Exclude checks
Variable "sql_query" is not in valid camel caps format Open
$sql_query = "SELECT * FROM $table ORDER BY created_at;";
- Exclude checks
Member variable "_package_type" is not in valid camel caps format Open
protected $_package_type = null;
- Exclude checks
Property name "$_package_type_version" should not be prefixed with an underscore to indicate visibility Open
protected $_package_type_version = null;
- Exclude checks
Variable "_package_format" is not in valid camel caps format Open
$this->_package_format = $request['package_format'];
- Exclude checks
Variable "_package_id" is not in valid camel caps format Open
$this->_package_id = $request['package_id'];
- Exclude checks
Variable "created_at" is not in valid camel caps format Open
"updated_at = '".$created_at."';";
- Exclude checks
Missing function doc comment Open
public function getPackageType()
- Exclude checks
Missing function doc comment Open
public function getClient()
- Exclude checks
Variable "_vendor_data" is not in valid camel caps format Open
return $this->_vendor_data;
- Exclude checks
Member variable "_updated_at" is not in valid camel caps format Open
protected $_updated_at = null;
- Exclude checks
Variable "_pens_version" is not in valid camel caps format Open
$this->_pens_version = $request->getPensVersion();
- Exclude checks
Variable "_package_name" is not in valid camel caps format Open
$this->_package_name = $request['package_name'];
- Exclude checks
Variable "_package_type" is not in valid camel caps format Open
"'".$this->_package_type."', ".
- Exclude checks
Variable "sql_query" is not in valid camel caps format Open
Database::query($sql_query);
- Exclude checks
Variable "package_id" is not in valid camel caps format Open
$sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';";
- Exclude checks
Missing function doc comment Open
public function getPackageId()
- Exclude checks
Missing function doc comment Open
public function getPensVersion()
- Exclude checks
Variable "_package_name" is not in valid camel caps format Open
return $this->_package_name;
- Exclude checks
Variable "_created_at" is not in valid camel caps format Open
return $this->_created_at;
- Exclude checks
Missing function doc comment Open
public function getPackageTypeVersion()
- Exclude checks
Missing function doc comment Open
public function getCreatedAt()
- Exclude checks
The variable $clean_client is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $created_at is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $sql_query is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $sql_query is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $sql_query is not named in camelCase. Open
public static function findByPackageId($package_id)
{
$table = Database::get_main_table(self::TABLE_NAME);
$sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';";
$results = Database::query($sql_query);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_package_type_version is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_package_id is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $sql_query is not named in camelCase. Open
public static function findAll()
{
$table = Database::get_main_table(self::TABLE_NAME);
$sql_query = "SELECT * FROM $table ORDER BY created_at;";
$results = Database::query($sql_query);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_client is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_vendor_data is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_vendor_data is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $package_id is not named in camelCase. Open
public static function findByPackageId($package_id)
{
$table = Database::get_main_table(self::TABLE_NAME);
$sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';";
$results = Database::query($sql_query);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $created_at is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_package_id is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $created_at is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $sql_query is not named in camelCase. Open
public static function findAll()
{
$table = Database::get_main_table(self::TABLE_NAME);
$sql_query = "SELECT * FROM $table ORDER BY created_at;";
$results = Database::query($sql_query);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $clean_package_type_version is not named in camelCase. Open
public function save()
{
$clean_package_type_version = Database::escape_string($this->_package_type_version);
$clean_package_id = Database::escape_string($this->_package_id);
$clean_client = Database::escape_string($this->_client);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $sql_query is not named in camelCase. Open
public static function findByPackageId($package_id)
{
$table = Database::get_main_table(self::TABLE_NAME);
$sql_query = "SELECT * FROM $table WHERE package_id = '".$package_id."';";
$results = Database::query($sql_query);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}