Skip to content

Adjust when the properties is null #225

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

Merged
merged 3 commits into from
Dec 26, 2017

Conversation

jairoFernandez
Copy link
Contributor

No description provided.

@dunglas
Copy link
Member

dunglas commented Jun 19, 2017

Can you tell a bit more about this change?

core/filters.md Outdated
'required' => false,
'swagger' => ['description' => 'Filter using a regex. This will appear in the Swagger documentation!'],
];
if (!empty($this->properties)) {
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to use a guard clause:

public function getDescription(string $resourceClass): array
{
    if (!$this->properties) {
        return []:
    }

   $description = [];
   // ...

@dunglas dunglas merged commit ad11910 into api-platform:master Dec 26, 2017
@dunglas
Copy link
Member

dunglas commented Dec 26, 2017

Thanks @jairoFg12

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.

2 participants