@@ -16,7 +16,6 @@ final class DefinitionHasArgumentConstraint extends Constraint
16
16
private string |int $ argumentIndex ;
17
17
private mixed $ expectedValue ;
18
18
private bool $ checkExpectedValue ;
19
- private Exporter $ exporter ;
20
19
21
20
public function __construct ($ argumentIndex , $ expectedValue , bool $ checkExpectedValue = true )
22
21
{
@@ -39,7 +38,6 @@ public function __construct($argumentIndex, $expectedValue, bool $checkExpectedV
39
38
$ this ->argumentIndex = $ argumentIndex ;
40
39
$ this ->expectedValue = $ expectedValue ;
41
40
$ this ->checkExpectedValue = $ checkExpectedValue ;
42
- $ this ->exporter = new Exporter ();
43
41
}
44
42
45
43
public function toString (): string
@@ -107,8 +105,8 @@ private function evaluateArgumentValue(Definition $definition, bool $returnResul
107
105
sprintf (
108
106
'The value of argument named "%s" (%s) is not equal to the expected value (%s) ' ,
109
107
$ this ->argumentIndex ,
110
- $ this ->exporter ->export ($ actualValue ),
111
- $ this ->exporter ->export ($ this ->expectedValue )
108
+ $ this ->exporter () ->export ($ actualValue ),
109
+ $ this ->exporter () ->export ($ this ->expectedValue )
112
110
)
113
111
);
114
112
}
@@ -124,15 +122,15 @@ private function evaluateArgumentValue(Definition $definition, bool $returnResul
124
122
$ message = sprintf (
125
123
'The value of argument named "%s" (%s) is not equal to the expected value (%s) ' ,
126
124
$ this ->argumentIndex ,
127
- $ this ->exporter ->export ($ actualValue ),
128
- $ this ->exporter ->export ($ this ->expectedValue )
125
+ $ this ->exporter () ->export ($ actualValue ),
126
+ $ this ->exporter () ->export ($ this ->expectedValue )
129
127
);
130
128
} else {
131
129
$ message = sprintf (
132
130
'The value of argument with index %d (%s) is not equal to the expected value (%s) ' ,
133
131
$ this ->argumentIndex ,
134
- $ this ->exporter ->export ($ actualValue ),
135
- $ this ->exporter ->export ($ this ->expectedValue )
132
+ $ this ->exporter () ->export ($ actualValue ),
133
+ $ this ->exporter () ->export ($ this ->expectedValue )
136
134
);
137
135
}
138
136
0 commit comments