DockerComposeTransportFactory::check()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Consolidation\SiteProcess\Factory;
4
5
use Consolidation\SiteAlias\SiteAliasInterface;
6
use Consolidation\SiteProcess\Transport\DockerComposeTransport;
7
use Consolidation\Config\ConfigInterface;
8
9
/**
10
 * DockerComposeTransportFactory will create an DockerComposeTransport for
11
 * applicable site aliases.
12
 */
13
class DockerComposeTransportFactory implements TransportFactoryInterface
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function check(SiteAliasInterface $siteAlias)
19
    {
20
        // TODO: deprecate and eventually remove 'isContainer()', and move the logic here.
21
        return $siteAlias->isContainer();
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function create(SiteAliasInterface $siteAlias)
28
    {
29
        return new DockerComposeTransport($siteAlias);
30
    }
31
}
32