WindowsFileAppenderTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A _joinPaths() 0 4 1
A _isAtom() 0 4 1
1
<?php
2
namespace Nubs\Which\PathBuilder;
3
4
/**
5
 * Appends filenames to an array of paths.
6
 */
7
trait WindowsFileAppenderTrait
8
{
9
    use FileAppenderTrait;
10
11
    /**
12
     * Joins two path segments together.
13
     *
14
     * @param string $start The starting segment.
15
     * @param string $end The ending segment.
16
     * @return string The joined segments.
17
     */
18
    protected function _joinPaths($start, $end)
19
    {
20
        return "{$start}\\{$end}";
21
    }
22
23
    /**
24
     * Checks to see if a path is just a single atom (no directory).
25
     *
26
     * @param string $path The path to check.
27
     * @return boolean True if it's an atom, false otherwise.
28
     */
29
    protected function _isAtom($path)
30
    {
31
        return strpos($path, '\\') === false;
32
    }
33
}
34