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.

CreateSMSTransform::transform()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace LBHurtado\Missive\Transforms;
4
5
use League\Tactician\Middleware;
6
use LBHurtado\Missive\Facades\Missive;
7
8
class CreateSMSTransform implements Middleware
9
{
10
    public function execute($command, callable $next)
11
    {
12
    	$transformedProperties = $this->transform($command->getProperties());
13
    	$command->setPropertiesForValidation($transformedProperties);
14
15
        return $next($command);
16
    }
17
18
    public function transform(array $attributes)
19
    {
20
        $mapping = Missive::getRelayProviderConfig();
21
22
        foreach ($mapping as $key => $value) {
23
            $$key = $value;
24
        }
25
26
        $transformer = [
27
            $from => phone($attributes[$from], 'PH')->formatE164(),
0 ignored issues
show
Bug introduced by
The variable $from does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
28
            $to => phone($attributes[$to], 'PH')->formatE164(),
0 ignored issues
show
Bug introduced by
The variable $to does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
29
            $message => trim($attributes[$message]),
0 ignored issues
show
Bug introduced by
The variable $message does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
30
        ];
31
32
        return $transformer;
33
    }
34
}
35