Skip to content
Snippets Groups Projects
Commit fe29b6d3 authored by Daniel Kurowski's avatar Daniel Kurowski
Browse files

kept -> preserved

parent 11aa4cd9
No related branches found
No related tags found
1 merge request!57Resolve "KeepMethod → Preserve"
Pipeline #41054 passed
......@@ -25,11 +25,11 @@ final class PreservedMethod implements Capability
// method already exists, just transfer it to new class
if ($current !== null && $current->getClassType()->hasMethod($this->methodName)) {
$keptMethod = $current->getClassType()->getMethod($this->methodName);
$preservedMethod = $current->getClassType()->getMethod($this->methodName);
$classToBeGenerated->setMethods([
...\array_values($classToBeGenerated->getMethods()),
$keptMethod,
$preservedMethod,
]);
return;
}
......@@ -42,12 +42,12 @@ final class PreservedMethod implements Capability
return $method;
};
$methodToBeKept = $classToBeGenerated->hasMethod($this->methodName)
$preservedMethod = $classToBeGenerated->hasMethod($this->methodName)
? $classToBeGenerated->getMethod($this->methodName)
: $addMethodStub($classToBeGenerated);
$methodToBeKept->setComment(
'This method is kept while scaffolding.' . "\n" .
$methodToBeKept->getComment()
$preservedMethod->setComment(
'This method is preserved while scaffolding.' . "\n" .
$preservedMethod->getComment()
);
}
}
......@@ -14,7 +14,7 @@ use Grifart\ClassScaffolder\Definition\ClassDefinitionBuilder;
final class ExistentClass
{
/**
* This method is kept while scaffolding.
* This method is preserved while scaffolding.
*/
public function newMethod(): void
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment