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

SlashPath::slashPath()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 5
rs 10
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