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

Various fixes after static analysis #821

Conversation

meyerbaptiste
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT
Doc PR N/A

Found by:

  • Phan
  • Php Inspections (EA Extended)
  • PHPMD

@meyerbaptiste meyerbaptiste force-pushed the various_fixes_after_static_analysis branch from 0227fea to 735f26a Compare November 2, 2016 15:29
@@ -39,7 +39,7 @@ public function __construct(Reader $reader, PropertyMetadataFactoryInterface $de
public function create(string $resourceClass, string $property, array $options = []) : PropertyMetadata
{
$parentPropertyMetadata = null;
if (isset($this->decorated)) {
if ($this->decorated) {
Copy link
Member

Choose a reason for hiding this comment

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

Can even be compared explicitly to null.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we prefer to be explicit? 😞

Copy link
Member

Choose a reason for hiding this comment

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

Anyway we must be consistent and AFAIK we use this in other part of the code base. null === is ok too, but isset is weird.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I'm for avoiding isset and empty as much as possible.

@meyerbaptiste meyerbaptiste force-pushed the various_fixes_after_static_analysis branch 3 times, most recently from a9328e4 to d49429e Compare November 2, 2016 15:46
@meyerbaptiste meyerbaptiste force-pushed the various_fixes_after_static_analysis branch from d49429e to 83da509 Compare November 2, 2016 15:59
@dunglas dunglas merged commit 6cddcd2 into api-platform:master Nov 2, 2016
@dunglas
Copy link
Member

dunglas commented Nov 2, 2016

Thanks @meyerbaptiste

@meyerbaptiste meyerbaptiste deleted the various_fixes_after_static_analysis branch November 2, 2016 16:17
magarzon pushed a commit to magarzon/core that referenced this pull request Feb 12, 2017
…after_static_analysis

Various fixes after static analysis
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.

None yet

3 participants