* @license MIT */ final class ClassGeneratorUtils { public static function addMethodIfNotFinal( ReflectionClass $originalClass, ClassGenerator $classGenerator, MethodGenerator $generatedMethod ) : bool { $methodName = $generatedMethod->getName(); if ($originalClass->hasMethod($methodName) && $originalClass->getMethod($methodName)->isFinal()) { return false; } $classGenerator->addMethodFromGenerator($generatedMethod); return true; } }