public function __construct($className, $name) { $this->className = $className; $this->name = $name; parent::__construct(sprintf('The method %s::%s() cannot be stubbed because it is final.', $className, $name)); }