X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FFixer%2FImplement.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FFixer%2FImplement.php;h=7498ab1fa9cc98bb660ca9b143f15c17fe1edff8;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Fixer/Implement.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Fixer/Implement.php new file mode 100644 index 000000000..7498ab1fa --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Fixer/Implement.php @@ -0,0 +1,43 @@ +target + ->getIndexer('class') + ->get($this->configuration['target']); + + // Use reflection to get the method definition. + list ($interface, $method) = explode('::', $this->configuration['definition']); + $interface = new \ReflectionClass($interface); + $method = $interface->getMethod($method); + + $node = ClassMethodNode::create($method->getName()); + $node->setDocComment(DocCommentNode::create('@inheritdoc')); + $class->appendMethod($node); + $node->matchReflector($method); + + // @TODO There needs to be a way to implement the method body! + + $this->target->save($class); + } + +}