for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Patsura Dmitry https://github.com/ovr <[email protected]>
*/
namespace PHPSA;
use PHPSA\Definition\ClassMethod;
use PHPSA\Definition\ClosureDefinition;
use PHPSA\Definition\FunctionDefinition;
* A pointer to the object in which we currently operate
class ScopePointer
{
* @var ClassMethod|FunctionDefinition
protected $object;
* Initializes the scopePointer with an object
*
* @param $object
public function __construct($object)
$this->object = $object;
}
* Is the object a class method?
* @return bool
public function isClassMethod()
return $this->object instanceof ClassMethod;
* Is the object a closure?
public function isClosure()
return $this->object instanceof ClosureDefinition;
* Is the object a function?
public function isFunction()
return $this->object instanceof FunctionDefinition;
* Returns the object.
* @return ClassMethod|FunctionDefinition
public function getObject()
return $this->object;