Completed
Push — master ( 7233ee...46d0e2 )
by Greg
01:19
created

SshTransportFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 5 1
A create() 0 4 1
1
<?php
2
3
namespace Consolidation\SiteProcess\Factory;
4
5
use Consolidation\SiteAlias\AliasRecord;
6
use Consolidation\SiteProcess\Transport\SshTransport;
7
8
/**
9
 * SshTransportFactory will create an SshTransport for applicable site aliases.
10
 */
11
class SshTransportFactory implements TransportFactoryInterface
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function check(AliasRecord $siteAlias)
17
    {
18
        // TODO: deprecate and eventually remove 'isRemote()', and move the logic here.
19
        return $siteAlias->isRemote();
20
    }
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function create(AliasRecord $siteAlias)
26
    {
27
        return new SshTransport($siteAlias);
28
    }
29
}
30