44
55use  PHPUnit \Framework \Constraint \Constraint ;
66use  PHPUnit \Framework \Constraint \IsEqual ;
7- use  SebastianBergmann \Exporter \Exporter ;
87use  Symfony \Component \DependencyInjection \Definition ;
98use  Symfony \Component \DependencyInjection \Exception \OutOfBoundsException ;
109
@@ -16,7 +15,6 @@ final class DefinitionHasArgumentConstraint extends Constraint
1615    private  string |int  $ argumentIndex
1716    private  mixed  $ expectedValue
1817    private  bool  $ checkExpectedValue
19-     private  Exporter $ exporter
2018
2119    public  function  __construct ($ argumentIndex$ expectedValuebool  $ checkExpectedValuetrue )
2220    {
@@ -39,7 +37,6 @@ public function __construct($argumentIndex, $expectedValue, bool $checkExpectedV
3937        $ this argumentIndex  = $ argumentIndex
4038        $ this expectedValue  = $ expectedValue
4139        $ this checkExpectedValue  = $ checkExpectedValue
42-         $ this exporter  = new  Exporter ();
4340    }
4441
4542    public  function  toString (): string 
@@ -100,15 +97,16 @@ private function evaluateArgumentIndex(Definition $definition, bool $returnResul
10097    private  function  evaluateArgumentValue (Definition $ definitionbool  $ returnResultbool 
10198    {
10299        $ actualValue$ definitiongetArgument ($ this argumentIndex );
100+         $ exporter$ this exporter ();
103101
104102        if  (gettype ($ actualValuegettype ($ this expectedValue )) {
105103            $ this fail (
106104                $ definition
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+                     $ exporterexport ($ actualValue
109+                     $ exporterexport ($ 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+                     $ exporterexport ($ actualValue
126+                     $ exporterexport ($ 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+                     $ exporterexport ($ actualValue
133+                     $ exporterexport ($ this expectedValue )
136134                );
137135            }
138136
0 commit comments