Skip to content
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

Merged
merged 3 commits into from
Mar 22, 2017

Conversation

gaus57
Copy link

@gaus57 gaus57 commented Mar 21, 2017

No description provided.

@pahanini
Copy link
Owner

May be just @restdoc-ignore

@gaus57
Copy link
Author

gaus57 commented Mar 21, 2017

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);
Copy link
Contributor

@PaVeL-Ekt PaVeL-Ekt Mar 21, 2017

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В отличие от fields и extraFields которые заполняются на основе методов модели, в _sortFields попадают только те поля которые мы указываем тегами в phpdoc. Можно просто не писать тег, чтобы его не было в списке.

Copy link
Contributor

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']));

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);

@pahanini pahanini merged commit fd0d065 into pahanini:master Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants