Code Duplication    Length = 37-37 lines in 4 locations

src/Node/BoolNode.php 1 location

@@ 7-43 (lines=37) @@
4
5
namespace Saxulum\ElasticSearchQueryBuilder\Node;
6
7
final class BoolNode extends AbstractNode
8
{
9
    /**
10
     * @var bool|null
11
     */
12
    private $value;
13
14
    /**
15
     * @param bool|null $value
16
     * @param bool      $allowSerializeEmpty
17
     *
18
     * @return BoolNode
19
     */
20
    public static function create(bool $value = null, bool $allowSerializeEmpty = false): BoolNode
21
    {
22
        $node = new self();
23
        $node->value = $value;
24
        $node->allowSerializeEmpty = $allowSerializeEmpty;
25
26
        return $node;
27
    }
28
29
    public function serializeEmpty()
30
    {
31
        return;
32
    }
33
34
    /**
35
     * @return bool|null
36
     */
37
    public function serialize()
38
    {
39
        return $this->value;
40
    }
41
}
42

src/Node/FloatNode.php 1 location

@@ 7-43 (lines=37) @@
4
5
namespace Saxulum\ElasticSearchQueryBuilder\Node;
6
7
final class FloatNode extends AbstractNode
8
{
9
    /**
10
     * @var float|null
11
     */
12
    private $value;
13
14
    /**
15
     * @param float|null $value
16
     * @param bool       $allowSerializeEmpty
17
     *
18
     * @return FloatNode
19
     */
20
    public static function create(float $value = null, bool $allowSerializeEmpty = false): FloatNode
21
    {
22
        $node = new self();
23
        $node->value = $value;
24
        $node->allowSerializeEmpty = $allowSerializeEmpty;
25
26
        return $node;
27
    }
28
29
    public function serializeEmpty()
30
    {
31
        return;
32
    }
33
34
    /**
35
     * @return float|null
36
     */
37
    public function serialize()
38
    {
39
        return $this->value;
40
    }
41
}
42

src/Node/IntNode.php 1 location

@@ 7-43 (lines=37) @@
4
5
namespace Saxulum\ElasticSearchQueryBuilder\Node;
6
7
final class IntNode extends AbstractNode
8
{
9
    /**
10
     * @var int|null
11
     */
12
    private $value;
13
14
    /**
15
     * @param int|null $value
16
     * @param bool     $allowSerializeEmpty
17
     *
18
     * @return IntNode
19
     */
20
    public static function create(int $value = null, bool $allowSerializeEmpty = false): IntNode
21
    {
22
        $node = new self();
23
        $node->value = $value;
24
        $node->allowSerializeEmpty = $allowSerializeEmpty;
25
26
        return $node;
27
    }
28
29
    public function serializeEmpty()
30
    {
31
        return;
32
    }
33
34
    /**
35
     * @return int|null
36
     */
37
    public function serialize()
38
    {
39
        return $this->value;
40
    }
41
}
42

src/Node/StringNode.php 1 location

@@ 7-43 (lines=37) @@
4
5
namespace Saxulum\ElasticSearchQueryBuilder\Node;
6
7
final class StringNode extends AbstractNode
8
{
9
    /**
10
     * @var string|null
11
     */
12
    private $value;
13
14
    /**
15
     * @param string|null $value
16
     * @param bool        $allowSerializeEmpty
17
     *
18
     * @return StringNode
19
     */
20
    public static function create(string $value = null, bool $allowSerializeEmpty = false): StringNode
21
    {
22
        $node = new self();
23
        $node->value = $value;
24
        $node->allowSerializeEmpty = $allowSerializeEmpty;
25
26
        return $node;
27
    }
28
29
    public function serializeEmpty()
30
    {
31
        return;
32
    }
33
34
    /**
35
     * @return string|null
36
     */
37
    public function serialize()
38
    {
39
        return $this->value;
40
    }
41
}
42