@@ -35,11 +35,6 @@ class Applier
35
35
*/
36
36
private $ templateUtils ;
37
37
38
- /**
39
- * @var \Vaimo\ComposerPatches\Utils\DataUtils
40
- */
41
- private $ dataUtils ;
42
-
43
38
/**
44
39
* @var \Vaimo\ComposerPatches\Console\OutputAnalyser
45
40
*/
@@ -64,7 +59,6 @@ public function __construct(
64
59
$ this ->shell = new \Vaimo \ComposerPatches \Shell ($ logger );
65
60
$ this ->applierUtils = new \Vaimo \ComposerPatches \Utils \ConfigUtils ();
66
61
$ this ->templateUtils = new \Vaimo \ComposerPatches \Utils \TemplateUtils ();
67
- $ this ->dataUtils = new \Vaimo \ComposerPatches \Utils \DataUtils ();
68
62
$ this ->outputAnalyser = new \Vaimo \ComposerPatches \Console \OutputAnalyser ();
69
63
$ this ->applierErrorFactory = new \Vaimo \ComposerPatches \Factories \ApplierErrorFactory ();
70
64
}
@@ -226,21 +220,7 @@ private function resolveOperationOutput($applierOperations, $args, $operationFai
226
220
$ cwd = $ this ->extractStringValue ($ args , PluginConfig::PATCHER_ARG_CWD );
227
221
$ resultKey = sprintf ('%s | %s ' , $ cwd , $ command );
228
222
229
- if ($ passOnFailure ) {
230
- $ this ->logger ->writeVerbose (
231
- \Vaimo \ComposerPatches \Logger::TYPE_NONE ,
232
- '<comment>***</comment> '
233
- . 'The expected result to execution is a failure '
234
- . '<comment>***</comment> '
235
- );
236
- }
237
-
238
- if (isset ($ this ->resultCache [$ resultKey ])) {
239
- $ this ->logger ->writeVerbose (
240
- \Vaimo \ComposerPatches \Logger::TYPE_NONE ,
241
- sprintf ('(using cached result for: %s = %s) ' , $ command , reset ($ this ->resultCache [$ resultKey ]))
242
- );
243
- }
223
+ $ this ->outputBehaviourContextInfo ($ command , $ resultKey , $ passOnFailure );
244
224
245
225
if (!isset ($ this ->resultCache [$ resultKey ])) {
246
226
$ this ->resultCache [$ resultKey ] = $ this ->shell ->execute ($ command , $ cwd );
@@ -266,6 +246,25 @@ private function resolveOperationOutput($applierOperations, $args, $operationFai
266
246
return array (false , $ output );
267
247
}
268
248
249
+ private function outputBehaviourContextInfo ($ command , $ resultKey , $ passOnFailure )
250
+ {
251
+ if ($ passOnFailure ) {
252
+ $ this ->logger ->writeVerbose (
253
+ \Vaimo \ComposerPatches \Logger::TYPE_NONE ,
254
+ '<comment>***</comment> '
255
+ . 'The expected result to execution is a failure '
256
+ . '<comment>***</comment> '
257
+ );
258
+ }
259
+
260
+ if (isset ($ this ->resultCache [$ resultKey ])) {
261
+ $ this ->logger ->writeVerbose (
262
+ \Vaimo \ComposerPatches \Logger::TYPE_NONE ,
263
+ sprintf ('(using cached result for: %s = %s) ' , $ command , reset ($ this ->resultCache [$ resultKey ]))
264
+ );
265
+ }
266
+ }
267
+
269
268
private function validateOutput ($ output , $ operationFailures )
270
269
{
271
270
$ pathMarker = '\|\+\+\+\s(?P<match>.*?)(\t|$) ' ;
0 commit comments