-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from wick-ed/patch#811
Allow for forced static calls to original method
- Loading branch information
Showing
7 changed files
with
151 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* \AppserverIo\Doppelgaenger\Tests\Data\GeneratorTest\RecursionTestClass1 | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* | ||
* PHP version 5 | ||
* | ||
* @author Bernhard Wick <bw@appserver.io> | ||
* @copyright 2015 TechDivision GmbH - <info@appserver.io> | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @link https://github.com/appserver-io/doppelgaenger | ||
* @link http://www.appserver.io/ | ||
*/ | ||
|
||
namespace AppserverIo\Doppelgaenger\Tests\Data\GeneratorTest; | ||
|
||
/** | ||
* Class used to test the safety against an endless recursion introduced by the usage of parent::-calls | ||
* in a direct child/parent relationship | ||
* | ||
* @author Bernhard Wick <bw@appserver.io> | ||
* @copyright 2015 TechDivision GmbH - <info@appserver.io> | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @link https://github.com/appserver-io/doppelgaenger | ||
* @link http://www.appserver.io/ | ||
*/ | ||
class RecursionTestClass1 | ||
{ | ||
|
||
/** | ||
* Method which should not be called recursively more than once | ||
* | ||
* @return void | ||
*/ | ||
public function iDontWantToBeRecursive() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
/** | ||
* \AppserverIo\Doppelgaenger\Tests\Data\GeneratorTest\RecursionTestClass2 | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* | ||
* PHP version 5 | ||
* | ||
* @author Bernhard Wick <bw@appserver.io> | ||
* @copyright 2015 TechDivision GmbH - <info@appserver.io> | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @link https://github.com/appserver-io/doppelgaenger | ||
* @link http://www.appserver.io/ | ||
*/ | ||
|
||
namespace AppserverIo\Doppelgaenger\Tests\Data\GeneratorTest; | ||
|
||
/** | ||
* Class used to test the safety against an endless recursion introduced by the usage of parent::-calls | ||
* in a direct child/parent relationship | ||
* | ||
* @author Bernhard Wick <bw@appserver.io> | ||
* @copyright 2015 TechDivision GmbH - <info@appserver.io> | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @link https://github.com/appserver-io/doppelgaenger | ||
* @link http://www.appserver.io/ | ||
*/ | ||
class RecursionTestClass2 extends RecursionTestClass1 | ||
{ | ||
|
||
/** | ||
* Counter to measure calls | ||
* | ||
* @var integer $recursionCounter | ||
*/ | ||
public $recursionCounter = 0; | ||
|
||
/** | ||
* Method which should not be called recursively more than once | ||
* | ||
* @return void | ||
*/ | ||
public function iDontWantToBeRecursive() | ||
{ | ||
// increment the counter | ||
$this->recursionCounter ++; | ||
|
||
// stop execution at a point which MUST have been an unwanted recursion | ||
if ($this->recursionCounter < 10) { | ||
parent::iDontWantToBeRecursive(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters