Completed
Push — master ( cb2c73...1a2628 )
by Aleh
12s
created

AbstractInCodeBodyCompleter::canHandle()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.2
cc 4
eloc 6
nc 4
nop 2
1
<?php
2
3
namespace Padawan\Domain\Completer;
4
5
use Padawan\Domain\Core\Project;
6
use Padawan\Domain\Core\Completion\Context;
7
use Padawan\Domain\Core\Completion\Scope\FileScope;
8
use Padawan\Domain\Core\Completion\Scope\MethodScope;
9
use Padawan\Domain\Core\Completion\Scope\ClosureScope;
10
use Padawan\Domain\Core\Completion\Scope\FunctionScope;
11
12
/**
13
 * Class AbstractInCodeBodyCompleter
14
 */
15
abstract class AbstractInCodeBodyCompleter implements CompleterInterface
16
{
17
18
    public function canHandle(Project $project, Context $context)
19
    {
20
        $scope = $context->getScope();
21
        return $scope instanceof FileScope
22
            || $scope instanceof FunctionScope
23
            || $scope instanceof MethodScope
24
            || $scope instanceof ClosureScope;
25
    }
26
}
27