PHP 8.0 support (#857)

* [PHP 8.0] Add Stringable interface

* [PHP 8.0] Actualize and rewrite Reflection extension: Add support of implemented Attributes RFC and Property Promotion RFC methods

* [PHP 8.0] Add "Attribute" attribute implementation

* [PHP 8.0] Add str_starts_with, str_ends_with and str_contains functions

* [PHP 8.0] Marks that "Attribute" class is an attribute

* [PHP 8.0] Add get_debug_type function

* [PHP 8.0] Add get_resource_id function

* [PHP 8.0] Add preg_last_error_msg function
This commit is contained in:
Kirill Nesmeyanov 2020-07-02 13:51:36 +03:00 committed by GitHub
parent 300365d4b2
commit bcaeb52ebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 3350 additions and 2084 deletions

View File

@ -116,6 +116,39 @@ function strcasecmp ($str1, $str2) {}
*/
function strncasecmp ($str1, $str2, $len) {}
/**
* The function returns {@see true} if the passed $haystack starts from the
* $needle string or {@see false} otherwise.
*
* @param string $haystack
* @param string $needle
* @return bool
* @since 8.0
*/
function str_starts_with(string $haystack, string $needle) : bool {}
/**
* The function returns {@see true} if the passed $haystack ends with the
* $needle string or {@see false} otherwise.
*
* @param string $haystack
* @param string $needle
* @return bool
* @since 8.0
*/
function str_ends_with(string $haystack, string $needle) : bool {}
/**
* Checks if $needle is found in $haystack and returns a boolean value
* (true/false) whether or not the $needle was found.
*
* @param string $haystack
* @param string $needle
* @return bool
* @since 8.0
*/
function str_contains(string $haystack, string $needle) : bool {}
/**
* Return the current key and value pair from an array and advance the array cursor
* @link https://php.net/manual/en/function.each.php

View File

@ -649,7 +649,7 @@ class WeakReference {
* @return WeakReference the freshly instantiated object.
* @since 7.4
*/
public static function create(object $referent): WeakReference {}
public static function create($referent) {}
/**
* Gets a weakly referenced object. If the object has already been
@ -658,5 +658,241 @@ class WeakReference {
* @return object|null
* @since 7.4
*/
public function get(): ?object {}
public function get() {}
}
/**
* Weak maps allow creating a map from objects to arbitrary values
* (similar to SplObjectStorage) without preventing the objects that are used
* as keys from being garbage collected. If an object key is garbage collected,
* it will simply be removed from the map.
*
* @since 8.0
*/
final class WeakMap implements \ArrayAccess, \Countable, \IteratorAggregate {
/**
* Returns {@see true} if the value for the object is contained in
* the {@see WeakMap} and {@see false} instead.
*
* @param object $object Any object
* @return bool
*/
public function offsetExists($object) {}
/**
* Returns the existsing value by an object.
*
* @param object $object Any object
* @return mixed Value associated with the key object
*/
public function offsetGet($object)
{
}
/**
* Sets a new value for an object.
*
* @param object $object Any object
* @param mixed $value Any value
* @return void
*/
public function offsetSet($object, $value)
{
}
/**
* Force removes an object value from the {@see WeakMap} instance.
*
* @param object $object Any object
* @return void
*/
public function offsetUnset($object)
{
}
/**
* Returns an iterator in the "[object => mixed]" format.
*
* @return Traversable
*/
public function getIterator()
{
}
/**
* Returns the number of items in the {@see WeakMap} instance.
*
* @return int
*/
public function count()
{
}
}
/**
* Stringable interface marks classes as available for serialization
* in a string.
*
* @since 8.0
*/
interface Stringable {
/**
* Magic method {@see https://www.php.net/manual/ru/language.oop5.magic.php}
* called during serialization to string.
*
* @return string Returns string representation of the object that
* implements this interface (and/or "__toString" magic method).
*/
public function __toString();
}
/**
* @since 8.0
*/
// TODO Uncomment after PHP 8.0 release:
// @@Attribute(Attribute::TARGET_CLASS)
final class Attribute {
/**
* Marks that attribute declaration is allowed only in classes.
*/
const TARGET_CLASS = 1;
/**
* Marks that attribute declaration is allowed only in functions.
*/
const TARGET_FUNCTION = 1 << 1;
/**
* Marks that attribute declaration is allowed only in class methods.
*/
const TARGET_METHOD = 1 << 2;
/**
* Marks that attribute declaration is allowed only in class properties.
*/
const TARGET_PROPERTY = 1 << 3;
/**
* Marks that attribute declaration is allowed only in class constants.
*/
const TARGET_CLASS_CONSTANT = 1 << 4;
/**
* Marks that attribute declaration is allowed only in function or method parameters.
*/
const TARGET_PARAMETER = 1 << 5;
/**
* Marks that attribute declaration is allowed anywhere.
*/
const TARGET_ALL = (1 << 6) - 1;
/**
* Notes that an attribute declaration in the same place is
* allowed multiple times.
*/
const IS_REPEATABLE = 1 << 10;
/**
* @param int $flags A value in the form of a bitmask indicating the places
* where attributes can be defined.
*/
public function __construct($flags = self::TARGET_ALL)
{
}
}
/**
* A class for working with PHP tokens, which is an alternative to
* the {@see token_get_all()} function.
*
* @since 8.0
*/
class PhpToken implements Stringable {
/**
* One of the T_* constants, or an integer < 256 representing a
* single-char token.
*
* @var int
*/
public $id;
/**
* The textual content of the token.
*
* @var string
*/
public $text;
/**
* The starting line number (1-based) of the token.
*
* @var int
*/
public $line;
/**
* The starting position (0-based) in the tokenized string.
*
* @var int
*/
public $pos;
/**
* Same as {@see token_get_all()}, but returning array of {@see PhpToken}
* or an instance of a child class.
*
* @param string $code An a PHP source code
* @param int $flags
* @return static[]
*/
public static function getAll($code, $flags = 0)
{
}
/**
* @param int $id An integer identifier
* @param string $text Textual content
* @param int $line Strating line
* @param int $pos Straring position (line offset)
*/
final public function __construct($id, $text, $line = -1, $pos = -1)
{
}
/**
* Get the name of the token.
*
* @return string|null
*/
public function getTokenName()
{
}
/**
* Whether the token has the given ID, the given text, or has an ID/text
* part of the given array.
*
* @param int|string|array $kind
* @return bool
*/
public function is($kind)
{
}
/**
* Whether this token would be ignored by the PHP parser.
*
* @return bool
*/
public function isIgnorable()
{
}
/**
* {@inheritDoc}
*/
public function __toString()
{
}
}

View File

