LineFixer::fixIndentation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 3
1
<?php
2
declare(strict_types=1);
3
4
namespace Pluswerk\TypoScriptAutoFixer\Fixer\Indentation;
5
6
class LineFixer
7
{
8
    /**
9
     * @param $line
10
     * @param $amountOfIndentChars
11
     * @param $character
12
     *
13
     * @return string
14
     */
15
    public function fixIndentation($line, $amountOfIndentChars, $character): string
16
    {
17
        $indent = str_repeat($character, $amountOfIndentChars);
18
        $line = ltrim($line);
19
        return $indent . $line;
20
    }
21
}
22