MockSmsHandler::lookupNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * This file is part of the Apiary SMS Login Provider package.
4
 *
5
 * (c) Darren Mothersele <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Apiary\SmsLoginProvider\SmsHandler;
0 ignored issues
show
Coding Style introduced by
There must be one blank line after the namespace declaration
Loading history...
12
13
14
use Silex\Application;
15
16
class MockSmsHandler implements SmsHandlerInterface
17
{
18
    protected $from;
19
    protected $container;
20
21 6
    public function __construct(Application $app)
22
    {
23 6
        $this->container = $app;
24 6
    }
25
26
    public function setDefaultFrom($from)
27
    {
28
        $this->from = $from;
29
    }
30
31 3
    public function lookupNumber($number, $countryCode)
32
    {
33 3
        $code = $this->container['session']->get('code');
34 3
        $fakeNumber = "+15005550000 ({$code})";
35 3
        return $fakeNumber;
36
    }
37
38 3
    public function sendSMS($to, $body, $from = null)
39
    {
40 3
        $fakeSid = 1;
41 3
        return $fakeSid;
42
    }
43
44
}
0 ignored issues
show
Coding Style introduced by
According to PSR2, the closing brace of classes should be placed on the next line directly after the body.

Below you find some examples:

// Incorrect placement according to PSR2
class MyClass
{
    public function foo()
    {

    }
    // This blank line is not allowed.

}

// Correct
class MyClass
{
    public function foo()
    {

    } // No blank lines after this line.
}
Loading history...