Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.2] Fix issues reported by static analyse #21802

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 1 commit into from
Feb 28, 2017

Conversation

romainneutron
Copy link
Contributor

Q A
Branch? 3.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

Follow-up #21801

@@ -38,7 +38,7 @@ public function __construct($namespace = '', $defaultLifetime = 0, $version = nu
CacheItem::validateKey($version);

if (!apcu_exists($version.'@'.$namespace)) {
$this->clear($namespace);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolas-grekas The clear method has no argument; is it a bug?

Copy link
Member

Choose a reason for hiding this comment

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

maybe it was expected to call doClear directly ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

$strict = true;
}

$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior, $strict);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reference has lost its third argument

@romainneutron romainneutron force-pushed the 3.2-static-analyze branch 2 times, most recently from 51fabbe to 67e7b5a Compare February 28, 2017 14:38
@nicolas-grekas
Copy link
Member

Thank you @romainneutron.

@nicolas-grekas nicolas-grekas merged commit a9ccacc into symfony:3.2 Feb 28, 2017
nicolas-grekas added a commit that referenced this pull request Feb 28, 2017
This PR was merged into the 3.2 branch.

Discussion
----------

[3.2] Fix issues reported by static analyse

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Follow-up #21801

Commits
-------

a9ccacc [3.2] Fix issues reported by static analyse
@romainneutron romainneutron deleted the 3.2-static-analyze branch February 28, 2017 15:14
nicolas-grekas added a commit that referenced this pull request Feb 28, 2017
…ron)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[master] Fix issues reported by static analyse

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Follow-up #21802

Commits
-------

671694d [master] Fix issues reported by static analyse
@acrobat
Copy link
Contributor

acrobat commented Mar 1, 2017

@romainneutron which tool is used to do this analysis?

@@ -296,7 +296,7 @@ protected function instantiateObject(array &$data, $class, array &$context, \Ref
if (__CLASS__ !== get_class($this)) {
$r = new \ReflectionMethod($this, __FUNCTION__);
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
@trigger_error(sprintf('Method %s() will have a 6th `$format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method %s::%s() will have a 6th `$format = null` argument in version 4.0. Not defining it is deprecated since 3.2.', get_class($this), __FUNCTION__), E_USER_DEPRECATED);
Copy link
Contributor

Choose a reason for hiding this comment

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

__METHOD__ could have been used here as well (issue reported by organic analysis :trollface:).

Copy link
Member

@nicolas-grekas nicolas-grekas Mar 5, 2017

Choose a reason for hiding this comment

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

@HeahDude organic analysis failure: get_class($this) !== __CLASS__ when $this is a child class of AbstractNormalizer (which it always is in this case ;) )

@fabpot fabpot mentioned this pull request Mar 9, 2017
@romainneutron
Copy link
Contributor Author

@acrobat PHPStan https://github.com/phpstan/phpstan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants