Passed
Push — master ( 7f61ea...38db0f )
by Russell
13:01
created

BackendVerificationJob::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @author  Russell Michell 2018 <[email protected]>
5
 * @package silverstripe-verifiable
6
 */
7
8
namespace PhpTek\Verifiable\Job;
9
10
use Symbiote\QueuedJobs\Services\AbstractQueuedJob;
0 ignored issues
show
Bug introduced by
The type Symbiote\QueuedJobs\Services\AbstractQueuedJob was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
/**
13
 * Simple job to verify a hash against a backend and on success, receive and
14
 * save a chainpoint proof.
15
 */
16
class BackendVerificationJob extends AbstractQueuedJob
17
{
18
    /**
19
     * @return string
20
     */
21
    public function getSignature() : string
22
    {
23
        return $this->verifiableService->hash($model->normaliseData());
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $model seems to be never defined.
Loading history...
24
    }
25
26
    /**
27
     * Do the work to ping the remote backend.
28
     *
29
     * @return void
30
     */
31
    public function process()
32
    {
33
        $body = $this->verifiableService->read($this->getSignature());
34
35
        // TODO
36
        // What does a valid/invalid response look like?
37
        if ($isValid) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $isValid seems to be never defined.
Loading history...
38
            $this->getObject()->setField('Proof', $body)->write();
39
        }
40
    }
41
42
}
43