GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 2809db...84b5a3 )
by Brent
01:29
created

ProcessOutput   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A setSuccess() 0 6 1
A isSuccess() 0 4 1
A payload() 0 4 1
A serialize() 0 4 1
1
<?php
2
3
namespace Spatie\Async\Output;
4
5
// TODO: Move to separate namespace
6
class ProcessOutput
7
{
8
    protected $payload;
9
    protected $success = false;
10
11
    public function __construct($payload)
12
    {
13
        $this->payload = $payload;
14
    }
15
16
    /**
17
     * @param $payload
18
     *
19
     * @return static
20
     */
21
    public static function create($payload)
22
    {
23
        return new static($payload);
24
    }
25
26
    public function setSuccess(bool $success = true): self
27
    {
28
        $this->success = $success;
29
30
        return $this;
31
    }
32
33
    public function isSuccess(): bool
34
    {
35
        return $this->success;
36
    }
37
38
    public function payload()
39
    {
40
        return $this->payload;
41
    }
42
43
    public function serialize()
44
    {
45
        return serialize($this);
46
    }
47
}
48