Passed
Push — etls ( 3c161b )
by Fabrice
11:34
created

SlashPath   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A slashPath() 0 5 2
1
<?php
2
3
/*
4
 * This file is part of YaEtl
5
 *     (c) Fabrice de Stefanis / https://github.com/fab2s/YaEtl
6
 * This source file is licensed under the MIT license which you will
7
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
8
 */
9
10
namespace fab2s\YaEtl\Etl\Streams\Traits;
11
12
trait SlashPath
13
{
14
    public function slashPath(string $path) : string
15
    {
16
        $path = rtrim($path, '/');
17
18
        return $path . ($path ? '/' : '');
19
    }
20
}
21