From   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
dl 0
loc 20
wmc 3
lcom 1
cbo 1
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
A toString() 0 4 1
1
<?php
2
3
namespace Muffin\Queries\Snippets;
4
5
use Muffin\Snippet;
6
7
class From implements Snippet
8
{
9
    private
10
        $tableName;
11
12 36
    public function __construct($table, $alias = null)
13
    {
14 36
        if(! $table instanceof TableName)
15 36
        {
16 34
            $table = new TableName($table, $alias);
17 32
        }
18
19 34
        $this->tableName = $table;
20 34
    }
21
22 32
    public function toString()
23
    {
24 32
        return sprintf('FROM %s', $this->tableName->toString());
25
    }
26
}
27