SearchManipulateCapture_MySQLDatabase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A manipulate() 0 5 1
1
<?php
2
3
namespace SilverStripe\FullTextSearch\Search\Captures;
4
5
use SilverStripe\ORM\Connect\MySQLDatabase;
6
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
7
8
/**
9
 * @deprecated 3.1...4.0 Please use tractorcow/silverstripe-proxy-db to proxy the database connector instead
10
 */
11
12
class SearchManipulateCapture_MySQLDatabase extends MySQLDatabase
13
{
14
15
    public $isManipulationCapture = true;
16
17
    public function manipulate($manipulation)
18
    {
19
        $res = parent::manipulate($manipulation);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $res is correct as parent::manipulate($manipulation) targeting SilverStripe\ORM\Connect\Database::manipulate() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
20
        SearchUpdater::handle_manipulation($manipulation);
21
        return $res;
22
    }
23
}
24