Rollback::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Solr Client Symfony package.
7
 *
8
 * (c) ingatlan.com Zrt. <[email protected]>
9
 *
10
 * This source file is subject to the MIT license that is bundled
11
 * with this source code in the file LICENSE.
12
 */
13
14
namespace iCom\SolrClient\Query\Command;
15
16
use iCom\SolrClient\JsonHelper;
17
use iCom\SolrClient\Query\Command;
18
19
/**
20
 * @see https://lucene.apache.org/solr/guide/uploading-data-with-index-handlers.html#rollback-operations
21
 *
22
 * @psalm-immutable
23
 */
24
final class Rollback implements Command
25
{
26
    use JsonHelper;
27
28
    /**
29
     * @psalm-pure
30
     */
31
    public static function create(): self
32
    {
33
        return new self();
34
    }
35
36
    /**
37
     * @psalm-pure
38
     */
39
    public function toJson(): string
40
    {
41
        return self::jsonEncode([], JSON_FORCE_OBJECT);
42
    }
43
44
    /**
45
     * @psalm-pure
46
     */
47
    public function getName(): string
48
    {
49
        return 'rollback';
50
    }
51
}
52