Skip to content

Commit c20514d

Browse files
zonuexeisfedorov
authored andcommitted
Fix function purity
1 parent 85512dc commit c20514d

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

Core/Core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ function get_object_vars(object $object): array {}
621621
* @return string[] an array of method names defined for the class specified by
622622
* <i>class_name</i>. In case of an error, it returns null.
623623
*/
624-
#[Pure(true)]
624+
#[Pure]
625625
function get_class_methods(object|string $object_or_class): array {}
626626

627627
/**

date/date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ function gmmktime(
528528
* </p>
529529
* @return bool true if the date given is valid; otherwise returns false.
530530
*/
531-
#[Pure(true)]
531+
#[Pure]
532532
function checkdate(int $month, int $day, int $year): bool {}
533533

534534
/**

standard/password.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
*/
162162
#[ArrayShape(["algo" => "int", "algoName" => "string", "options" => "array"])]
163163
#[LanguageLevelTypeAware(['8.0' => 'array'], default: 'array|null')]
164+
#[Pure]
164165
function password_get_info(string $hash) {}
165166

166167
/**
@@ -181,6 +182,7 @@ function password_get_info(string $hash) {}
181182
* @since 5.5
182183
*/
183184
#[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false|null")]
185+
#[Pure(true)]
184186
function password_hash(string $password, string|int|null $algo, array $options = []) {}
185187

186188
/**
@@ -192,6 +194,7 @@ function password_hash(string $password, string|int|null $algo, array $options =
192194
* @return bool Returns TRUE if the hash should be rehashed to match the given algo and options, or FALSE otherwise.
193195
* @since 5.5
194196
*/
197+
#[Pure]
195198
function password_needs_rehash(string $hash, string|int|null $algo, array $options = []): bool {}
196199

197200
/**
@@ -202,12 +205,14 @@ function password_needs_rehash(string $hash, string|int|null $algo, array $optio
202205
* @return bool Returns TRUE if the password and hash match, or FALSE otherwise.
203206
* @since 5.5
204207
*/
208+
#[Pure]
205209
function password_verify(string $password, string $hash): bool {}
206210

207211
/**
208212
* Return a complete list of all registered password hashing algorithms.
209213
* @return string[]
210214
* @since 7.4
211215
*/
216+
#[Pure]
212217
function password_algos(): array {}
213218
// End of password v.

standard/standard_3.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ function putenv(string $assignment): bool {}
796796
* @return string[]|false[]|false This function will return an array of option / argument pairs or false on
797797
* failure.
798798
*/
799+
#[Pure(true)]
799800
function getopt(
800801
string $short_options,
801802
array $long_options = [],
@@ -884,6 +885,7 @@ function getrusage(int $mode = 0): array|false {}
884885
* </p>
885886
* @return string the unique identifier, as a string.
886887
*/
888+
#[Pure(true)]
887889
function uniqid(string $prefix = "", bool $more_entropy = false): string {}
888890

889891
/**

standard/standard_9.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,7 @@ function assert_options(int $option, mixed $value): mixed {}
986986
* function will return true if the relationship is the one specified
987987
* by the operator, false otherwise.
988988
*/
989+
#[Pure]
989990
#[ExpectedValues([-1, 0, 1, false, true])]
990991
function version_compare(
991992
string $version1,

0 commit comments

Comments
 (0)