Prettifyable::setPretty()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Viktoras\Scryfall\Client\Request\Traits;
4
5
use Viktoras\Scryfall\Enums;
6
7
trait Prettifyable
8
{
9
    /**
10
     * If true, the returned JSON will be prettified. Avoid using for production code.
11
     *
12
     * @var string
13
     */
14
    protected $pretty = Enums\Boolean::FALSE;
15
16
    public function isPretty(): string
17
    {
18
        return $this->pretty;
19
    }
20
21
    public function setPretty(bool $pretty): void
22
    {
23
        $this->pretty = $pretty ? Enums\Boolean::TRUE : Enums\Boolean::FALSE;
24
    }
25
}
26