Skip to content

Commit

Permalink
Disable all __debugInfo magic to prevent glitches with phpunit+phpstorm
Browse files Browse the repository at this point in the history
  • Loading branch information
lisachenko committed Jan 17, 2016
1 parent 79fae79 commit f16f1cc
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ReflectionClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static function collectTraitsFromClassNode(ClassLike $classLikeNode, arra
/**
* Emulating original behaviour of reflection
*/
public function __debugInfo()
public function ___debugInfo()
{
return array(
'name' => $this->getName()
Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct($functionName, Function_ $functionNode)
/**
* Emulating original behaviour of reflection
*/
public function __debugInfo()
public function ___debugInfo()
{
$nodeName = 'unknown';

Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct($className, $methodName, ClassMethod $classMethodNod
/**
* Emulating original behaviour of reflection
*/
public function __debugInfo()
public function ___debugInfo()
{
return [
'name' => $this->getClassMethodNode()->name,
Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function __construct(
/**
* Emulating original behaviour of reflection
*/
public function __debugInfo()
public function ___debugInfo()
{
return array(
'name' => $this->parameterNode->name,
Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function __construct(
/**
* Emulating original behaviour of reflection
*/
public function __debugInfo()
public function ___debugInfo()
{
return array(
'name' => isset($this->propertyNode) ? $this->propertyNode->name : 'unknown',
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/InternalPropertiesEmulationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait InternalPropertiesEmulationTrait
*
* @return array
*/
abstract public function __debugInfo();
abstract public function ___debugInfo();

/**
* Magic implementation of properties
Expand All @@ -31,7 +31,7 @@ abstract public function __debugInfo();
*/
public function __get($propertyName)
{
$internalInfo = $this->__debugInfo();
$internalInfo = $this->___debugInfo();
if (!isset($internalInfo[$propertyName])) {
$className = get_class($this);
trigger_error("Undefined property {$className}::\${$propertyName}");
Expand Down
2 changes: 1 addition & 1 deletion tests/ReflectionMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function testDebugInfoMethod()
$parsedRefMethod = new ReflectionMethod(self::STUB_CLASS, 'funcWithDocAndBody');
$originalRefMethod = new \ReflectionMethod(self::STUB_CLASS, 'funcWithDocAndBody');
$expectedValue = (array) $originalRefMethod;
$this->assertSame($expectedValue, $parsedRefMethod->__debugInfo());
$this->assertSame($expectedValue, $parsedRefMethod->___debugInfo());
}

public function testSetAccessibleMethod()
Expand Down
2 changes: 1 addition & 1 deletion tests/ReflectionParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testDebugInfoMethod()
$parsedRefParameter = $parsedRefParameters[0];
$originalRefParameter = new \ReflectionParameter('Go\ParserReflection\Stub\miscParameters', 'arrayParam');
$expectedValue = (array) $originalRefParameter;
$this->assertSame($expectedValue, $parsedRefParameter->__debugInfo());
$this->assertSame($expectedValue, $parsedRefParameter->___debugInfo());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/ReflectionPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function testDebugInfoMethod()
$parsedRefProperty = new ReflectionProperty(self::STUB_CLASS, 'publicStaticProperty');
$originalRefProperty = new \ReflectionProperty(self::STUB_CLASS, 'publicStaticProperty');
$expectedValue = (array) $originalRefProperty;
$this->assertSame($expectedValue, $parsedRefProperty->__debugInfo());
$this->assertSame($expectedValue, $parsedRefProperty->___debugInfo());
}

public function testCoverAllMethods()
Expand Down

0 comments on commit f16f1cc

Please sign in to comment.