Passed
Pull Request — master (#7)
by
unknown
02:09
created

Rollback::toJson()   A

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
 * @psalm-suppress MissingConstructor
24
 */
25
final class Rollback implements Command
26
{
27
    use JsonHelper;
28
29
    /**
30
     * @psalm-pure
31
     */
32
    public static function create(): self
33
    {
34
        return new self();
35
    }
36
37
    public function toJson(): string
38
    {
39
        return self::jsonEncode([], JSON_FORCE_OBJECT);
40
    }
41
42
    public function getName(): string
43
    {
44
        return 'rollback';
45
    }
46
}
47