Passed
Push — master ( 66552f...f7aa08 )
by Mihail
05:29
created

FormCommentModerate::getRecord()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Apps\Model\Admin\Comments;
4
5
use Ffcms\Core\Arch\Model;
6
7
class FormCommentModerate extends Model
8
{
9
    private $_records;
10
    private $_type;
11
12
    /**
13
     * FormCommentModerate constructor. Pass active record and type of comment system inside.
14
     * @param object $record
0 ignored issues
show
Documentation introduced by
There is no parameter named $record. Did you maybe mean $records?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
15
     * @param string $type
16
     */
17
    public function __construct($records, $type)
18
    {
19
        $this->_records = $records;
20
        $this->_type = $type;
21
        parent::__construct();
22
    }
23
24
    /**
25
     * Accept comments and answers
26
     */
27
    public function make()
28
    {
29
        $this->_records->update(['moderate' => 0]);
30
    }
31
32
    /**
33
     * Get moderated records
34
     * @return object
35
     */
36
    public function getRecord()
37
    {
38
        return $this->_records->get();
39
    }
40
}