Completed
Push — master ( b4b898...f81b53 )
by Woody
11s
created

src/Partial/LikeEnds.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
declare(strict_types=1);
3
4
namespace Latitude\QueryBuilder\Partial;
5
6
use Latitude\QueryBuilder\EngineInterface;
7
use Latitude\QueryBuilder\StatementInterface;
8
9 View Code Duplication
final class LikeEnds implements StatementInterface
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    /** @var string */
12
    private $value;
13
14 1
    public function __construct(string $value)
15
    {
16 1
        $this->value = $value;
17 1
    }
18
19 1
    public function sql(EngineInterface $engine): string
20
    {
21 1
        return '?';
22
    }
23
24 1
    public function params(EngineInterface $engine): array
25
    {
26 1
        $value = $engine->escapeLike($this->value);
27 1
        return ["%$value"];
28
    }
29
}
30