chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/specific_fields_manager.lib.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using undefined variables such as '$return_array' which will lead to PHP notices.
Open

    return $return_array;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$return_array' which will lead to PHP notices.
Open

        $return_array[] = $result;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

The method add_specific_field uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        return false;
    }

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 add_specific_field_value uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        return false;
    }

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 $ref_id is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 parameter $course_id is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 parameter $course_id is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 parameter $ref_id is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 parameter $id_specific_field is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 parameter $tool_id is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 parameter $course_code is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 parameter $tool_id is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 parameter $order_by is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 parameter $id_specific_field is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 parameter $ref_id is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 parameter $tool_id is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 parameter $ref_id is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 parameter $tool_id is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 parameter $course_id is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 parameter $order_by is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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

Consider putting global function "add_specific_field" in a static class
Open

function add_specific_field($name)

Variable "table_sf_val" is not in valid camel caps format
Open

$table_sf_val = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

Variable "_safe_name" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf, $_safe_code, $_safe_name);

Variable "table_sf" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf, $id);

Variable "_safe_code" is not in valid camel caps format
Open

    $_safe_code = get_specific_field_code_from_name($_safe_code);

Variable "table_sf" is not in valid camel caps format
Open

    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "table_sf" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf, $_safe_code, $_safe_name);

Variable "_safe_name" is not in valid camel caps format
Open

    $_safe_name = Database::escape_string($name);

Variable "table_sf" is not in valid camel caps format
Open

    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "table_sf" is not in valid camel caps format
Open

    $sql = "SELECT * FROM $table_sf";

Variable "table_sf" is not in valid camel caps format
Open

    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "_safe_name" is not in valid camel caps format
Open

    $_safe_code = substr($_safe_name, 0, 1);

Variable "table_sf" is not in valid camel caps format
Open

$table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "_safe_code" is not in valid camel caps format
Open

    $_safe_code = get_specific_field_code_from_name($_safe_code);

Consider putting global function "edit_specific_field" in a static class
Open

function edit_specific_field($id, $name)

Variable "table_sf" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf, $name, $id);

Variable "return_array" is not in valid camel caps format
Open

    $return_array = [];

Variable "order_by" is not in valid camel caps format
Open

function get_specific_field_list($conditions = [], $order_by = [])

Variable "conditions_string_array" is not in valid camel caps format
Open

        $conditions_string_array = [];

Variable "table_sf" is not in valid camel caps format
Open

    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "_safe_code" is not in valid camel caps format
Open

    if (false === $_safe_code) {

Variable "_safe_code" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf, $_safe_code, $_safe_name);

Variable "_safe_code" is not in valid camel caps format
Open

    $_safe_code = substr($_safe_name, 0, 1);

Consider putting global function "delete_specific_field" in a static class
Open

function delete_specific_field($id)

Consider putting global function "get_specific_field_list" in a static class
Open

function get_specific_field_list($conditions = [], $order_by = [])

Variable "conditions_string_array" is not in valid camel caps format
Open

            $conditions_string_array[] = $field.' = '.$value;

Variable "order_by" is not in valid camel caps format
Open

        $sql .= ' ORDER BY '.implode(',', $order_by);

Variable "return_array" is not in valid camel caps format
Open

        $return_array[] = $result;

Consider putting global function "get_specific_field_values_list_by_prefix" in a static class
Open

function get_specific_field_values_list_by_prefix(

Variable "tool_id" is not in valid camel caps format
Open

        $tool_id,

Variable "course_info" is not in valid camel caps format
Open

            $conditions['course_code'] = " '".$course_info['code']."' ";

Variable "conditions_string_array" is not in valid camel caps format
Open

        $conditions_string_array = [];

Variable "sql_result" is not in valid camel caps format
Open

    $sql_result = Database::query($sql);

Variable "table_sfv" is not in valid camel caps format
Open

    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

Variable "table_sfv" is not in valid camel caps format
Open

        $table_sfv,

Variable "table_sf" is not in valid camel caps format
Open

    $sql = "SELECT code FROM $table_sf ORDER BY code";

Variable "ref_id" is not in valid camel caps format
Open

    $ref_id

Variable "ref_id" is not in valid camel caps format
Open

        $ref_id

Variable "table_sf_values" is not in valid camel caps format
Open

        $table_sf_values,

Missing parameter name
Open

 * @param   string  Tool ID

Missing parameter name
Open

 * @param   int     Internal ID used in specific tool table

Variable "ref_id" is not in valid camel caps format
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)

