ModeDependentServiceEndpoint::useSandbox()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Mdb\PayPal\Ipn\ListenerBuilder;
4
5
trait ModeDependentServiceEndpoint
6
{
7
    /**
8
     * @var bool
9
     */
10
    private $useSandbox = false;
11
12
    public function useSandbox()
13
    {
14
        $this->useSandbox = true;
15
    }
16
17
    protected function getServiceEndpoint() : string
18
    {
19
        return ($this->useSandbox) ?
20
            'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr' :
21
            'https://ipnpb.paypal.com/cgi-bin/webscr';
22
    }
23
}
24