@ -35,6 +35,7 @@ const CLASSES = array (
'ArrayIterator' => 'SPL/SPL.php',
'ArrayObject' => 'SPL/SPL.php',
'AssertionError' => 'standard/standard_9.php',
'Attribute' => 'Core/Core_c.php',
'BadFunctionCallException' => 'SPL/SPL.php',
'BadMethodCallException' => 'SPL/SPL.php',
'BlackfireProbe' => 'blackfire/blackfire.php',
@ -219,6 +220,7 @@ const CLASSES = array (
'DOMAttr' => 'dom/dom_c.php',
'DOMCdataSection' => 'dom/dom_c.php',
'DOMCharacterData' => 'dom/dom_c.php',
'DOMChildNode' => 'dom/dom_c.php',
'DOMComment' => 'dom/dom_c.php',
'DOMConfiguration' => 'dom/dom_c.php',
'DOMDocument' => 'dom/dom_c.php',
@ -240,6 +242,7 @@ const CLASSES = array (
'DOMNode' => 'dom/dom_c.php',
'DOMNodeList' => 'dom/dom_c.php',
'DOMNotation' => 'dom/dom_c.php',
'DOMParentNode' => 'dom/dom_c.php',
'DOMProcessingInstruction' => 'dom/dom_c.php',
'DOMStringExtend' => 'dom/dom_c.php',
'DOMStringList' => 'dom/dom_c.php',
@ -540,6 +543,7 @@ const CLASSES = array (
'PharData' => 'Phar/Phar.php',
'PharException' => 'Phar/Phar.php',
'PharFileInfo' => 'Phar/Phar.php',
'PhpToken' => 'Core/Core_c.php',
'Pool' => 'pthreads/pthreads.php',
'RRDCreator' => 'rrd/rrd.php',
'RRDGraph' => 'rrd/rrd.php',
@ -565,23 +569,24 @@ const CLASSES = array (
'RedisException' => 'redis/Redis.php',
'RedisSentinel' => 'redis/RedisSentinel.php',
'Reflection' => 'Reflection/Reflection.php',
'ReflectionClass' => 'Reflection/Reflection.php',
'ReflectionClassConstant' => 'Reflection/Reflection.php',
'ReflectionException' => 'Reflection/Reflection.php',
'ReflectionExtension' => 'Reflection/Reflection.php',
'ReflectionFunction' => 'Reflection/Reflection.php',
'ReflectionFunctionAbstract' => 'Reflection/Reflection.php',
'ReflectionGenerator' => 'Reflection/Reflection.php',
'ReflectionMethod' => 'Reflection/Reflection.php',
'ReflectionNamedType' => 'Reflection/Reflection.php',
'ReflectionObject' => 'Reflection/Reflection.php',
'ReflectionParameter' => 'Reflection/Reflection.php',
'ReflectionProperty' => 'Reflection/Reflection.php',
'ReflectionReference' => 'Reflection/Reflection.php',
'ReflectionType' => 'Reflection/Reflection.php',
'ReflectionUnionType' => 'Reflection/Reflection.php',
'ReflectionZendExtension' => 'Reflection/Reflection.php',
'Reflector' => 'Reflection/Reflection.php',
'ReflectionAttribute' => 'Reflection/ReflectionAttribute.php',
'ReflectionClass' => 'Reflection/ReflectionClass.php',
'ReflectionClassConstant' => 'Reflection/ReflectionClassConstant.php',
'ReflectionException' => 'Reflection/ReflectionException.php',
'ReflectionExtension' => 'Reflection/ReflectionExtension.php',
'ReflectionFunction' => 'Reflection/ReflectionFunction.php',
'ReflectionFunctionAbstract' => 'Reflection/ReflectionFunctionAbstract.php',
'ReflectionGenerator' => 'Reflection/ReflectionGenerator.php',
'ReflectionMethod' => 'Reflection/ReflectionMethod.php',
'ReflectionNamedType' => 'Reflection/ReflectionNamedType.php',
'ReflectionObject' => 'Reflection/ReflectionObject.php',
'ReflectionParameter' => 'Reflection/ReflectionParameter.php',
'ReflectionProperty' => 'Reflection/ReflectionProperty.php',
'ReflectionReference' => 'Reflection/ReflectionReference.php',
'ReflectionType' => 'Reflection/ReflectionType.php',
'ReflectionUnionType' => 'Reflection/ReflectionUnionType.php',
'ReflectionZendExtension' => 'Reflection/ReflectionZendExtension.php',
'Reflector' => 'Reflection/Reflector.php',
'RegexIterator' => 'SPL/SPL.php',
'ResourceBundle' => 'intl/intl.php',
'RuntimeException' => 'SPL/SPL.php',
@ -660,6 +665,7 @@ const CLASSES = array (
'Stomp' => 'stomp/stomp.php',
'StompException' => 'stomp/stomp.php',
'StompFrame' => 'stomp/stomp.php',
'Stringable' => 'Core/Core_c.php',
'Svn' => 'svn/svn.php',
'SvnNode' => 'svn/svn.php',
'SvnWc' => 'svn/svn.php',
@ -685,6 +691,7 @@ const CLASSES = array (
'V8JsTimeLimitException' => 'v8js/v8js.php',
'VARIANT' => 'com_dotnet/com_dotnet.php',
'Volatile' => 'pthreads/pthreads.php',
'WeakMap' => 'Core/Core_c.php',
'WeakReference' => 'Core/Core_c.php',
'Worker' => 'pthreads/pthreads.php',
'XMLReader' => 'xmlreader/xmlreader.php',
@ -2167,6 +2174,7 @@ const FUNCTIONS = array (
'get_class_methods' => 'Core/Core.php',
'get_class_vars' => 'Core/Core.php',
'get_current_user' => 'standard/standard_3.php',
'get_debug_type' => 'standard/standard_9.php',
'get_declared_classes' => 'Core/Core.php',
'get_declared_interfaces' => 'Core/Core.php',
'get_declared_traits' => 'Core/Core.php',
@ -2186,6 +2194,7 @@ const FUNCTIONS = array (
'get_object_vars' => 'Core/Core.php',
'get_parent_class' => 'Core/Core.php',
'get_required_files' => 'Core/Core.php',
'get_resource_id' => 'standard/standard_9.php',
'get_resource_type' => 'Core/Core.php',
'get_resources' => 'Core/Core.php',
'getallheaders' => 'apache/apache.php',
@ -4025,6 +4034,7 @@ const FUNCTIONS = array (
'preg_filter' => 'pcre/pcre.php',
'preg_grep' => 'pcre/pcre.php',
'preg_last_error' => 'pcre/pcre.php',
'preg_last_error_msg' => 'pcre/pcre.php',
'preg_match' => 'pcre/pcre.php',
'preg_match_all' => 'pcre/pcre.php',
'preg_quote' => 'pcre/pcre.php',
@ -4583,6 +4593,8 @@ const FUNCTIONS = array (
'stomp_subscribe' => 'stomp/stomp.php',
'stomp_unsubscribe' => 'stomp/stomp.php',
'stomp_version' => 'stomp/stomp.php',
'str_contains' => 'Core/Core.php',
'str_ends_with' => 'Core/Core.php',
'str_getcsv' => 'standard/standard_2.php',
'str_ireplace' => 'standard/standard_1.php',
'str_pad' => 'standard/standard_2.php',
@ -4591,6 +4603,7 @@ const FUNCTIONS = array (
'str_rot13' => 'standard/standard_9.php',
'str_shuffle' => 'standard/standard_1.php',
'str_split' => 'standard/standard_1.php',
'str_starts_with' => 'Core/Core.php',
'str_word_count' => 'standard/standard_1.php',
'strcasecmp' => 'Core/Core.php',
'strchr' => 'standard/standard_2.php',

View File

@ -0,0 +1,66 @@
<?php
namespace PHPSTORM_META {
registerArgumentsSet('ReflectionGetAttributes',
\ReflectionAttribute::IS_INSTANCEOF
);
registerArgumentsSet('ReflectionClassModifiers',
\ReflectionClass::IS_FINAL|
\ReflectionClass::IS_EXPLICIT_ABSTRACT|
\ReflectionClass::IS_IMPLICIT_ABSTRACT
);
registerArgumentsSet('ReflectionMethodModifiers',
\ReflectionMethod::IS_ABSTRACT|
\ReflectionMethod::IS_FINAL|
\ReflectionMethod::IS_PUBLIC|
\ReflectionMethod::IS_PRIVATE|
\ReflectionMethod::IS_PROTECTED|
\ReflectionMethod::IS_STATIC
);
registerArgumentsSet('ReflectionPropertyModifiers',
\ReflectionProperty::IS_PUBLIC|
\ReflectionProperty::IS_PRIVATE|
\ReflectionProperty::IS_PROTECTED|
\ReflectionProperty::IS_STATIC
);
registerArgumentsSet('ReflectionConstantModifiers',
\ReflectionClassConstant::IS_PUBLIC|
\ReflectionClassConstant::IS_PRIVATE|
\ReflectionClassConstant::IS_PROTECTED
);
registerArgumentsSet('ReflectionGeneratorGetTrace',
\DEBUG_BACKTRACE_PROVIDE_OBJECT,
\DEBUG_BACKTRACE_IGNORE_ARGS
);
registerArgumentsSet('ReflectionAttributeTarget',
\Attribute::TARGET_CLASS|
\Attribute::TARGET_FUNCTION|
\Attribute::TARGET_METHOD|
\Attribute::TARGET_PROPERTY|
\Attribute::TARGET_CLASS_CONSTANT|
\Attribute::TARGET_PARAMETER|
\Attribute::TARGET_ALL
);
expectedArguments(\ReflectionClass::getAttributes(), 1, argumentsSet('ReflectionGetAttributes'));
expectedArguments(\ReflectionClassConstant::getAttributes(), 1, argumentsSet('ReflectionGetAttributes'));
expectedArguments(\ReflectionFunctionAbstract::getAttributes(), 1, argumentsSet('ReflectionGetAttributes'));
expectedArguments(\ReflectionParameter::getAttributes(), 1, argumentsSet('ReflectionGetAttributes'));
expectedArguments(\ReflectionClass::getMethods(), 0, argumentsSet('ReflectionMethodModifiers'));
expectedArguments(\ReflectionClass::getProperties(), 0, argumentsSet('ReflectionPropertyModifiers'));
expectedArguments(\ReflectionGenerator::getTrace(), 0, argumentsSet('ReflectionGeneratorGetTrace'));
expectedReturnValues(\ReflectionClass::getModifiers(), argumentsSet('ReflectionClassModifiers'));
expectedReturnValues(\ReflectionProperty::getModifiers(), argumentsSet('ReflectionPropertyModifiers'));
expectedReturnValues(\ReflectionMethod::getModifiers(), argumentsSet('ReflectionMethodModifiers'));
expectedReturnValues(\ReflectionClassConstant::getModifiers(), argumentsSet('ReflectionConstantModifiers'));
expectedReturnValues(\ReflectionAttribute::getTarget(), argumentsSet('ReflectionAttributeTarget'));
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
<?php
/**
* @since 8.0
*/
class ReflectionAttribute
{
/**
* Indicates that the search for a suitable attribute should not be by
* strict comparison, but by the inheritance chain.
*
* Used for the argument of flags of the "getAttribute" method.
*
* @since 8.0
*/
const IS_INSTANCEOF = 2;
/**
* ReflectionAttribute cannot be created explicitly.
* @since 8.0
*/
private function __construct()
{
}
/**
* Gets attribute name
*
* @return string The name of the attribute parameter.
* @since 8.0
*/
public function getName()
{
}
/**
* Returns the target of the attribute as a bit mask format.
*
* @return int
* @since 8.0
*/
public function getTarget()
{
}
/**
* Returns {@see true} if the attribute is repeated.
*
* @return bool
* @since 8.0
*/
public function isRepeated()
{
}
/**
* Gets list of passed attribute's arguments.
*
* @return array
* @since 8.0
*/
public function getArguments()
{
}
/**
* Creates a new instance of declarted attribute with passed arguments
*
* @return object
* @since 8.0
*/
public function newInstance()
{
}
/**
* ReflectionAttribute cannot be cloned
*
* @return void
* @since 8.0
*/
private function __clone()
{
}
}

View File

@ -0,0 +1,662 @@
<?php
/**
* The <b>ReflectionClass</b> class reports information about a class.
*
* @property-read string $name Name of the class, same as calling the {@see ReflectionClass::getName()} method
*
* @link https://php.net/manual/en/class.reflectionclass.php
*/
class ReflectionClass implements Reflector
{
/**
* Indicates class that is abstract because it has some abstract methods.
*
* @link https://www.php.net/manual/en/class.reflectionclass.php#reflectionclass.constants.is-implicit-abstract
*/
const IS_IMPLICIT_ABSTRACT = 16;
/**
* Indicates class that is abstract because of its definition.
*
* @link https://www.php.net/manual/en/class.reflectionclass.php#reflectionclass.constants.is-explicit-abstract
*/
const IS_EXPLICIT_ABSTRACT = 64;
/**
* Indicates final class.
*
* @link https://www.php.net/manual/en/class.reflectionclass.php#reflectionclass.constants.is-final
*/
const IS_FINAL = 32;
/**
* Constructs a ReflectionClass
*
* @link https://php.net/manual/en/reflectionclass.construct.php
* @param string|object $argument Either a string containing the name of
* the class to reflect, or an object.
* @throws \ReflectionException if the class does not exist.
*/
public function __construct($argument)
{
}
/**
* Exports a reflected class
*
* @link https://php.net/manual/en/reflectionclass.export.php
* @param mixed $argument The reflection to export.
* @param bool $return Setting to {@see true} will return the export, as
* opposed to emitting it. Setting to {@see false} (the default) will do the opposite.
* @return string|null If the $return parameter is set to {@see true}, then the
* export is returned as a string, otherwise {@see null} is returned.
* @deprecated 7.4
* @removed 8.0
*/
public static function export($argument, $return = false)
{
}
/**
* Returns the string representation of the ReflectionClass object.
*
* @link https://php.net/manual/en/reflectionclass.tostring.php
* @return string A string representation of this {@see ReflectionClass} instance.
*/
public function __toString()
{
}
/**
* Gets class name
*
* @link https://php.net/manual/en/reflectionclass.getname.php
* @return string The class name.
*/
public function getName()
{
}
/**
* Checks if class is defined internally by an extension, or the core
*
* @link https://php.net/manual/en/reflectionclass.isinternal.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isInternal()
{
}
/**
* Checks if user defined
*
* @link https://php.net/manual/en/reflectionclass.isuserdefined.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isUserDefined()
{
}
/**
* Checks if the class is instantiable
*
* @link https://php.net/manual/en/reflectionclass.isinstantiable.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isInstantiable()
{
}
/**
* Returns whether this class is cloneable
*
* @link https://php.net/manual/en/reflectionclass.iscloneable.php
* @return bool Returns {@see true} if the class is cloneable, {@see false} otherwise.
* @since 5.4
*/
public function isCloneable()
{
}
/**
* Gets the filename of the file in which the class has been defined
*
* @link https://php.net/manual/en/reflectionclass.getfilename.php
* @return string|false the filename of the file in which the class has been defined.
* If the class is defined in the PHP core or in a PHP extension, {@see false}
* is returned.
*/
public function getFileName()
{
}
/**
* Gets starting line number
*
* @link https://php.net/manual/en/reflectionclass.getstartline.php
* @return int The starting line number, as an integer.
*/
public function getStartLine()
{
}
/**
* Gets end line
*
* @link https://php.net/manual/en/reflectionclass.getendline.php
* @return int|false The ending line number of the user defined class, or
* {@see false} if unknown.
*/
public function getEndLine()
{
}
/**
* Gets doc comments
*
* @link https://php.net/manual/en/reflectionclass.getdoccomment.php
* @return string|false The doc comment if it exists, otherwise {@see false}
*/
public function getDocComment()
{
}
/**
* Gets the constructor of the class
*
* @link https://php.net/manual/en/reflectionclass.getconstructor.php
* @return ReflectionMethod|null A {@see ReflectionMethod} object reflecting
* the class' constructor, or {@see null} if the class has no constructor.
*/
public function getConstructor()
{
}
/**
* Checks if method is defined
*
* @link https://php.net/manual/en/reflectionclass.hasmethod.php
* @param string $name Name of the method being checked for.
* @return bool Returns {@see true} if it has the method, otherwise {@see false}
*/
public function hasMethod($name)
{
}
/**
* Gets a <b>ReflectionMethod</b> for a class method.
*
* @link https://php.net/manual/en/reflectionclass.getmethod.php
* @param string $name The method name to reflect.
* @return ReflectionMethod A {@see ReflectionMethod}
* @throws \ReflectionException if the method does not exist.
*/
public function getMethod($name)
{
}
/**
* Gets an array of methods for the class.
*
* @link https://php.net/manual/en/reflectionclass.getmethods.php
* @param int|null $filter Filter the results to include only methods
* with certain attributes. Defaults to no filtering.
* @return ReflectionMethod[] An array of {@see ReflectionMethod} objects
* reflecting each method.
*/
public function getMethods($filter = null)
{
}
/**
* Checks if property is defined
*
* @link https://php.net/manual/en/reflectionclass.hasproperty.php
* @param string $name Name of the property being checked for.
* @return bool Returns {@see true} if it has the property, otherwise {@see false}
*/
public function hasProperty($name)
{
}
/**
* Gets a <b>ReflectionProperty</b> for a class's property
*
* @link https://php.net/manual/en/reflectionclass.getproperty.php
* @param string $name The property name.
* @return ReflectionProperty A {@see ReflectionProperty}
* @throws ReflectionException If no property exists by that name.
*/
public function getProperty($name)
{
}
/**
* Gets properties
*
* @link https://php.net/manual/en/reflectionclass.getproperties.php
* @param int|null $filter The optional filter, for filtering desired
* property types. It's configured using the {@see ReflectionProperty} constants,
* and defaults to all property types.
* @return ReflectionProperty[]
*/
public function getProperties($filter = null)
{
}
/**
* Gets a ReflectionClassConstant for a class's property
*
* @link https://php.net/manual/en/reflectionclass.getreflectionconstant.php
* @param string $name The class constant name.
* @return ReflectionClassConstant A {@see ReflectionClassConstant}.
* @since 7.1
*/
public function getReflectionConstant($name)
{
}
/**
* Gets class constants
*
* @link https://php.net/manual/en/reflectionclass.getreflectionconstants.php
* @return ReflectionClassConstant[] An array of ReflectionClassConstant objects.
* @since 7.1
*/
public function getReflectionConstants()
{
}
/**
* Checks if constant is defined
*
* @link https://php.net/manual/en/reflectionclass.hasconstant.php
* @param string $name The name of the constant being checked for.
* @return bool Returns {@see true} if the constant is defined, otherwise {@see false}
*/
public function hasConstant($name)
{
}
/**
* Gets constants
*
* @link https://php.net/manual/en/reflectionclass.getconstants.php
* @return array An array of constants, where the keys hold the name and
* the values the value of the constants.
*/
public function getConstants()
{
}
/**
* Gets defined constant
*
* @link https://php.net/manual/en/reflectionclass.getconstant.php
* @param string $name Name of the constant.
* @return mixed|false Value of the constant with the name name.
* Returns {@see false} if the constant was not found in the class.
*/
public function getConstant($name)
{
}
/**
* Gets the interfaces
*
* @link https://php.net/manual/en/reflectionclass.getinterfaces.php
* @return ReflectionClass[] An associative array of interfaces, with keys as interface
* names and the array values as {@see ReflectionClass} objects.
*/
public function getInterfaces()
{
}
/**
* Gets the interface names
*
* @link https://php.net/manual/en/reflectionclass.getinterfacenames.php
* @return string[] A numerical array with interface names as the values.
*/
public function getInterfaceNames()
{
}
/**
* Checks if the class is anonymous
*
* @link https://php.net/manual/en/reflectionclass.isanonymous.php
* @return bool Returns {@see true} on success or {@see false} on failure.
* @since 7.0
*/
public function isAnonymous()
{
}
/**
* Checks if the class is an interface
*
* @link https://php.net/manual/en/reflectionclass.isinterface.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isInterface()
{
}
/**
* Returns an array of traits used by this class
*
* @link https://php.net/manual/en/reflectionclass.gettraits.php
* @return ReflectionClass[]|null an array with trait names in keys and
* instances of trait's {@see ReflectionClass} in values.
* Returns {@see null} in case of an error.
* @since 5.4
*/
public function getTraits()
{
}
/**
* Returns an array of names of traits used by this class
*
* @link https://php.net/manual/en/reflectionclass.gettraitnames.php
* @return string[] An array with trait names in values.
* Returns {@see null} in case of an error.
* @since 5.4
*/
public function getTraitNames()
{
}
/**
* Returns an array of trait aliases
*
* @link https://php.net/manual/en/reflectionclass.gettraitaliases.php
* @return string[] an array with new method names in keys and original
* names (in the format "TraitName::original") in values.
* Returns {@see null} in case of an error.
* @since 5.4
*/
public function getTraitAliases()
{
}
/**
* Returns whether this is a trait
*
* @link https://php.net/manual/en/reflectionclass.istrait.php
* @return bool Returns {@see true} if this is a trait, {@see false} otherwise.
* Returns {@see null} in case of an error.
* @since 5.4
*/
public function isTrait()
{
}
/**
* Checks if class is abstract
*
* @link https://php.net/manual/en/reflectionclass.isabstract.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isAbstract()
{
}
/**
* Checks if class is final
*
* @link https://php.net/manual/en/reflectionclass.isfinal.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isFinal()
{
}
/**
* Gets modifiers
*
* @link https://php.net/manual/en/reflectionclass.getmodifiers.php
* @return int bitmask of modifier constants.
*/
public function getModifiers()
{
}
/**
* Checks class for instance
*
* @link https://php.net/manual/en/reflectionclass.isinstance.php
* @param object $object The object being compared to.
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isInstance($object)
{
}
/**
* Creates a new class instance from given arguments.
*
* @link https://php.net/manual/en/reflectionclass.newinstance.php
* @param mixed ...$args Accepts a variable number of arguments which are
* passed to the class constructor, much like {@see call_user_func}
* @return object a new instance of the class.
* @throws ReflectionException if the class constructor is not public or if
* the class does not have a constructor and the $args parameter contains
* one or more parameters.
*/
public function newInstance(...$args)
{
}
/**
* Creates a new class instance without invoking the constructor.
*
* @link https://php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php
* @return object a new instance of the class.
* @throws ReflectionException if the class is an internal class that
* cannot be instantiated without invoking the constructor. In PHP 5.6.0
* onwards, this exception is limited only to internal classes that are final.
* @since 5.4
*/
public function newInstanceWithoutConstructor()
{
}
/**
* Creates a new class instance from given arguments.
*
* @link https://php.net/manual/en/reflectionclass.newinstanceargs.php
* @param array $args The parameters to be passed to the class constructor as an array.
* @return object a new instance of the class.
* @throws ReflectionException if the class constructor is not public or if
* the class does not have a constructor and the $args parameter contains
* one or more parameters.
* @since 5.1.3
*/
public function newInstanceArgs(array $args = [])
{
}
/**
* Gets parent class
*
* @link https://php.net/manual/en/reflectionclass.getparentclass.php
* @return ReflectionClass|false A {@see ReflectionClass} or {@see false}
* if there's no parent.
*/
public function getParentClass()
{
}
/**
* Checks if a subclass
*
* @link https://php.net/manual/en/reflectionclass.issubclassof.php
* @param string|ReflectionClass $class Either the name of the class as
* string or a {@see ReflectionClass} object of the class to check against.
* @return bool {@see true} on success or {@see false} on failure.
*/
public function isSubclassOf($class)
{
}
/**
* Gets static properties
*
* @link https://php.net/manual/en/reflectionclass.getstaticproperties.php
* @return mixed[] The static properties, as an array where the keys hold
* the name and the values the value of the properties.
*/
public function getStaticProperties()
{
}
/**
* Gets static property value
*
* @link https://php.net/manual/en/reflectionclass.getstaticpropertyvalue.php
* @param string $name The name of the static property for which to return a value.
* @param mixed $default A default value to return in case the class does
* not declare a static property with the given name. If the property does
* not exist and this argument is omitted, a {@see ReflectionException} is thrown.
* @return mixed The value of the static property.
*/
public function getStaticPropertyValue($name, $default = null)
{
}
/**
* Sets static property value
*
* @link https://php.net/manual/en/reflectionclass.setstaticpropertyvalue.php
* @param string $name Property name.
* @param mixed $value New property value.
* @return void No value is returned.
*/
public function setStaticPropertyValue($name, $value)
{
}
/**
* Gets default properties
*
* @link https://php.net/manual/en/reflectionclass.getdefaultproperties.php
* @return mixed[] An array of default properties, with the key being the name
* of the property and the value being the default value of the property
* or {@see null} if the property doesn't have a default value. The function
* does not distinguish between static and non static properties and does
* not take visibility modifiers into account.
*/
public function getDefaultProperties()
{
}
/**
* An alias of {@see ReflectionClass::isIterable} method.
*
* @link https://php.net/manual/en/reflectionclass.isiterateable.php
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function isIterateable()
{
}
/**
* Check whether this class is iterable
*
* @link https://php.net/manual/en/reflectionclass.isiterable.php
* @return bool Returns {@see true} on success or {@see false} on failure.
* @since 7.2
*/
public function isIterable()
{
}
/**
* Checks whether it implements an interface.
*
* @link https://php.net/manual/en/reflectionclass.implementsinterface.php
* @param string $interface The interface name.
* @return bool Returns {@see true} on success or {@see false} on failure.
*/
public function implementsInterface($interface)
{
}
/**
* Gets a <b>ReflectionExtension</b> object for the extension which defined the class
*
* @link https://php.net/manual/en/reflectionclass.getextension.php
* @return ReflectionExtension A {@see ReflectionExtension} object representing
* the extension which defined the class, or {@see null} for user-defined classes.
*/
public function getExtension()
{
}
/**
* Gets the name of the extension which defined the class
*
* @link https://php.net/manual/en/reflectionclass.getextensionname.php
* @return string|false The name of the extension which defined the class,
* or {@see false} for user-defined classes.
*/
public function getExtensionName()
{
}
/**
* Checks if in namespace
*
* @link https://php.net/manual/en/reflectionclass.innamespace.php
* @return bool {@see true} on success or {@see false} on failure.
*/
public function inNamespace()
{
}
/**
* Gets namespace name
*
* @link https://php.net/manual/en/reflectionclass.getnamespacename.php
* @return string The namespace name.
*/
public function getNamespaceName()
{
}
/**
* Gets short name
*
* @link https://php.net/manual/en/reflectionclass.getshortname.php
* @return string The class short name.
*/
public function getShortName()
{
}
/**
* Returns an array of function attributes.
*
* @param string|null $name Name of an attribute class
* @param int $flags Сriteria by which the attribute is searched.
* @return ReflectionAttribute[]
* @since 8.0
*/
public function getAttributes($name = null, $flags = 0)
{
}
/**
* Clones object
*
* @link https://php.net/manual/en/reflectionclass.clone.php
* @return void
*/
final private function __clone()
{
}
}

View File

@ -0,0 +1,182 @@
<?php
/**
* The ReflectionClassConstant class reports information about a class constant.
*
* @property-read string $name Constant name, same as calling the {@see ReflectionClassConstant::getName()} method
* @property-read string $class Fully qualified class name where this constant was defined
*
* @link https://www.php.net/manual/en/class.reflectionclassconstant.php
* @since 7.1
*/
class ReflectionClassConstant implements Reflector
{
/**
* Indicates that the constant is public.
*
* @since 8.0
*/
const IS_PUBLIC = 1;
/**
* Indicates that the constant is protected.
*
* @since 8.0
*/
const IS_PROTECTED = 2;
/**
* Indicates that the constant is private.
*
* @since 8.0
*/
const IS_PRIVATE = 4;
/**
* ReflectionClassConstant constructor.
*
* @param string|object $class Either a string containing the name of the class to reflect, or an object.
* @param string $name The name of the class constant.
* @since 7.1
* @link https://php.net/manual/en/reflectionclassconstant.construct.php
*/
public function __construct($class, $name)
{
}
/**
* @link https://php.net/manual/en/reflectionclassconstant.export.php
* @param string|object $class The reflection to export.
* @param string $name The class constant name.
* @param bool $return Setting to {@see true} will return the export, as opposed to emitting it. Setting
* to {@see false} (the default) will do the opposite.
* @return string|null
* @since 7.1
* @deprecated 7.4
* @removed 8.0
*/
public static function export($class, $name, $return = false)
{
}
/**
* Gets declaring class
*
* @return ReflectionClass
* @link https://php.net/manual/en/reflectionclassconstant.getdeclaringclass.php
* @since 7.1
*/
public function getDeclaringClass()
{
}
/**
* Gets doc comments
*
* @return string|false The doc comment if it exists, otherwise {@see false}
* @link https://php.net/manual/en/reflectionclassconstant.getdoccomment.php
* @since 7.1
*/
public function getDocComment()
{
}
/**
* Gets the class constant modifiers
*
* @return int A numeric representation of the modifiers. The actual meanings of these modifiers are described in
* the predefined constants.
* @link https://php.net/manual/en/reflectionclassconstant.getmodifiers.php
* @since 7.1
*/
public function getModifiers()
{
}
/**
* Get name of the constant
*
* @link https://php.net/manual/en/reflectionclassconstant.getname.php
* @return string Returns the constant's name.
* @since 7.1
*/
public function getName()
{
}
/**
* Gets value
*
* @link https://php.net/manual/en/reflectionclassconstant.getvalue.php
* @return mixed The value of the class constant.
* @since 7.1
*/
public function getValue()
{
}
/**
* Checks if class constant is private
*
* @link https://php.net/manual/en/reflectionclassconstant.isprivate.php
* @return bool
* @since 7.1
*/
public function isPrivate()
{
}
/**
* Checks if class constant is protected
*
* @link https://php.net/manual/en/reflectionclassconstant.isprotected.php
* @return bool
* @since 7.1
*/
public function isProtected()
{
}
/**
* Checks if class constant is public
*
* @link https://php.net/manual/en/reflectionclassconstant.ispublic.php
* @return bool
* @since 7.1
*/
public function isPublic()
{
}
/**
* Returns the string representation of the ReflectionClassConstant object.
*
* @link https://php.net/manual/en/reflectionclassconstant.tostring.php
* @return string
* @since 7.1
*/
public function __toString()
{
}
/**
* Returns an array of constant attributes.
*
* @param string|null $name Name of an attribute class
* @param int $flags Сriteria by which the attribute is searched.
* @return ReflectionAttribute[]
* @since 8.0
*/
public function getAttributes($name = null, $flags = 0)
{
}
/**
* ReflectionClassConstant cannot be cloned
*
* @return void
*/
final private function __clone()
{
}
}

View File

@ -0,0 +1,10 @@
<?php
/**
* The ReflectionException class.
*
* @link https://php.net/manual/en/class.reflectionexception.php
*/
class ReflectionException extends Exception
{
}

View File

@ -0,0 +1,180 @@
<?php
/**
* The <b>ReflectionExtension</b> class reports information about an extension.
*
* @property-read string $name Name of the extension, same as calling the {@see ReflectionExtension::getName()} method
*
* @link https://php.net/manual/en/class.reflectionextension.php
*/
class ReflectionExtension implements Reflector
{
/**
* Constructs a ReflectionExtension
*
* @link https://php.net/manual/en/reflectionextension.construct.php
* @param string $name Name of the extension.
* @throws \ReflectionException if the extension does not exist.
*/
public function __construct($name)
{
}
/**
* Exports a reflected extension.
* The output format of this function is the same as the CLI argument --re [extension].
*
* @link https://php.net/manual/en/reflectionextension.export.php
* @param string $name The reflection to export.
* @param bool $return Setting to {@see true} will return the
* export, as opposed to emitting it. Setting to {@see false} (the default)
* will do the opposite.
* @return string|null If the $return parameter is set to {@see true}, then
* the export is returned as a string, otherwise {@see null} is returned.
* @deprecated 7.4
* @removed 8.0
*/
public static function export($name, $return = false)
{
}
/**
* To string
*
* @link https://php.net/manual/en/reflectionextension.tostring.php
* @return string the exported extension as a string, in the same way as
* the {@see ReflectionExtension::export()}.
*/
public function __toString()
{
}
/**
* Gets extension name
*
* @link https://php.net/manual/en/reflectionextension.getname.php
* @return string The extensions name.
*/
public function getName()
{
}
/**
* Gets extension version
*
* @link https://php.net/manual/en/reflectionextension.getversion.php
* @return string The version of the extension.
*/
public function getVersion()
{
}
/**
* Gets extension functions
*
* @link https://php.net/manual/en/reflectionextension.getfunctions.php
* @return ReflectionFunction[] An associative array of {@see ReflectionFunction} objects,
* for each function defined in the extension with the keys being the function
* names. If no function are defined, an empty array is returned.
*/
public function getFunctions()
{
}
/**
* Gets constants
*
* @link https://php.net/manual/en/reflectionextension.getconstants.php
* @return array An associative array with constant names as keys.
*/
public function getConstants()
{
}
/**
* Gets extension ini entries
*
* @link https://php.net/manual/en/reflectionextension.getinientries.php
* @return array An associative array with the ini entries as keys,
* with their defined values as values.
*/
public function getINIEntries()
{
}
/**
* Gets classes
*
* @link https://php.net/manual/en/reflectionextension.getclasses.php
* @return ReflectionClass[] An array of {@see ReflectionClass} objects, one
* for each class within the extension. If no classes are defined,
* an empty array is returned.
*/
public function getClasses()
{
}
/**
* Gets class names
*
* @link https://php.net/manual/en/reflectionextension.getclassnames.php
* @return string[] An array of class names, as defined in the extension.
* If no classes are defined, an empty array is returned.
*/
public function getClassNames()
{
}
/**
* Gets dependencies
*
* @link https://php.net/manual/en/reflectionextension.getdependencies.php
* @return string[] An associative array with dependencies as keys and
* either Required, Optional or Conflicts as the values.
*/
public function getDependencies()
{
}
/**
* Print extension info
*
* @link https://php.net/manual/en/reflectionextension.info.php
* @return void Print extension info
*/
public function info()
{
}
/**
* Returns whether this extension is persistent
*
* @link https://php.net/manual/en/reflectionextension.ispersistent.php
* @return bool Returns {@see true} for extensions loaded by extension, {@see false} otherwise.
* @since 5.4
*/
public function isPersistent()
{
}
/**
* Returns whether this extension is temporary
*
* @link https://php.net/manual/en/reflectionextension.istemporary.php
* @return bool Returns {@see true} for extensions loaded by {@see dl()}, {@see false} otherwise.
* @since 5.4
*/
public function isTemporary()
{
}
/**
* Clones
*
* @link https://php.net/manual/en/reflectionextension.clone.php
* @return void No value is returned, if called a fatal error will occur.
*/
final private function __clone()
{
}
}

View File

@ -0,0 +1,102 @@
<?php
/**
* The <b>ReflectionFunction</b> class reports
* information about a function.
*
* @property-read string $name Function name, same as calling the {@see ReflectionFunction::getName()} method
*
* @link https://php.net/manual/en/class.reflectionfunction.php
*/
class ReflectionFunction extends ReflectionFunctionAbstract
{
/**
* Indicates deprecated functions.
*
* @link https://www.php.net/manual/en/class.reflectionfunction.php#reflectionfunction.constants.is-deprecated
*/
const IS_DEPRECATED = 2048;
/**
* Constructs a ReflectionFunction object
*
* @link https://php.net/manual/en/reflectionfunction.construct.php
* @param string|Closure $name The name of the function to reflect or a closure.
* @throws ReflectionException if the function does not exist.
*/
public function __construct($name)
{
}
/**
* Returns the string representation of the ReflectionFunction object.
*
* @link https://php.net/manual/en/reflectionfunction.tostring.php
*/
public function __toString()
{
}
/**
* Exports function
*
* @link https://php.net/manual/en/reflectionfunction.export.php
* @param string $name The reflection to export.
* @param bool $return Setting to {@see true} will return the
* export, as opposed to emitting it. Setting to {@see false} (the default)
* will do the opposite.
* @return string|null If the $return parameter is set to {@see true}, then
* the export is returned as a string, otherwise {@see null} is returned.
* @deprecated 7.4
* @removed 8.0
*/
public static function export($name, $return = false)
{
}
/**
* Checks if function is disabled
*
* @link https://php.net/manual/en/reflectionfunction.isdisabled.php
* @return bool {@see true} if it's disable, otherwise {@see false}
*/
public function isDisabled()
{
}
/**
* Invokes function
*
* @link https://www.php.net/manual/en/reflectionfunction.invoke.php
* @param mixed ...$args The passed in argument list. It accepts a
* variable number of arguments which are passed to the function much
* like {@see call_user_func} is.
* @return mixed Returns the result of the invoked function call.
*/
public function invoke(...$args)
{
}
/**
* Invokes function args
*
* @link https://php.net/manual/en/reflectionfunction.invokeargs.php
* @param array $args The passed arguments to the function as an array, much
* like {@see call_user_func_array} works.
* </p>
* @return mixed the result of the invoked function
*/
public function invokeArgs(array $args)
{
}
/**
* Returns a dynamically created closure for the function
*
* @link https://php.net/manual/en/reflectionfunction.getclosure.php
* @return Closure Returns {@see Closure} or {@see null} in case of an error.
*/
public function getClosure()
{
}
}

View File

@ -0,0 +1,296 @@
<?php
/**
* A parent class to <b>ReflectionFunction</b>, read its
* description for details.
*
* @property-read string $name Name of the function, same as calling the {@see ReflectionFunctionAbstract::getName()} method
*
* @link https://php.net/manual/en/class.reflectionfunctionabstract.php
*/
abstract class ReflectionFunctionAbstract implements Reflector
{
/**
* Clones function
*
* @link https://php.net/manual/en/reflectionfunctionabstract.clone.php
* @return void
*/
final private function __clone()
{
}
/**
* Checks if function in namespace
*
* @link https://php.net/manual/en/reflectionfunctionabstract.innamespace.php
* @return bool {@see true} if it's in a namespace, otherwise {@see false}
*/
public function inNamespace()
{
}
/**
* Checks if closure
*
* @link https://php.net/manual/en/reflectionfunctionabstract.isclosure.php
* @return bool {@see true} if it's a closure, otherwise {@see false}
*/
public function isClosure()
{
}
/**
* Checks if deprecated
*
* @link https://php.net/manual/en/reflectionfunctionabstract.isdeprecated.php
* @return bool {@see true} if it's deprecated, otherwise {@see false}
*/
public function isDeprecated()
{
}
/**
* Checks if is internal
*
* @link https://php.net/manual/en/reflectionfunctionabstract.isinternal.php
* @return bool {@see true} if it's internal, otherwise {@see false}
*/
public function isInternal()
{
}
/**
* Checks if user defined
*
* @link https://php.net/manual/en/reflectionfunctionabstract.isuserdefined.php
* @return bool {@see true} if it's user-defined, otherwise {@see false}
*/
public function isUserDefined()
{
}
/**
* Returns whether this function is a generator
*
* @link https://php.net/manual/en/reflectionfunctionabstract.isgenerator.php
* @return bool {@see true} if the function is generator, otherwise {@see false}
* @since 5.5
*/
public function isGenerator()
{
}
/**
* Returns whether this function is variadic
*
* @link https://php.net/manual/en/reflectionfunctionabstract.isvariadic.php
* @return bool {@see true} if the function is variadic, otherwise {@see false}
* @since 5.6
*/
public function isVariadic()
{
}
/**
* Returns this pointer bound to closure
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getclosurethis.php
* @return object|null Returns $this pointer or {@see null} in case of an error.
*/
public function getClosureThis()
{
}
/**
* Returns the scope associated to the closure
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getclosurescopeclass.php
* @return ReflectionClass|null Returns the class on success or {@see null}
* on failure.
* @since 5.4
*/
public function getClosureScopeClass()
{
}
/**
* Gets doc comment
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getdoccomment.php
* @return string|false The doc comment if it exists, otherwise {@see false}
*/
public function getDocComment()
{
}
/**
* Gets end line number
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getendline.php
* @return int|false The ending line number of the user defined function,
* or {@see false} if unknown.
*/
public function getEndLine()
{
}
/**
* Gets extension info
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getextension.php
* @return ReflectionExtension|null The extension information, as a
* {@see ReflectionExtension} object or {@see null} instead.
*/
public function getExtension()
{
}
/**
* Gets extension name
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getextensionname.php
* @return string|null The extension's name or {@see null} instead.
*/
public function getExtensionName()
{
}
/**
* Gets file name
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getfilename.php
* @return string|false The file name or {@see false} in case of error.
*/
public function getFileName()
{
}
/**
* Gets function name
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getname.php
* @return string The name of the function.
*/
public function getName()
{
}
/**
* Gets namespace name
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getnamespacename.php
* @return string The namespace name.
*/
public function getNamespaceName()
{
}
/**
* Gets number of parameters
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getnumberofparameters.php
* @return int The number of parameters.
* @since 5.0.3
*/
public function getNumberOfParameters()
{
}
/**
* Gets number of required parameters
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getnumberofrequiredparameters.php
* @return int The number of required parameters.
* @since 5.0.3
*/
public function getNumberOfRequiredParameters()
{
}
/**
* Gets parameters
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getparameters.php
* @return ReflectionParameter[] The parameters, as a ReflectionParameter objects.
*/
public function getParameters()
{
}
/**
* Gets the specified return type of a function
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getreturntype.php
* @return ReflectionType|null Returns a {@see ReflectionType} object if a
* return type is specified, {@see null} otherwise.
* @since 7.0
*/
public function getReturnType()
{
}
/**
* Gets function short name
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getshortname.php
* @return string The short name of the function.
*/
public function getShortName()
{
}
/**
* Gets starting line number
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getstartline.php
* @return int The starting line number.
*/
public function getStartLine()
{
}
/**
* Gets static variables
*
* @link https://php.net/manual/en/reflectionfunctionabstract.getstaticvariables.php
* @return array An array of static variables.
*/
public function getStaticVariables()
{
}
/**
* Checks if returns reference
*
* @link https://php.net/manual/en/reflectionfunctionabstract.returnsreference.php
* @return bool {@see true} if it returns a reference, otherwise {@see false}
*/
public function returnsReference()
{
}
/**
* Checks if the function has a specified return type
*
* @link https://php.net/manual/en/reflectionfunctionabstract.hasreturntype.php
* @return bool Returns {@see true} if the function is a specified return
* type, otherwise {@see false}.
* @since 7.0
*/
public function hasReturnType()
{
}
/**
* Returns an array of function attributes.
*
* @param string|null $name Name of an attribute class
* @param int $flags Сriteria by which the attribute is searched.
* @return ReflectionAttribute[]
* @since 8.0
*/
public function getAttributes($name = null, $flags = 0)
{
}
}

View File

@ -0,0 +1,103 @@
<?php
/**
* The ReflectionGenerator class reports information about a generator.
*
* @since 7.0
*/
class ReflectionGenerator
{
/**
* Constructs a ReflectionGenerator object
*
* @link https://php.net/manual/en/reflectiongenerator.construct.php
* @param Generator $generator A generator object.
* @since 7.0
*/
public function __construct(Generator $generator)
{
}
/**
* Gets the currently executing line of the generator
*
* @link https://php.net/manual/en/reflectiongenerator.getexecutingline.php
* @return int Returns the line number of the currently executing statement
* in the generator.
* @since 7.0
*/
public function getExecutingLine()
{
}
/**
* Gets the file name of the currently executing generator
*
* @link https://php.net/manual/en/reflectiongenerator.getexecutingfile.php
* @return string Returns the full path and file name of the currently
* executing generator.
* @since 7.0
*/
public function getExecutingFile()
{
}
/**
* Gets the trace of the executing generator
*
* @link https://php.net/manual/en/reflectiongenerator.gettrace.php
* @param int $options The value of <em>options</em> can be any of the following the following flags.
*
* Available options:
*
* {@see DEBUG_BACKTRACE_PROVIDE_OBJECT} - Default
*
* {@see DEBUG_BACKTRACE_IGNORE_ARGS} - Don't include the argument
* information for functions in the stack trace.
* </p>
*
* @return array Returns the trace of the currently executing generator.
* @since 7.0
*/
public function getTrace($options = DEBUG_BACKTRACE_PROVIDE_OBJECT)
{
}
/**
* Gets the function name of the generator
*
* @link https://php.net/manual/en/reflectiongenerator.getfunction.php
* @return ReflectionFunctionAbstract Returns a {@see ReflectionFunctionAbstract}
* class. This will be {@see ReflectionFunction} for functions,
* or {@see ReflectionMethod} for methods.
* @since 7.0
*/
public function getFunction()
{
}
/**
* Gets the function name of the generator
*
* @link https://php.net/manual/en/reflectiongenerator.getthis.php
* @return object|null Returns the $this value, or {@see null} if the
* generator was not created in a class context.
* @since 7.0
*/
public function getThis()
{
}
/**
* Gets the executing Generator object
*
* @link https://php.net/manual/en/reflectiongenerator.construct.php
* @return Generator Returns the currently executing Generator object.
* @since 7.0
*
*/
public function getExecutingGenerator()
{
}
}

View File

@ -0,0 +1,274 @@
<?php
/**
* The <b>ReflectionMethod</b> class reports
* information about a method.
*
* @property-read string $name Name of the method, same as calling the {@see ReflectionMethod::getName()} method
* @property-read string $class Fully qualified class name where this method was defined
*
* @link https://php.net/manual/en/class.reflectionmethod.php
*/
class ReflectionMethod extends ReflectionFunctionAbstract
{
/**
* Indicates that the method is static.
*/
const IS_STATIC = 16;
/**
* Indicates that the method is public.
*/
const IS_PUBLIC = 1;
/**
* Indicates that the method is protected.
*/
const IS_PROTECTED = 2;
/**
* Indicates that the method is private.
*/
const IS_PRIVATE = 4;
/**
* Indicates that the method is abstract.
*/
const IS_ABSTRACT = 64;
/**
* Indicates that the method is final.
*/
const IS_FINAL = 32;
/**
* Constructs a ReflectionMethod
*
* <code>
* $reflection = new ReflectionMethod(new Example(), 'method');
* $reflection = new ReflectionMethod(Example::class, 'method');
* $reflection = new ReflectionMethod('Example::method');
* </code>
*
* @link https://php.net/manual/en/reflectionmethod.construct.php
* @param string|object $classOrName Classname, object
* (instance of the class) that contains the method or class name and
* method name delimited by ::.
* @param string|null $name Name of the method if the first argument is a
* classname or an object.
* @throws \ReflectionException if the class or method does not exist.
*/
public function __construct($classOrName, $name = null)
{
}
/**
* Export a reflection method.
*
* @link https://php.net/manual/en/reflectionmethod.export.php
* @param string $class The class name.
* @param string $name The name of the method.
* @param bool $return Setting to {@see true} will return the export,
* as opposed to emitting it. Setting to {@see false} (the default) will do the
* opposite.
* @return string|null If the $return parameter is set to {@see true}, then
* the export is returned as a string, otherwise {@see null} is returned.
* @deprecated 7.4
* @removed 8.0
*/
public static function export($class, $name, $return = false)
{
}
/**
* Returns the string representation of the ReflectionMethod object.
*
* @link https://php.net/manual/en/reflectionmethod.tostring.php
* @return string A string representation of this {@see ReflectionMethod} instance.
*/
public function __toString()
{
}
/**
* Checks if method is public
*
* @link https://php.net/manual/en/reflectionmethod.ispublic.php
* @return bool Returns {@see true} if the method is public, otherwise {@see false}
*/
public function isPublic()
{
}
/**
* Checks if method is private
*
* @link https://php.net/manual/en/reflectionmethod.isprivate.php
* @return bool Returns {@see true} if the method is private, otherwise {@see false}
*/
public function isPrivate()
{
}
/**
* Checks if method is protected
*
* @link https://php.net/manual/en/reflectionmethod.isprotected.php
* @return bool Returns {@see true} if the method is protected, otherwise {@see false}
*/
public function isProtected()
{
}
/**
* Checks if method is abstract
*
* @link https://php.net/manual/en/reflectionmethod.isabstract.php
* @return bool Returns {@see true} if the method is abstract, otherwise {@see false}
*/
public function isAbstract()
{
}
/**
* Checks if method is final
*
* @link https://php.net/manual/en/reflectionmethod.isfinal.php
* @return bool Returns {@see true} if the method is final, otherwise {@see false}
*/
public function isFinal()
{
}
/**
* Checks if method is static
*
* @link https://php.net/manual/en/reflectionmethod.isstatic.php
* @return bool Returns {@see true} if the method is static, otherwise {@see false}
*/
public function isStatic()
{
}
/**
* Checks if method is a constructor
*
* @link https://php.net/manual/en/reflectionmethod.isconstructor.php
* @return bool Returns {@see true} if the method is a constructor, otherwise {@see false}
*/
public function isConstructor()
{
}
/**
* Checks if method is a destructor
*
* @link https://php.net/manual/en/reflectionmethod.isdestructor.php
* @return bool Returns {@see true} if the method is a destructor, otherwise {@see false}
*/
public function isDestructor()
{
}
/**
* Returns a dynamically created closure for the method
*
* @link https://php.net/manual/en/reflectionmethod.getclosure.php
* @param object $object Forbidden for static methods, required for other methods or nothing.
* @return Closure Retruns {@see Closure} or {@see null} in case of an error.
* @since 5.4
*/
public function getClosure($object = null)
{
}
/**
* Gets the method modifiers
*
* @link https://php.net/manual/en/reflectionmethod.getmodifiers.php
* @return int A numeric representation of the modifiers. The modifiers are
* listed below. The actual meanings of these modifiers are described in the
* predefined constants.
*
* ReflectionMethod modifiers:
*
* - {@see ReflectionMethod::IS_STATIC} - Indicates that the method is static.
* - {@see ReflectionMethod::IS_PUBLIC} - Indicates that the method is public.
* - {@see ReflectionMethod::IS_PROTECTED} - Indicates that the method is protected.
* - {@see ReflectionMethod::IS_PRIVATE} - Indicates that the method is private.
* - {@see ReflectionMethod::IS_ABSTRACT} - Indicates that the method is abstract.
* - {@see ReflectionMethod::IS_FINAL} - Indicates that the method is final.
*/
public function getModifiers()
{
}
/**
* Invokes a reflected method.
*
* @link https://php.net/manual/en/reflectionmethod.invoke.php
* @param object|null $object The object to invoke the method on. For static
* methods, pass {@see null} to this parameter.
* @param mixed ...$args Zero or more parameters to be passed to the
* method. It accepts a variable number of parameters which are passed to
* the method.
* @return mixed Returns the method result.
* @throws ReflectionException if the object parameter does not contain an
* instance of the class that this method was declared in or the method
* invocation failed.
*/
public function invoke($object = null, ...$args)
{
}
/**
* Invokes the reflected method and pass its arguments as array.
*
* @link https://php.net/manual/en/reflectionmethod.invokeargs.php
* @param object|null $object The object to invoke the method on. In case
* of static methods, you can pass {@see null} to this parameter.
* @param array $args The parameters to be passed to the function, as an {@see array}.
* @return mixed the method result.
* @throws ReflectionException if the object parameter does not contain an
* instance of the class that this method was declared in or the method
* invocation failed.
*/
public function invokeArgs($object, array $args)
{
}
/**
* Gets declaring class for the reflected method.
*
* @link https://php.net/manual/en/reflectionmethod.getdeclaringclass.php
* @return ReflectionClass A {@see ReflectionClass} object of the class that the
* reflected method is part of.
*/
public function getDeclaringClass()
{
}
/**
* Gets the method prototype (if there is one).
*
* @link https://php.net/manual/en/reflectionmethod.getprototype.php
* @return ReflectionMethod A {@see ReflectionMethod} instance of the method prototype.
* @throws ReflectionException if the method does not have a prototype
*/
public function getPrototype()
{
}
/**
* Set method accessibility
*
* @link https://php.net/manual/en/reflectionmethod.setaccessible.php
* @param bool $accessible {@see true} to allow accessibility, or {@see false}
* @return void No value is returned.
* @since 5.3.2
*/
public function setAccessible($accessible)
{
}
}

View File

@ -0,0 +1,31 @@
<?php
/**
* @since 7.1
*/
class ReflectionNamedType extends ReflectionType
{
/**
* Get the text of the type hint.
*
* @link https://php.net/manual/en/reflectionnamedtype.getname.php
* @return string Returns the text of the type hint.
* @since 7.1
*/
public function getName()
{
}
/**
* Checks if it is a built-in type
*
* @link https://php.net/manual/en/reflectiontype.isbuiltin.php
* @return bool Returns {@see true} if it's a built-in type, otherwise {@see false}
*
* @since 7.1 overrides the parent {@see ReflectionType::isBuiltin()} method.
* @since 8.0 method was removed from the parent {@see ReflectionType} class.
*/
public function isBuiltin()
{
}
}

View File

@ -0,0 +1,37 @@
<?php
/**
* The <b>ReflectionObject</b> class reports
* information about an object.
*
* @link https://php.net/manual/en/class.reflectionobject.php
*/
class ReflectionObject extends ReflectionClass
{
/**
* Constructs a ReflectionObject
*
* @link https://php.net/manual/en/reflectionobject.construct.php
* @param object $argument An object instance.
*/
public function __construct($argument)
{
}
/**
* Export
*
* @link https://php.net/manual/en/reflectionobject.export.php
* @param string $argument The reflection to export.
* @param bool $return Setting to {@see true} will return the export,
* as opposed to emitting it. Setting to {@see false} (the default) will do
* the opposite.
* @return string|null If the $return parameter is set to {@see true}, then
* the export is returned as a string, otherwise {@see null} is returned.
* @deprecated 7.4
* @removed 8.0
*/
public static function export($argument, $return = false)
{
}
}

View File

@ -0,0 +1,285 @@
<?php
/**
* The <b>ReflectionParameter</b> class retrieves
* information about function's or method's parameters.
*
* @property-read string $name Name of the parameter, same as calling the {@see ReflectionParameter::getName()} method
*
* @link https://php.net/manual/en/class.reflectionparameter.php
*/
class ReflectionParameter implements Reflector
{
/**
* Construct
*
* @link https://php.net/manual/en/reflectionparameter.construct.php
* @param callable $function The function to reflect parameters from.
* @param string|int $parameter Either an integer specifying the position
* of the parameter (starting with zero), or a the parameter name as string.
* @throws \ReflectionException if the function or parameter does not exist.
*/
public function __construct(callable $function, $parameter)
{
}
/**
* Exports
*
* @link https://php.net/manual/en/reflectionparameter.export.php
* @param string $function The function name.
* @param string $parameter The parameter name.
* @param bool $return Setting to {@see true} will return the export,
* as opposed to emitting it. Setting to {@see false} (the default) will do the
* opposite.
* @return string|null The exported reflection.
* @deprecated 7.4
* @removed 8.0
*/
public static function export($function, $parameter, $return = false)
{
}
/**
* Returns the string representation of the ReflectionParameter object.
*
* @link https://php.net/manual/en/reflectionparameter.tostring.php
* @return string
*/
public function __toString()
{
}
/**
* Gets parameter name
*
* @link https://php.net/manual/en/reflectionparameter.getname.php
* @return string The name of the reflected parameter.
*/
public function getName()
{
}
/**
* Checks if passed by reference
*
* @link https://php.net/manual/en/reflectionparameter.ispassedbyreference.php
* @return bool {@see true} if the parameter is passed in by reference, otherwise {@see false}
*/
public function isPassedByReference()
{
}
/**
* Returns whether this parameter can be passed by value
*
* @link https://php.net/manual/en/reflectionparameter.canbepassedbyvalue.php
* @return bool|null {@see true} if the parameter can be passed by value, {@see false} otherwise.
* Returns {@see null} in case of an error.
* @since 5.4
*/
public function canBePassedByValue()
{
}
/**
* Gets declaring function
*
* @link https://php.net/manual/en/reflectionparameter.getdeclaringfunction.php
* @return ReflectionFunctionAbstract A {@see ReflectionFunctionAbstract} object.
* @since 5.2.3
*/
public function getDeclaringFunction()
{
}
/**
* Gets declaring class
*
* @link https://php.net/manual/en/reflectionparameter.getdeclaringclass.php
* @return ReflectionClass|null A {@see ReflectionClass} object or {@see null} if
* called on function.
*/
public function getDeclaringClass()
{
}
/**
* Gets the class type hinted for the parameter as a ReflectionClass object.
*
* @link https://php.net/manual/en/reflectionparameter.getclass.php
* @return ReflectionClass|null A {@see ReflectionClass} object.
* @deprecated 7.4
* @removed 8.0
*/
public function getClass()
{
}
/**
* Checks if the parameter has a type associated with it.
*
* @link https://php.net/manual/en/reflectionparameter.hastype.php
* @return bool {@see true} if a type is specified, {@see false} otherwise.
* @since 7.0
*/
public function hasType()
{
}
/**
* Gets a parameter's type
*
* @link https://php.net/manual/en/reflectionparameter.gettype.php
* @return ReflectionType|null Returns a {@see ReflectionType} object if a
* parameter type is specified, {@see null} otherwise.
* @since 7.0
*/
public function getType()
{
}
/**
* Checks if parameter expects an array
*
* @link https://php.net/manual/en/reflectionparameter.isarray.php
* @return bool {@see true} if an array is expected, {@see false} otherwise.
*/
public function isArray()
{
}
/**
* Returns whether parameter MUST be callable
*
* @link https://php.net/manual/en/reflectionparameter.iscallable.php
* @return bool|null Returns {@see true} if the parameter is callable, {@see false}
* if it is not or {@see null} on failure.
* @since 5.4
*/
public function isCallable()
{
}
/**
* Checks if null is allowed
*
* @link https://php.net/manual/en/reflectionparameter.allowsnull.php
* @return bool Returns {@see true} if {@see null} is allowed,
* otherwise {@see false}
*/
public function allowsNull()
{
}
/**
* Gets parameter position
*
* @link https://php.net/manual/en/reflectionparameter.getposition.php
* @return int The position of the parameter, left to right, starting at position #0.
* @since 5.2.3
*/
public function getPosition()
{
}
/**
* Checks if optional
*
* @link https://php.net/manual/en/reflectionparameter.isoptional.php
* @return bool Returns {@see true} if the parameter is optional, otherwise {@see false}
* @since 5.0.3
*/
public function isOptional()
{
}
/**
* Checks if a default value is available
*
* @link https://php.net/manual/en/reflectionparameter.isdefaultvalueavailable.php
* @return bool Returns {@see true} if a default value is available, otherwise {@see false}
* @since 5.0.3
*/
public function isDefaultValueAvailable()
{
}
/**
* Gets default parameter value
*
* @link https://php.net/manual/en/reflectionparameter.getdefaultvalue.php
* @return mixed The parameters default value.
* @throws \ReflectionException if the parameter is not optional
* @since 5.0.3
*/
public function getDefaultValue()
{
}
/**
* Returns whether the default value of this parameter is constant
*
* @link https://php.net/manual/en/reflectionparameter.isdefaultvalueconstant.php
* @return bool Returns {@see true} if the default value is constant, and {@see false} otherwise.
* @since 5.4.6
*/
public function isDefaultValueConstant()
{
}
/**
* Returns the default value's constant name if default value is constant or null
*
* @link https://php.net/manual/en/reflectionparameter.getdefaultvalueconstantname.php
* @return string|null Returns string on success or {@see null} on failure.
* @throws \ReflectionException if the parameter is not optional
* @since 5.4.6
*/
public function getDefaultValueConstantName()
{
}
/**
* Returns whether this function is variadic
*
* @link https://php.net/manual/en/reflectionparameter.isvariadic.php
* @return bool Returns {@see true} if the function is variadic, otherwise {@see false}
* @since 5.6
*/
public function isVariadic()
{
}
/**
* Returns information about whether the parameter is a promoted.
*
* @return bool Returns {@see true} if the parameter promoted or {@see false} instead
* @since 8.0
*/
public function isPromoted()
{
}
/**
* Returns an array of parameter attributes.
*
* @param string|null $name Name of an attribute class
* @param int $flags Сriteria by which the attribute is searched.
* @return ReflectionAttribute[]
* @since 8.0
*/
public function getAttributes($name = null, $flags = 0)
{
}
/**
* Clone
*
* @link https://php.net/manual/en/reflectionparameter.clone.php
* @return void
*/
final private function __clone()
{
}
}

View File

@ -0,0 +1,267 @@
<?php
/**
* The <b>ReflectionProperty</b> class reports information about a classes
* properties.
*
* @property-read string $name Name of the property, same as calling the {@see ReflectionProperty::getName()} method
* @property-read string $class Fully qualified class name where this property was defined
*
* @link https://php.net/manual/en/class.reflectionproperty.php
*/
class ReflectionProperty implements Reflector
{
/**
* Indicates that the property is static.
*
* @link https://www.php.net/manual/en/class.reflectionproperty.php#reflectionproperty.constants.is-static
*/
const IS_STATIC = 16;
/**
* Indicates that the property is public.
*
* @link https://www.php.net/manual/en/class.reflectionproperty.php#reflectionproperty.constants.is-public
*/
const IS_PUBLIC = 1;
/**
* Indicates that the property is protected.
*
* @link https://www.php.net/manual/en/class.reflectionproperty.php#reflectionproperty.constants.is-protected
*/
const IS_PROTECTED = 2;
/**
* Indicates that the property is private.
*
* @link https://www.php.net/manual/en/class.reflectionproperty.php#reflectionproperty.constants.is-private
*/
const IS_PRIVATE = 4;
/**
* Construct a ReflectionProperty object
*
* @link https://php.net/manual/en/reflectionproperty.construct.php
* @param string|object $class The class name, that contains the property.
* @param string $name The name of the property being reflected.
* @throws \ReflectionException if the class or property does not exist.
*/
public function __construct($class, $name)
{
}
/**
* Export
*
* @link https://php.net/manual/en/reflectionproperty.export.php
* @param mixed $class The reflection to export.
* @param string $name The property name.
* @param bool $return Setting to {@see true} will return the export, as
* opposed to emitting it. Setting to {@see false} (the default) will do the
* opposite.
* @return string|null
* @deprecated 7.4
* @removed 8.0
*/
public static function export($class, $name, $return = false)
{
}
/**
* To string
*
* @link https://php.net/manual/en/reflectionproperty.tostring.php
* @return string
*/
public function __toString()
{
}
/**
* Gets property name
*
* @link https://php.net/manual/en/reflectionproperty.getname.php
* @return string The name of the reflected property.
*/
public function getName()
{
}
/**
* Gets value
*
* @link https://php.net/manual/en/reflectionproperty.getvalue.php
* @param object $object If the property is non-static an object must be
* provided to fetch the property from. If you want to fetch the default
* property without providing an object use {@see ReflectionClass::getDefaultProperties}
* instead.
* </p>
* @return mixed The current value of the property.
*/
public function getValue($object = null)
{
}
/**
* Set property value
*
* @link https://php.net/manual/en/reflectionproperty.setvalue.php
* @param mixed $objectOrValue If the property is non-static an object must
* be provided to change the property on. If the property is static this
* parameter is left out and only $value needs to be provided.
* @param mixed $value The new value.
* @return void No value is returned.
*/
public function setValue($objectOrValue, $value = null)
{
}
/**
* Checks if property is public
*
* @link https://php.net/manual/en/reflectionproperty.ispublic.php
* @return bool Return {@see true} if the property is public, {@see false} otherwise.
*/
public function isPublic()
{
}
/**
* Checks if property is private
*
* @link https://php.net/manual/en/reflectionproperty.isprivate.php
* @return bool Return {@see true} if the property is private, {@see false} otherwise.
*/
public function isPrivate()
{
}
/**
* Checks if property is protected
*
* @link https://php.net/manual/en/reflectionproperty.isprotected.php
* @return bool Returns {@see true} if the property is protected, {@see false} otherwise.
*/
public function isProtected()
{
}
/**
* Checks if property is static
*
* @link https://php.net/manual/en/reflectionproperty.isstatic.php
* @return bool Retruns {@see true} if the property is static, {@see false} otherwise.
*/
public function isStatic()
{
}
/**
* Checks if default value
*
* @link https://php.net/manual/en/reflectionproperty.isdefault.php
* @return bool Returns {@see true} if the property was declared at
* compile-time, or {@see false} if it was created at run-time.
*/
public function isDefault()
{
}
/**
* Gets modifiers
*
* @link https://php.net/manual/en/reflectionproperty.getmodifiers.php
* @return int A numeric representation of the modifiers.
*/
public function getModifiers()
{
}
/**
* Gets declaring class
*
* @link https://php.net/manual/en/reflectionproperty.getdeclaringclass.php
* @return ReflectionClass A {@see ReflectionClass} object.
*/
public function getDeclaringClass()
{
}
/**
* Gets doc comment
*
* @link https://php.net/manual/en/reflectionproperty.getdoccomment.php
* @return string|false The doc comment if it exists, otherwise {@see false}
*/
public function getDocComment()
{
}
/**
* Set property accessibility
*
* @link https://php.net/manual/en/reflectionproperty.setaccessible.php
* @param bool $accessible A boolean {@see true} to allow accessibility, or {@see false}
* @return void No value is returned.
*/
public function setAccessible($accessible)
{
}
/**
* Gets property type
*
* @link https://php.net/manual/en/reflectionproperty.gettype.php
* @return ReflectionType|null Returns a {@see ReflectionType} if the
* property has a type, and {@see null} otherwise.
* @since 7.4
*/
public function getType()
{
}
/**
* Checks if property has type
*
* @link https://php.net/manual/en/reflectionproperty.hastype.php
* @return bool Returns {@see true} if a type is specified, {@see false} otherwise.
* @since 7.4
*/
public function hasType()
{
}
/**
* Checks if property is initialized
*
* @link https://php.net/manual/en/reflectionproperty.isinitialized.php
* @param object|null $object If the property is non-static an object must be provided to fetch the property from.
* @return bool Returns {@see false} for typed properties prior to initialization, and for properties that have
* been explicitly {@see unset()}. For all other properties {@see true} will be returned.
* @since 7.4
*/
public function isInitialized($object = null)
{
}
/**
* Returns information about whether the property was promoted.
*
* @return bool Returns {@see true} if the property was promoted or {@see false} instead.
* @since 8.0
*/
public function isPromoted()
{
}
/**
* Clone
*
* @link https://php.net/manual/en/reflectionproperty.clone.php
* @return void
*/
final private function __clone()
{
}
}

View File

@ -0,0 +1,50 @@
<?php
/**
* The ReflectionReference class provides information about a reference.
*
* Note: Unlike the description in the documentation, the class itself is not final.
*
* @link https://www.php.net/manual/ru/class.reflectionreference.php
* @since 7.4
*/
class ReflectionReference
{
/**
* ReflectionReference cannot be created explicitly.
*/
private function __construct()
{
}
/**
* Returns ReflectionReference if array element is a reference, {@see null} otherwise
*
* @link https://php.net/manual/en/reflectionreference.fromarrayelement.php
* @param array $array The array which contains the potential reference.
* @param int|string $key The key; either an integer or a string.
* @return self|null
*/
public static function fromArrayElement(array $array, $key)
{
}
/**
* Returns unique identifier for the reference. The return value format is unspecified
*
* @link https://php.net/manual/en/reflectionreference.getid.php
* @return int|string Returns an integer or string of unspecified format.
*/
public function getId()
{
}
/**
* ReflectionReference cannot be cloned
*
* @return void
*/
private function __clone()
{
}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* The ReflectionType class reports information about a function's parameters.
*
* @link https://www.php.net/manual/en/class.reflectiontype.php
* @since 7.0
*/
abstract class ReflectionType implements Stringable
{
/**
* Checks if null is allowed
*
* @link https://php.net/manual/en/reflectiontype.allowsnull.php
* @return bool Returns {@see true} if {@see null} is allowed, otherwise {@see false}
* @since 7.0
*/
public function allowsNull()
{
}
/**
* Checks if it is a built-in type
*
* @link https://php.net/manual/en/reflectiontype.isbuiltin.php
* @return bool Returns {@see true} if it's a built-in type, otherwise {@see false}
* @since 7.0
* @removed 8.0 this method has been removed from the {@see ReflectionType}
* class and moved to the {@see ReflectionNamedType} child.
*/
public function isBuiltin()
{
}
/**
* To string
*
* @link https://php.net/manual/en/reflectiontype.tostring.php
* @return string Returns the type of the parameter.
* @since 7.0
* @deprecated 7.1 Please use {@see ReflectionType::getName()} instead.
*/
public function __toString()
{
}
/**
* Cloning of this class is prohibited
*
* @return void
*/
final private function __clone()
{
}
}

View File

@ -0,0 +1,16 @@
<?php
/**
* @since 8.0
*/
class ReflectionUnionType extends ReflectionType
{
/**
* Get list of named types of union type
*
* @return ReflectionNamedType[]
*/
public function getTypes()
{
}
}

View File

@ -0,0 +1,115 @@
<?php
/**
* @property-read string $name Name of the extension, same as calling the {@see ReflectionZendExtension::getName()} method
*
* @link https://secure.php.net/manual/en/class.reflectionzendextension.php
* @since 5.4
*/
class ReflectionZendExtension implements Reflector
{
/**
* Constructs a ReflectionZendExtension object
*
* @link https://php.net/manual/en/reflectionzendextension.construct.php
* @param string $name
* @throws \ReflectionException if the extension does not exist.
* @since 5.4
*/
public function __construct($name)
{
}
/**
* Exports a reflected zend extension.
*
* @link https://php.net/manual/en/reflectionzendextension.export.php
* @param string $name The reflection to export.
* @param bool $return Setting to {@see true} will return the
* export, as opposed to emitting it. Setting to {@see false} (the default)
* will do the opposite.
* @return string|null If the $return parameter is set to {@see true}, then
* the export is returned as a string, otherwise {@see null} is returned.
*/
public static function export($name, $return = false)
{
}
/**
* To string handler
*
* @link https://php.net/manual/en/reflectionzendextension.tostring.php
* @return string
* @since 5.4
*/
public function __toString()
{
}
/**
* Gets name
*
* @link https://php.net/manual/en/reflectionzendextension.getname.php
* @return string
* @since 5.4
*/
public function getName()
{
}
/**
* Gets version
*
* @link https://php.net/manual/en/reflectionzendextension.getversion.php
* @return string
* @since 5.4
*/
public function getVersion()
{
}
/**
* Gets author
*
* @link https://php.net/manual/en/reflectionzendextension.getauthor.php
* @return string
* @since 5.4
*/
public function getAuthor()
{
}
/**
* Gets URL
*
* @link https://php.net/manual/en/reflectionzendextension.geturl.php
* @return string
* @since 5.4
*/
public function getURL()
{
}
/**
* Gets copyright
*
* @link https://php.net/manual/en/reflectionzendextension.getcopyright.php
* @return string
* @since 5.4
*/
public function getCopyright()
{
}
/**
* Clone handler
*
* @link https://php.net/manual/en/reflectionzendextension.clone.php
* @return void
* @since 5.4
*/
final private function __clone()
{
}
}

30
Reflection/Reflector.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/**
* <b>Reflector</b> is an interface implemented by all
* exportable Reflection classes.
*
* @link https://php.net/manual/en/class.reflector.php
*/
interface Reflector extends Stringable
{
/**
* Exports a class
*
* @link https://php.net/manual/en/reflector.export.php
* @return string|null
* @deprecated 7.4
* @removed 8.0
*/
public static function export();
/**
* Returns the string representation of any Reflection object.
*
* Please note that since PHP 8.0 this method is absent in this interface
* and inherits from the {@see Stringable} parent.
*
* @return string
*/
public function __toString();
}

View File

@ -478,7 +478,7 @@ class DOMNameSpaceNode {
* The DOMDocumentFragment class
* @link https://php.net/manual/en/class.domdocumentfragment.php
*/
class DOMDocumentFragment extends DOMNode {
class DOMDocumentFragment extends DOMNode implements DOMParentNode {
public function __construct () {}
@ -492,6 +492,15 @@ class DOMDocumentFragment extends DOMNode {
*/
public function appendXML ($data) {}
/**
* {@inheritDoc}
*/
public function append(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function prepend(...$nodes): void {}
}
/**
@ -499,7 +508,7 @@ class DOMDocumentFragment extends DOMNode {
* document; serves as the root of the document tree.
* @link https://php.net/manual/class.domdocument.php
*/
class DOMDocument extends DOMNode {
class DOMDocument extends DOMNode implements DOMParentNode {
/**
* @var string
@ -826,6 +835,16 @@ class DOMDocument extends DOMNode {
*/
public function adoptNode (DOMNode $source) {}
/**
* {@inheritDoc}
*/
public function append(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function prepend(...$nodes): void {}
/**
* Normalizes the document
* @link https://php.net/manual/domdocument.normalizedocument.php
@ -1150,7 +1169,7 @@ class DOMNamedNodeMap implements Traversable, Countable {
* No nodes directly correspond to this class, but other nodes do inherit from it.
* @link https://php.net/manual/en/class.domcharacterdata.php
*/
class DOMCharacterData extends DOMNode {
class DOMCharacterData extends DOMNode implements DOMChildNode {
/**
@ -1238,6 +1257,25 @@ class DOMCharacterData extends DOMNode {
*/
public function replaceData ($offset, $count, $data) {}
/**
* {@inheritDoc}
*/
public function remove(): void {}
/**
* {@inheritDoc}
*/
public function before(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function after(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function replaceWith(...$nodes): void {}
}
/**
@ -1307,7 +1345,7 @@ class DOMAttr extends DOMNode
* The DOMElement class
* @link https://php.net/manual/en/class.domelement.php
*/
class DOMElement extends DOMNode {
class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode {
/**
@ -1584,6 +1622,36 @@ class DOMElement extends DOMNode {
*/
public function setIdAttributeNode (DOMAttr $attr, $isId) {}
/**
* {@inheritDoc}
*/
public function remove(): void {}
/**
* {@inheritDoc}
*/
public function before(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function after(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function replaceWith(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function append(...$nodes): void {}
/**
* {@inheritDoc}
*/
public function prepend(...$nodes): void {}
/**
* Creates a new DOMElement object
* @link https://php.net/manual/en/domelement.construct.php
@ -1990,3 +2058,76 @@ class DOMXPath {
public function registerPhpFunctions ($restrict = null) {}
}
/**
* @property-read DOMElement|null $firstElementChild
* @property-read DOMElement|null $lastElementChild
* @property-read int $childElementCount
*
* @since 8.0
*/
interface DOMParentNode {
/**
* Appends one or many nodes to the list of children behind the last
* child node.
*
* @param DOMNode|string|null ...$nodes
* @return void
* @since 8.0
*/
public function append(...$nodes): void;
/**
* Prepends one or many nodes to the list of children before the first
* child node.
*
* @param DOMNode|string|null ...$nodes
* @return void
* @since 8.0
*/
public function prepend(...$nodes): void;
}
/**
* @property-read DOMElement|null $previousElementSibling
* @property-read DOMElement|null $nextElementSibling
*
* @since 8.0
*/
interface DOMChildNode {
/**
* Acts as a simpler version of {@see DOMNode::removeChild()}.
*
* @return void
* @since 8.0
*/
public function remove(): void;
/**
* Add passed node(s) before the current node
*
* @param DOMNode|string|null ...$nodes
* @return void
* @since 8.0
*/
public function before(...$nodes): void;
/**
* Add passed node(s) after the current node
*
* @param DOMNode|string|null ...$nodes
* @return void
* @since 8.0
*/
public function after(...$nodes): void;
/**
* Replace current node with new node(s), a combination
* of {@see DOMChildNode::remove()} + {@see DOMChildNode::append()}.
*
* @param DOMNode|string|null ...$nodes
* @return void
* @since 8.0
*/
public function replaceWith(...$nodes): void;
}

View File

@ -1100,7 +1100,7 @@ function ldap_set_rebind_proc ($link, callable $callback) {}
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.4
* @deprecated Since 7.4
* @deprecated 7.4
*/
function ldap_control_paged_result ($link, $pagesize, $iscritical = false, $cookie = "") {}
@ -1119,7 +1119,7 @@ function ldap_control_paged_result ($link, $pagesize, $iscritical = false, $cook
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 5.4
* @deprecated Since 7.4
* @deprecated 7.4
*/
function ldap_control_paged_result_response ($link, $result, &$cookie = null, &$estimated = null) {}

View File

@ -482,6 +482,13 @@ function preg_grep ($pattern, array $input, $flags = 0) {}
*/
function preg_last_error () {}
/**
* Returns the error message of the last PCRE regex execution
*
* @return string one of the error messages or "No error" if there is no error.
* @since 8.0
*/
function preg_last_error_msg(): string {}
/**
* Orders results so that $matches[0] is an array of full pattern
@ -608,4 +615,3 @@ define ('PCRE_VERSION_MINOR', 34);
*/
define('PCRE_JIT_SUPPORT', 1);
// End of pcre v.
?>

View File

@ -1153,4 +1153,30 @@ function realpath_cache_size() { }
*/
function get_mangled_object_vars($obj){}
?>
/**
* Get the type or object name of a variable
*
* @param mixed $var The variable being type checked.
* @return string Possibles values for the returned string are:
* - "int"
* - "float"
* - "bool"
* - "string"
* - "array"
* - "null"
* - A class name for named classes
* - "class@anonymous" for an anonymous classes
* - "resource (xxx)" for any resources where "xxx" is a name of resource
* - "resource (closed)" for closed resources
* @since 8.0
*/
function get_debug_type(mixed $var): string {}
/**
* A more obvious and type-safe form of "(int) $resource"
*
* @param resource $resource
* @return int
* @since 8.0
*/
function get_resource_id($resource): int {}