Code Duplication    Length = 11-12 lines in 6 locations

src/ErrorReporters/ErrorPrinter.php 6 locations

@@ 31-41 (lines=11) @@
28
            ->link($absPath, $lineNumber));
29
    }
30
31
    public function route($path, $errorIt, $errorTxt, $absPath = null, $lineNumber = 0)
32
    {
33
        if (LaravelPaths::isIgnored($absPath)) {
34
            return;
35
        }
36
37
        ($this->errorsList['route'][] = (new PendingError('route'))
38
            ->header($errorIt)
39
            ->errorData($errorTxt.$this->yellow($path))
40
            ->link($absPath, $lineNumber));
41
    }
42
43
    public function bladeImport($class, $absPath, $lineNumber)
44
    {
@@ 60-70 (lines=11) @@
57
        $this->pendError($absPath, $lineNumber, $relatedModel, 'badRelation', $header);
58
    }
59
60
    public function pendError($path, $lineNumber, $absent, $key, $header)
61
    {
62
        if (LaravelPaths::isIgnored($path)) {
63
            return;
64
        }
65
66
        ($this->errorsList[$key][] = (new PendingError($key))
67
            ->header($header)
68
            ->errorData($this->yellow($absent).'   <==== does not exist')
69
            ->link($path, $lineNumber));
70
    }
71
72
    public function routelessAction($absPath, $lineNumber, $action)
73
    {
@@ 72-83 (lines=12) @@
69
            ->link($path, $lineNumber));
70
    }
71
72
    public function routelessAction($absPath, $lineNumber, $action)
73
    {
74
        if (LaravelPaths::isIgnored($absPath)) {
75
            return;
76
        }
77
78
        $key = 'routelessCtrl';
79
        ($this->errorsList[$key][] = (new PendingError($key))
80
            ->header('No route is defined for controller action:')
81
            ->errorData($this->yellow($action))
82
            ->link($absPath, $lineNumber));
83
    }
84
85
    public function simplePendError($path, $lineNumber, $absent, $key, $header)
86
    {
@@ 85-95 (lines=11) @@
82
            ->link($absPath, $lineNumber));
83
    }
84
85
    public function simplePendError($path, $lineNumber, $absent, $key, $header)
86
    {
87
        if (LaravelPaths::isIgnored($path)) {
88
            return;
89
        }
90
91
        ($this->errorsList[$key][] = (new PendingError($key))
92
            ->header($header)
93
            ->errorData($this->yellow($absent))
94
            ->link($path, $lineNumber));
95
    }
96
97
    public function wrongImport($absPath, $class, $lineNumber)
98
    {
@@ 102-112 (lines=11) @@
99
        $this->pendError($absPath, $lineNumber, "use $class;", 'wrongImport', 'Wrong import:');
100
    }
101
102
    public function compactError($path, $lineNumber, $absent, $key, $header)
103
    {
104
        if (LaravelPaths::isIgnored($path)) {
105
            return;
106
        }
107
108
        ($this->errorsList[$key][] = (new PendingError($key))
109
            ->header($header)
110
            ->errorData($this->yellow(\implode(', ', array_keys($absent))).' does not exist')
111
            ->link($path, $lineNumber));
112
    }
113
114
    public function routeDefinitionConflict($route1, $route2, $info)
115
    {
@@ 156-167 (lines=12) @@
153
        $this->pendError($absPath, $lineNumber, $class, 'wrongUsedClassError', 'Class does not exist:');
154
    }
155
156
    public function queryInBlade($absPath, $class, $lineNumber)
157
    {
158
        if (LaravelPaths::isIgnored($absPath)) {
159
            return;
160
        }
161
162
        $key = 'queryInBlade';
163
        ($this->errorsList[$key][] = (new PendingError($key))
164
            ->header('Query in blade file: ')
165
            ->errorData($this->yellow($class).'  <=== DB query in blade file')
166
            ->link($absPath, $lineNumber));
167
    }
168
169
    public function wrongMethodError($absPath, $class, $lineNumber)
170
    {