@@ -63,6 +63,15 @@ class TechnicalDebt implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
63
63
*/
64
64
protected $ searches ;
65
65
66
+
67
+ /**
68
+ * Check if this plugin can be executed.
69
+ *
70
+ * @param $stage
71
+ * @param Builder $builder
72
+ * @param Build $build
73
+ * @return bool
74
+ */
66
75
public static function canExecute ($ stage , Builder $ builder , Build $ build )
67
76
{
68
77
if ($ stage == 'test ' ) {
@@ -99,6 +108,10 @@ public function __construct(Builder $phpci, Build $build, array $options = array
99
108
}
100
109
}
101
110
111
+ /**
112
+ * Handle this plugin's options.
113
+ * @param $options
114
+ */
102
115
protected function setOptions ($ options )
103
116
{
104
117
foreach (array ('directory ' , 'path ' , 'ignore ' , 'allowed_warnings ' , 'allowed_errors ' ) as $ key ) {
@@ -123,7 +136,7 @@ public function execute()
123
136
$ files = [];
124
137
125
138
foreach ($ iterator as $ file ) {
126
- $ filePath = $ file ->getRealPath ();
139
+ $ filePath = $ file ->getRealPath ();
127
140
$ skipFile = false ;
128
141
foreach ($ ignores as $ ignore ) {
129
142
if (stripos ($ filePath , $ ignore ) !== false ) {
@@ -168,7 +181,7 @@ public function execute()
168
181
}
169
182
}
170
183
171
- $ this ->phpci ->log ("Found $ errorCount instances of " . implode (', ' , $ this ->searches ));
184
+ $ this ->phpci ->log ("Found $ errorCount instances of " . implode (', ' , $ this ->searches ));
172
185
173
186
$ this ->build ->storeMeta ('technical_debt-warnings ' , $ errorCount );
174
187
$ this ->build ->storeMeta ('technical_debt-data ' , $ data );
@@ -180,4 +193,3 @@ public function execute()
180
193
return $ success ;
181
194
}
182
195
}
183
-
0 commit comments