Completed
Push — refactor ( d2218a )
by Akihito
01:47
created

Code::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Aop;
6
7
final class Code
8
{
9
    /**
10
     * @var string
11
     */
12
    public $code;
13
14
    public function save(string $classDir, string $aopClassName) : string
15
    {
16
        $flatName = str_replace('\\', '_', $aopClassName);
17
        $file = sprintf('%s/%s.php', $classDir, $flatName);
18
        file_put_contents($file, $this->code . PHP_EOL);
19
20
        return $file;
21
    }
22
}
23