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

Code   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A save() 0 8 1
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