NoArgsConstructorDriver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A generator() 0 10 3
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
12
 * THE SOFTWARE.
13
 *
14
 * This software consists of voluntary contributions made by many individuals
15
 * and is licensed under the MIT license.
16
 *
17
 * Copyright (c) 2018 Yuuki Takezawa
18
 */
19
20
namespace Ytake\Lom\Factory;
21
22
use PhpParser\Node\Stmt\Class_;
23
24
/**
25
 * Class NoArgsConstructorDriver.
26
 *
27
 * @author  yuuki.takezawa<[email protected]>
28
 * @license http://opensource.org/licenses/MIT MIT
29
 */
30
class NoArgsConstructorDriver extends AbstractDriver
31
{
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function generator(): array
36
    {
37
        foreach ($this->parsed as $part) {
38
            if ($part instanceof Class_) {
39
                $this->removeConstructor($part);
40
            }
41
        }
42
43
        return $this->parsed;
44
    }
45
}
46