Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#682)
by Timur
06:41
created

ExpressionConverter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 1
b 0
f 0
dl 0
loc 24
ccs 11
cts 11
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A convert() 0 5 1
A __construct() 0 3 1
A check() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Generator\Converter;
6
7
use Murtukov\PHPCodeGenerator\ConverterInterface;
8
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionLanguage;
9
10
class ExpressionConverter implements ConverterInterface
11
{
12
    private ExpressionLanguage $expressionLanguage;
13
14 143
    public function __construct(ExpressionLanguage $expressionLanguage)
15
    {
16 143
        $this->expressionLanguage = $expressionLanguage;
17 143
    }
18
19 26
    public function convert($value)
20
    {
21 26
        return $this->expressionLanguage->compile(
22 26
            ExpressionLanguage::unprefixExpression($value),
23 26
            ExpressionLanguage::KNOWN_NAMES
24
        );
25
    }
26
27 37
    public function check($maybeExpression): bool
28
    {
29 37
        if (\is_string($maybeExpression)) {
30 37
            return ExpressionLanguage::stringHasTrigger($maybeExpression);
31
        }
32
33 3
        return false;
34
    }
35
}
36