Variable "conditions_string_array" is not in valid camel caps format
Open

        $sql .= implode(' AND ', $conditions_string_array);

Variable "tool_id" is not in valid camel caps format
Open

        $tool_id,

Variable "return_array" is not in valid camel caps format
Open

        $return_array[] = $result;

Variable "tool_id" is not in valid camel caps format
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)

Consider putting global function "get_specific_field_code_from_name" in a static class
Open

function get_specific_field_code_from_name($name)

Variable "course_code" is not in valid camel caps format
Open

    $course_code,

Variable "tool_id" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

Variable "return_array" is not in valid camel caps format
Open

    $return_array = [];

Variable "ref_id" is not in valid camel caps format
Open

        $ref_id,

Variable "ref_id" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

Variable "table_sfv" is not in valid camel caps format
Open

    $sql = "SELECT * FROM $table_sfv";

Variable "conditions_string_array" is not in valid camel caps format
Open

            $conditions_string_array[] = $field.' = '.$value;

Variable "course_id" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

Variable "id_specific_field" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

Missing parameter name
Open

 * @param   string  Name

Consider putting global function "get_specific_field_values_list" in a static class
Open

function get_specific_field_values_list(

Variable "table_sfv" is not in valid camel caps format
Open

    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

Variable "return_array" is not in valid camel caps format
Open

        $return_array[] = $result;

Variable "table_sf" is not in valid camel caps format
Open

    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "return_array" is not in valid camel caps format
Open

    return $return_array;

Variable "ref_id" is not in valid camel caps format
Open

    $ref_id,

Variable "course_id" is not in valid camel caps format
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)

Variable "table_sf_values" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

Variable "id_specific_field" is not in valid camel caps format
Open

    $id_specific_field,

Variable "course_id" is not in valid camel caps format
Open

    $course_id,

Variable "course_id" is not in valid camel caps format
Open

        $course_id,

Variable "table_sf_values" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

Variable "ref_id" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

Variable "existing_list" is not in valid camel caps format
Open

        if (!in_array($list[$i], $existing_list)) {

Variable "conditions_string_array" is not in valid camel caps format
Open

        $sql .= implode(' AND ', $conditions_string_array);

Variable "sql_result" is not in valid camel caps format
Open

    $sql_result = Database::query($sql);

Variable "course_code" is not in valid camel caps format
Open

        $course_code,

Variable "tool_id" is not in valid camel caps format
Open

    $tool_id,

Consider putting global function "delete_all_specific_field_value" in a static class
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)

Variable "id_specific_field" is not in valid camel caps format
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)

