5 * Contains \Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer\Implement.
8 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer;
10 use Drupal\drupalmoduleupgrader\FixerBase;
11 use Pharborist\DocCommentNode;
12 use Pharborist\Objects\ClassMethodNode;
19 class Implement extends FixerBase {
21 public function execute() {
22 /** @var \Pharborist\Objects\ClassNode $class */
26 ->get($this->configuration['target']);
28 // Use reflection to get the method definition.
29 list ($interface, $method) = explode('::', $this->configuration['definition']);
30 $interface = new \ReflectionClass($interface);
31 $method = $interface->getMethod($method);
33 $node = ClassMethodNode::create($method->getName());
34 $node->setDocComment(DocCommentNode::create('@inheritdoc'));
35 $class->appendMethod($node);
36 $node->matchReflector($method);
38 // @TODO There needs to be a way to implement the method body!
40 $this->target->save($class);