-
Notifications
You must be signed in to change notification settings - Fork 810
Fix bad Pure
attributes
#1730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix bad Pure
attributes
#1730
Changes from all commits
73a8d84
ecb8b80
bcf4cf1
fce8dc2
9d24dd5
56d4178
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -445,7 +445,6 @@ function property_exists($object_or_class, string $property): bool {} | |
* @link https://secure.php.net/manual/en/function.trait-exists.php | ||
* @since 5.4 | ||
*/ | ||
#[Pure(true)] | ||
function trait_exists(string $trait, bool $autoload = true): bool {} | ||
|
||
/** | ||
|
@@ -460,7 +459,6 @@ function trait_exists(string $trait, bool $autoload = true): bool {} | |
* @return bool true if <i>class_name</i> is a defined class, | ||
* false otherwise. | ||
*/ | ||
#[Pure(true)] | ||
isfedorov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
function class_exists(string $class, bool $autoload = true): bool {} | ||
|
||
/** | ||
|
@@ -476,7 +474,6 @@ function class_exists(string $class, bool $autoload = true): bool {} | |
* <i>interface_name</i> has been defined, false otherwise. | ||
* @since 5.0.2 | ||
*/ | ||
#[Pure(true)] | ||
isfedorov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
function interface_exists(string $interface, bool $autoload = true): bool {} | ||
|
||
/** | ||
|
@@ -508,7 +505,6 @@ function function_exists(string $function): bool {} | |
* false otherwise. | ||
* @since 8.1 | ||
*/ | ||
#[Pure(true)] | ||
isfedorov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
function enum_exists(string $enum, bool $autoload = true): bool {} | ||
|
||
/** | ||
|
@@ -609,7 +605,7 @@ function get_class_vars(string $class): array {} | |
* for the specified <i>object</i> in scope. If a property have | ||
* not been assigned a value, it will be returned with a null value. | ||
*/ | ||
#[Pure(true)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this change is also incorrect since function actually depends on global state. The function depends on the structure of the class from which the object was instantiated. If the class definition changes (e.g., due to autoloading), the result can change. Also if string property names or values are affected by locale settings (e.g., setlocale()), it might affect the output. Please correct me if I'm wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cs278 Could you please comment on this? Am I right or do I miss something? |
||
#[Pure] | ||
function get_object_vars(object $object): array {} | ||
|
||
/** | ||
|
@@ -817,7 +813,7 @@ function create_function(string $args, string $code): false|string {} | |
* by this function, the return value will be the string | ||
* Unknown. | ||
*/ | ||
#[Pure(true)] | ||
isfedorov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#[Pure] | ||
function get_resource_type($resource): string {} | ||
|
||
/** | ||
|
Uh oh!
There was an error while loading. Please reload this page.