Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ca3e96

Browse filesBrowse files
committed
bug #21331 [PropertyInfo] Exclude static methods form properties guessing (dunglas)
This PR was merged into the 2.8 branch. Discussion ---------- [PropertyInfo] Exclude static methods form properties guessing | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 190c736 [PropertyInfo] Exclude static methods form properties guessing
2 parents e18281e + 190c736 commit 0ca3e96
Copy full SHA for 0ca3e96

File tree

2 files changed

+8
-0
lines changed
Filter options

2 files changed

+8
-0
lines changed

‎src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public function getProperties($class, array $context = array())
6868
}
6969

7070
foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
71+
if ($reflectionMethod->isStatic()) {
72+
continue;
73+
}
74+
7175
$propertyName = $this->getPropertyName($reflectionMethod->name);
7276
if (!$propertyName || isset($properties[$propertyName])) {
7377
continue;

‎src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ class Dummy extends ParentDummy
5151
*/
5252
public $B;
5353

54+
public static function getStatic()
55+
{
56+
}
57+
5458
/**
5559
* A.
5660
*

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.