X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FSudo.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FSudo.php;h=0000000000000000000000000000000000000000;hp=2ba55728ea58f75c14db5b4659818e8b11d2aa62;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/psy/psysh/src/Psy/Sudo.php b/vendor/psy/psysh/src/Psy/Sudo.php deleted file mode 100644 index 2ba55728e..000000000 --- a/vendor/psy/psysh/src/Psy/Sudo.php +++ /dev/null @@ -1,150 +0,0 @@ -property - */ - public static function fetchProperty($object, $property) - { - $refl = new \ReflectionObject($object); - $prop = $refl->getProperty($property); - $prop->setAccessible(true); - - return $prop->getValue($object); - } - - /** - * Assign the value of a property of an object, bypassing visibility restrictions. - * - * @param object $object - * @param string $property property name - * @param mixed $value - * - * @return mixed Value of $object->property - */ - public static function assignProperty($object, $property, $value) - { - $refl = new \ReflectionObject($object); - $prop = $refl->getProperty($property); - $prop->setAccessible(true); - $prop->setValue($object, $value); - - return $value; - } - - /** - * Call a method on an object, bypassing visibility restrictions. - * - * @param object $object - * @param string $method method name - * @param mixed $args... - * - * @return mixed - */ - public static function callMethod($object, $method, $args = null) - { - $args = func_get_args(); - $object = array_shift($args); - $method = array_shift($args); - - $refl = new \ReflectionObject($object); - $reflMethod = $refl->getMethod($method); - $reflMethod->setAccessible(true); - - return $reflMethod->invokeArgs($object, $args); - } - - /** - * Fetch a property of a class, bypassing visibility restrictions. - * - * @param string|object $class class name or instance - * @param string $property property name - * - * @return mixed Value of $class::$property - */ - public static function fetchStaticProperty($class, $property) - { - $refl = new \ReflectionClass($class); - $prop = $refl->getProperty($property); - $prop->setAccessible(true); - - return $prop->getValue(); - } - - /** - * Assign the value of a static property of a class, bypassing visibility restrictions. - * - * @param string|object $class class name or instance - * @param string $property property name - * @param mixed $value - * - * @return mixed Value of $class::$property - */ - public static function assignStaticProperty($class, $property, $value) - { - $refl = new \ReflectionClass($class); - $prop = $refl->getProperty($property); - $prop->setAccessible(true); - $prop->setValue($value); - - return $value; - } - - /** - * Call a static method on a class, bypassing visibility restrictions. - * - * @param string|object $class class name or instance - * @param string $method method name - * @param mixed $args... - * - * @return mixed - */ - public static function callStatic($class, $method, $args = null) - { - $args = func_get_args(); - $class = array_shift($args); - $method = array_shift($args); - - $refl = new \ReflectionClass($class); - $reflMethod = $refl->getMethod($method); - $reflMethod->setAccessible(true); - - return $reflMethod->invokeArgs(null, $args); - } - - /** - * Fetch a class constant, bypassing visibility restrictions. - * - * @param string|object $class class name or instance - * @param string $const constant name - * - * @return mixed - */ - public static function fetchClassConst($class, $const) - { - $refl = new \ReflectionClass($class); - - return $refl->getConstant($const); - } -}