PhpBench\Benchmark\Metadata\SubjectMetadata::getBenchmark PHP Method

getBenchmark() public method

Return the benchmarkMetadata metadata for this subject.
public getBenchmark ( ) : BenchmarkMetadata
return BenchmarkMetadata
    public function getBenchmark()
    {
        return $this->benchmarkMetadata;
    }

Usage Example

 private function buildSubject(SubjectMetadata $subject, $annotations)
 {
     foreach ($annotations as $annotation) {
         if ($annotation instanceof BeforeClassMethods) {
             throw new \InvalidArgumentException(sprintf('@BeforeClassMethods annotation can only be applied at the class level (%s)', $subject->getBenchmark()->getClass() . '::' . $subject->getName()));
         }
         if ($annotation instanceof AfterClassMethods) {
             throw new \InvalidArgumentException(sprintf('@AfterClassMethods annotation can only be applied at the class level (%s)', $subject->getBenchmark()->getClass() . '::' . $subject->getName()));
         }
         $this->processSubject($subject, $annotation);
     }
 }
All Usage Examples Of PhpBench\Benchmark\Metadata\SubjectMetadata::getBenchmark