@@ -16,7 +16,6 @@ final class DefinitionHasArgumentConstraint extends Constraint
1616    private  string |int  $ argumentIndex
1717    private  mixed  $ expectedValue
1818    private  bool  $ checkExpectedValue
19-     private  Exporter $ exporter
2019
2120    public  function  __construct ($ argumentIndex$ expectedValuebool  $ checkExpectedValuetrue )
2221    {
@@ -39,7 +38,6 @@ public function __construct($argumentIndex, $expectedValue, bool $checkExpectedV
3938        $ this argumentIndex  = $ argumentIndex
4039        $ this expectedValue  = $ expectedValue
4140        $ this checkExpectedValue  = $ checkExpectedValue
42-         $ this exporter  = new  Exporter ();
4341    }
4442
4543    public  function  toString (): string 
@@ -107,8 +105,8 @@ private function evaluateArgumentValue(Definition $definition, bool $returnResul
107105                sprintf (
108106                    'The value of argument named "%s" (%s) is not equal to the expected value (%s) ' ,
109107                    $ this argumentIndex ,
110-                     $ this exporter ->export ($ actualValue
111-                     $ this exporter ->export ($ this expectedValue )
108+                     $ this exporter () ->export ($ actualValue
109+                     $ this exporter () ->export ($ this expectedValue )
112110                )
113111            );
114112        }
@@ -124,15 +122,15 @@ private function evaluateArgumentValue(Definition $definition, bool $returnResul
124122                $ messagesprintf (
125123                    'The value of argument named "%s" (%s) is not equal to the expected value (%s) ' ,
126124                    $ this argumentIndex ,
127-                     $ this exporter ->export ($ actualValue
128-                     $ this exporter ->export ($ this expectedValue )
125+                     $ this exporter () ->export ($ actualValue
126+                     $ this exporter () ->export ($ this expectedValue )
129127                );
130128            } else  {
131129                $ messagesprintf (
132130                    'The value of argument with index %d (%s) is not equal to the expected value (%s) ' ,
133131                    $ this argumentIndex ,
134-                     $ this exporter ->export ($ actualValue
135-                     $ this exporter ->export ($ this expectedValue )
132+                     $ this exporter () ->export ($ actualValue
133+                     $ this exporter () ->export ($ this expectedValue )
136134                );
137135            }
138136
0 commit comments