getTop() public method

Return the "top" class.
public getTop ( ) : ReflectionClass
return ReflectionClass
Exemplo n.º 1
0
 public function getMetadataForHierarchy(ReflectionHierarchy $hierarchy)
 {
     $primaryReflection = $hierarchy->getTop();
     $benchmark = new BenchmarkMetadata($primaryReflection->path, $primaryReflection->class);
     $this->buildBenchmark($benchmark, $hierarchy);
     return $benchmark;
 }
Exemplo n.º 2
0
 private function validateMethodExists($context, ReflectionHierarchy $benchmarkReflection, $method, $isStatic = false)
 {
     if (false === $benchmarkReflection->hasMethod($method)) {
         throw new \InvalidArgumentException(sprintf('Unknown %s method "%s" in benchmark class "%s"', $context, $method, $benchmarkReflection->getTop()->class));
     }
     if ($isStatic !== $benchmarkReflection->hasStaticMethod($method)) {
         throw new \InvalidArgumentException(sprintf('%s method "%s" must %s static in benchmark class "%s"', $context, $method, $isStatic ? 'be' : 'not be', $benchmarkReflection->getTop()->class));
     }
 }