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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A transform() 0 16 2
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