Test Failed
Push — main ( e78405...a0a7aa )
by chief
03:09
created

video_updater::playlist_update_row()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
* @Auther: bhief
5
* @Version: 1.0
6
*
7
* Updates video information
8
*
9
**/
10
class video_updater {
11
    public $__db;
12
13
	public function __construct($conn){
14
        $this->__db = $conn;
15
	}
16
17
    function update_row($video, $rowName, $new) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
18
        $stmt = $this->__db->prepare("UPDATE videos SET ".$rowName." = :new WHERE rid = :rid");
19
        $stmt->bindParam(":new", $new);
20
        $stmt->bindParam(":rid", $video);
21
        $stmt->execute();
22
        
23
        return true;
24
    }
25
26
    function playlist_update_row($video, $rowName, $new) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
27
        $stmt = $this->__db->prepare("UPDATE playlists SET ".$rowName." = :new WHERE rid = :rid");
28
        $stmt->bindParam(":new", $new);
29
        $stmt->bindParam(":rid", $video);
30
        $stmt->execute();
31
        
32
        return true;
33
    }
34
}
35
36
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...