-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add @restdock-ignoreField and @restdock-ignoreExtraField tags #19
Conversation
May be just @restdoc-ignore |
Change to one tag @restdoc-ignore |
foreach ($this->getTagsByName('ignore') as $key => $tag) { | ||
$name = trim($tag->getVariableName(), '$'); | ||
$this->removeField($name); | ||
$this->removeExtraField($name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also needed to be deleted from _sortFields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В отличие от fields и extraFields которые заполняются на основе методов модели, в _sortFields попадают только те поля которые мы указываем тегами в phpdoc. Можно просто не писать тег, чтобы его не было в списке.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foolproof
@@ -46,11 +46,13 @@ public function testInherit() | |||
$this->assertEquals('Code country. <a href="http://example.com">Detail link.</a>', $doc->extraFields['alpha2']->description); | |||
$this->assertEquals('string|null', $doc->extraFields['full_name']->type); | |||
$this->assertEquals('Full name. <a href="http://example.com">Detail link.</a>', $doc->extraFields['full_name']->description); | |||
$this->assertFalse(isset($doc->extraFields['ignore'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be used:
$this->assertArrayNotHasKey('ignore', $doc->extraFields);
No description provided.