77use Prophecy \Prophet ;
88use Prophecy \Prophecy \ProphecyInterface ;
99use Prophecy \Exception \Prediction \AggregateException ;
10+ use ReflectionProperty ;
1011
1112/**
1213 * A Prophet for built-in PHP functions.
@@ -38,7 +39,7 @@ final class PHPProphet
3839 * @var Prophet The prophet.
3940 */
4041 private $ prophet ;
41-
42+
4243 /**
4344 * Builds the prophet.
4445 *
@@ -49,12 +50,12 @@ public function __construct(Prophet $prophet = null)
4950 if (is_null ($ prophet )) {
5051 $ prophet = new Prophet ();
5152 }
52-
53+
5354 $ revealer = new ReferencePreservingRevealer (self ::getProperty ($ prophet , "revealer " ));
5455 $ util = self ::getProperty ($ prophet , "util " );
5556 $ this ->prophet = new Prophet ($ prophet ->getDoubler (), $ revealer , $ util );
5657 }
57-
58+
5859 /**
5960 * Creates a new function prophecy for a given namespace.
6061 *
@@ -66,7 +67,7 @@ public function prophesize($namespace)
6667 {
6768 return new FunctionProphecy ($ namespace , $ this ->prophet );
6869 }
69-
70+
7071 /**
7172 * Checks all predictions defined by prophecies of this Prophet.
7273 *
@@ -80,7 +81,7 @@ public function checkPredictions()
8081 Mock::disableAll ();
8182 $ this ->prophet ->checkPredictions ();
8283 }
83-
84+
8485 /**
8586 * Defines the function prophecy in the given namespace.
8687 *
@@ -109,7 +110,7 @@ public static function define($namespace, $name)
109110 ->build ()
110111 ->define ();
111112 }
112-
113+
113114 /**
114115 * Returns a private property of a prophet.
115116 *
@@ -120,7 +121,7 @@ public static function define($namespace, $name)
120121 */
121122 private static function getProperty (Prophet $ prophet , $ property )
122123 {
123- $ reflection = new \ ReflectionProperty ($ prophet , $ property );
124+ $ reflection = new ReflectionProperty ($ prophet , $ property );
124125 $ reflection ->setAccessible (true );
125126 return $ reflection ->getValue ($ prophet );
126127 }
0 commit comments