Variable "existing_list" is not in valid camel caps format
Open

    if (!in_array($code, $existing_list)) {

Variable "return_array" is not in valid camel caps format
Open

    return $return_array;

Variable "sql_result" is not in valid camel caps format
Open

    while ($result = Database::fetch_array($sql_result)) {

Variable "table_sf_values" is not in valid camel caps format
Open

    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

Variable "sql_result" is not in valid camel caps format
Open

    while ($result = Database::fetch_array($sql_result)) {

Variable "order_by" is not in valid camel caps format
Open

    $order_by = []

Variable "course_info" is not in valid camel caps format
Open

            $course_info = api_get_course_info_by_id(intval($conditions['c_id']));

Variable "sql_result" is not in valid camel caps format
Open

    while ($result = Database::fetch_array($sql_result)) {

Variable "table_sf" is not in valid camel caps format
Open

        $table_sf,

Variable "sql_result" is not in valid camel caps format
Open

    $sql_result = Database::query($sql);

Variable "tool_id" is not in valid camel caps format
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)

Consider putting global function "delete_all_values_for_item" in a static class
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)

Variable "tool_id" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

Variable "table_sf" is not in valid camel caps format
Open

    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);

Variable "existing_list" is not in valid camel caps format
Open

    $existing_list = [];

Variable "order_by" is not in valid camel caps format
Open

    if (count($order_by) > 0) {

Variable "order_by" is not in valid camel caps format
Open

        $sql .= ' ORDER BY '.implode(',', $order_by);

Variable "return_array" is not in valid camel caps format
Open

    return $return_array;

Variable "tool_id" is not in valid camel caps format
Open

    $tool_id,

Variable "table_sf_values" is not in valid camel caps format
Open

    $table_sf_values = Database::get_main_table(

Variable "ref_id" is not in valid camel caps format
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)

Variable "course_id" is not in valid camel caps format
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)

Variable "existing_list" is not in valid camel caps format
Open

        $existing_list[] = $row['code'];

Consider putting global function "add_specific_field_value" in a static class
Open

function add_specific_field_value(

Variable "table_sf_values" is not in valid camel caps format
Open

    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

Variable "course_id" is not in valid camel caps format
Open

    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

Variable "order_by" is not in valid camel caps format
Open

    if (count($order_by) > 0) {

Variable "id_specific_field" is not in valid camel caps format
Open

        $id_specific_field,

Missing parameter name
Open

 * @param   string  Course code

The variable $table_sf is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $course_info is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $_safe_code is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $conditions_string_array is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $table_sf is not named in camelCase.
Open

function delete_specific_field($id)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $id = (int) $id;
    if (!is_numeric($id)) {

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 $_safe_code is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $_safe_name is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $conditions_string_array is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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_result is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $table_sf is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $_safe_name is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $table_sf is not named in camelCase.
Open

function delete_specific_field($id)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $id = (int) $id;
    if (!is_numeric($id)) {

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 $_safe_code is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $_safe_code is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $_safe_code is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $return_array is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $ref_id is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $table_sf is not named in camelCase.
Open

function edit_specific_field($id, $name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $id = (int) $id;
    if (!is_numeric($id)) {

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 $table_sf is not named in camelCase.
Open

function edit_specific_field($id, $name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $id = (int) $id;
    if (!is_numeric($id)) {

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 $_safe_name is not named in camelCase.
Open

function add_specific_field($name)
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $name = trim($name);
    if (empty($name)) {

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 $return_array is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $return_array is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $table_sfv is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $id_specific_field is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 $course_id is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 $ref_id is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 $table_sf is not named in camelCase.
Open

function get_specific_field_code_from_name($name)
{
    // Z is used internally by Xapian
    // O & C already used by tool_id and course_id
    $list = [

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 $table_sf_values is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 $course_id is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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_result is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $table_sfv is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $table_sf is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $conditions_string_array is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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_result is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $ref_id is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 $table_sf_values is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 $order_by is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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_result is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $tool_id is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $table_sf_values is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 $existing_list is not named in camelCase.
Open

function get_specific_field_code_from_name($name)
{
    // Z is used internally by Xapian
    // O & C already used by tool_id and course_id
    $list = [

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 $order_by is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $table_sfv is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $course_info is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $return_array is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $return_array is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $return_array is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $conditions_string_array is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $table_sf is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $table_sf_values is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 $table_sf is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $conditions_string_array is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $course_code is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $existing_list is not named in camelCase.
Open

function get_specific_field_code_from_name($name)
{
    // Z is used internally by Xapian
    // O & C already used by tool_id and course_id
    $list = [

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 $return_array is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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_result is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $return_array is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $order_by is not named in camelCase.
Open

function get_specific_field_list($conditions = [], $order_by = [])
{
    $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
    $return_array = [];
    $sql = "SELECT * FROM $table_sf";

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 $conditions_string_array is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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_result is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $table_sf_values is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 $table_sf_values is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 $tool_id is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 $tool_id is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 $table_sf is not named in camelCase.
Open

function get_specific_field_code_from_name($name)
{
    // Z is used internally by Xapian
    // O & C already used by tool_id and course_id
    $list = [

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 $ref_id is not named in camelCase.
Open

function delete_all_values_for_item($course_id, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);

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 $tool_id is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 $existing_list is not named in camelCase.
Open

function get_specific_field_code_from_name($name)
{
    // Z is used internally by Xapian
    // O & C already used by tool_id and course_id
    $list = [

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 $course_id is not named in camelCase.
Open

function add_specific_field_value(
    $id_specific_field,
    $course_id,
    $tool_id,
    $ref_id,

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 $id_specific_field is not named in camelCase.
Open

function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id)
{
    $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s';
    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field);

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 $order_by is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $table_sfv is not named in camelCase.
Open

function get_specific_field_values_list(
    $conditions = [],
    $order_by = []
) {
    $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);

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 $table_sf is not named in camelCase.
Open

function get_specific_field_values_list_by_prefix(
    $prefix,
    $course_code,
    $tool_id,
    $ref_id

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 $existing_list is not named in camelCase.
Open

function get_specific_field_code_from_name($name)
{
    // Z is used internally by Xapian
    // O & C already used by tool_id and course_id
    $list = [

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

There are no issues that match your filters.

Category
Status