views_handler_argument_boincteam_id::construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * views_handler_argument_boincteam_id: This handler is used to convert
5
 * the Drupal group ID passed as a URL argument into a BOINC team ID
6
 * for accessing data in the BOINC database.
7
 */
8
9
class views_handler_argument_boincteam_id extends views_handler_argument_numeric {
0 ignored issues
show
Bug introduced by
The type views_handler_argument_numeric was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
  function construct() {
11
    parent::construct();
12
  }
13
14
  function set_argument($arg) {
15
    // When setting the ID argument, convert to BOINC ID
16
    $id = is_numeric($arg) ? $arg : 0;
17
    $boinc_id = db_result(db_query("SELECT team_id FROM {boincteam} WHERE nid = %d", $id));
18
    $this->argument = $boinc_id;
19
    return $this->validate_arg($boinc_id);
20
  }
21
}
22