Passed
Pull Request — master (#208)
by Robbie
03:34
created

ProxyDBExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateProxy() 0 6 1
1
<?php
2
3
namespace SilverStripe\FullTextSearch\Search\Extensions;
4
5
use SilverStripe\Core\Extension;
6
use TractorCow\ClassProxy\Generators\ProxyGenerator;
7
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
8
9
class ProxyDBExtension extends Extension
10
{
11
    public function updateProxy(ProxyGenerator &$proxy)
12
    {
13
        $proxy = $proxy->addMethod('manipulate', function ($args, $next) {
14
            $manipulation = $args[0];
15
            SearchUpdater::handle_manipulation($manipulation);
16
            return $next(...$args);
17
        });
18
    }
19
}
20