Exemplo n.º 1
0
 public function decorate(MatcherInterface $matcher, &$value)
 {
     $reflection = ReflectionHelper::getReflectionClass($matcher->getPlugins()->reflection);
     $resolved = UseResolver::resolve($reflection, $value);
     if (ClassChecker::exists($resolved)) {
         $value = $resolved;
     }
 }
Exemplo n.º 2
0
 public function testIfWillResolveUseStatements()
 {
     $data = ['Test' => Test::class, 'UseResolver' => UseResolver::class, 'WithAlias' => WithAlias::class, 'UnitTester' => UnitTester::class, 'UseResolverStub' => UseResolverStub::class];
     foreach ($data as $src => $expected) {
         $result = UseResolver::resolve(new ReflectionObject($this), $src);
         $this->assertSame($expected, $result);
     }
 }