Skip to content

Commit

Permalink
Replace @deprecated by #[\Deprecated] for internal functions / cl…
Browse files Browse the repository at this point in the history
…ass constants

Co-authored-by: Gina Peter Banyard <girgias@php.net>
  • Loading branch information
TimWolla and Girgias committed Jul 1, 2024
1 parent 9caad37 commit 4045cf3
Show file tree
Hide file tree
Showing 79 changed files with 733 additions and 215 deletions.
2 changes: 1 addition & 1 deletion Zend/tests/bug69802_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
var_dump($r->getParameters()[0]->getClass());
?>
--EXPECTF--
Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
Deprecated: Method ReflectionParameter::getClass() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
object(ReflectionClass)#4 (1) {
["name"]=>
string(11) "Traversable"
Expand Down
6 changes: 3 additions & 3 deletions Zend/tests/type_declarations/callable_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ var_dump($rc->getParameters()[0]->isCallable());

?>
--EXPECTF--
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
Deprecated: Method ReflectionParameter::isCallable() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
bool(true)

Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
Deprecated: Method ReflectionParameter::isCallable() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
bool(true)

Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
Deprecated: Method ReflectionParameter::isCallable() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
bool(true)
1 change: 1 addition & 0 deletions ext/date/php_date.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "ext/standard/info.h"
#include "ext/standard/php_versioning.h"
#include "php_date.h"
#include "zend_attributes.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"
#include "lib/timelib.h"
Expand Down
8 changes: 4 additions & 4 deletions ext/date/php_date.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ function checkdate(int $month, int $day, int $year): bool {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function strftime(string $format, ?int $timestamp = null): string|false {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function gmstrftime(string $format, ?int $timestamp = null): string|false {}

function time(): int {}
Expand Down Expand Up @@ -260,17 +260,17 @@ function date_default_timezone_get(): string {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function date_sunrise(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
?float $utcOffset = null): string|int|float|false {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function date_sunset(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
Expand Down
11 changes: 10 additions & 1 deletion ext/date/php_date_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ext/enchant/enchant.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "Zend/zend_attributes.h"
#include "Zend/zend_exceptions.h"
#include <enchant.h>
#include "php_enchant.h"
Expand Down
12 changes: 6 additions & 6 deletions ext/enchant/enchant.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ final class EnchantDictionary

function enchant_broker_init(): EnchantBroker|false {}

/** @deprecated */
#[\Deprecated(message: 'EnchantBroker object is freed automatically', since: '8.1')]
function enchant_broker_free(EnchantBroker $broker): bool {}

function enchant_broker_get_error(EnchantBroker $broker): string|false {}

/** @deprecated */
#[\Deprecated(since: '8.1')]
function enchant_broker_set_dict_path(EnchantBroker $broker, int $type, string $path): bool {}

/** @deprecated */
#[\Deprecated(since: '8.1')]
function enchant_broker_get_dict_path(EnchantBroker $broker, int $type): string|false {}

/**
Expand All @@ -61,7 +61,7 @@ function enchant_broker_request_dict(EnchantBroker $broker, string $tag): Enchan

function enchant_broker_request_pwl_dict(EnchantBroker $broker, string $filename): EnchantDictionary|false {}

/** @deprecated */
#[\Deprecated(message: 'EnchantDictionary object is freed automatically', since: '8.1')]
function enchant_broker_free_dict(EnchantDictionary $dictionary): bool {}

function enchant_broker_dict_exists(EnchantBroker $broker, string $tag): bool {}
Expand Down Expand Up @@ -89,8 +89,8 @@ function enchant_dict_add(EnchantDictionary $dictionary, string $word): void {}

/**
* @alias enchant_dict_add
* @deprecated
*/
#[\Deprecated(since: '8.1')]
function enchant_dict_add_to_personal(EnchantDictionary $dictionary, string $word): void {}

function enchant_dict_add_to_session(EnchantDictionary $dictionary, string $word): void {}
Expand All @@ -99,8 +99,8 @@ function enchant_dict_is_added(EnchantDictionary $dictionary, string $word): boo

/**
* @alias enchant_dict_is_added
* @deprecated
*/
#[\Deprecated(since: '8.1')]
function enchant_dict_is_in_session(EnchantDictionary $dictionary, string $word): bool {}

function enchant_dict_store_replacement(EnchantDictionary $dictionary, string $misspelled, string $correct): void {}
Expand Down
55 changes: 54 additions & 1 deletion ext/enchant/enchant_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext/enchant/tests/broker_free.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ echo "OK\n";
--EXPECTF--
OK

Deprecated: Function enchant_broker_free() is deprecated in %s
Deprecated: Function enchant_broker_free() is deprecated since 8.1, EnchantBroker object is freed automatically in %s
OK
2 changes: 1 addition & 1 deletion ext/enchant/tests/broker_free_dict.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ OK
OK
NULL

Deprecated: Function enchant_broker_free_dict() is deprecated in %s
Deprecated: Function enchant_broker_free_dict() is deprecated since 8.1, EnchantDictionary object is freed automatically in %s
OK
OK
4 changes: 2 additions & 2 deletions ext/enchant/tests/bug53070.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ var_dump(enchant_broker_get_dict_path($broker, ENCHANT_ISPELL));
--EXPECTF--
Deprecated: Constant ENCHANT_MYSPELL is deprecated in %s

Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s

Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
bool(false)

Deprecated: Constant ENCHANT_ISPELL is deprecated in %s

Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s

Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
bool(false)
8 changes: 4 additions & 4 deletions ext/enchant/tests/enchant_broker_set_dict_path.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ if (is_object($broker)) {
--EXPECTF--
OK

Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s
Deprecated: Function enchant_broker_set_dict_path() is deprecated since 8.1 in %s
OK

Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s
Deprecated: Function enchant_broker_set_dict_path() is deprecated since 8.1 in %s
OK

Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s

Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s
OK
10 changes: 5 additions & 5 deletions ext/hash/hash.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ function hash_equals(#[\SensitiveParameter] string $known_string, #[\SensitivePa
function hash_hkdf(string $algo, #[\SensitiveParameter] string $key, int $length = 0, string $info = "", string $salt = ""): string {}

#ifdef PHP_MHASH_BC
/** @deprecated */
#[\Deprecated]
function mhash_get_block_size(int $algo): int|false {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function mhash_get_hash_name(int $algo): string|false {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {}

/** @deprecated */
#[\Deprecated]
function mhash_count(): int {}

/**
* @refcount 1
* @deprecated
*/
#[\Deprecated]
function mhash(int $algo, string $data, ?string $key = null): string|false {}
#endif

Expand Down
22 changes: 21 additions & 1 deletion ext/hash/hash_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext/intl/formatter/formatter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ class NumberFormatter
/** @cvalue FORMAT_TYPE_DOUBLE */
public const int TYPE_DOUBLE = UNKNOWN;
/**
* @deprecated
* @cvalue FORMAT_TYPE_CURRENCY
*/
#[\Deprecated(since: '8.3')]
public const int TYPE_CURRENCY = UNKNOWN;

public function __construct(string $locale, int $style, ?string $pattern = null) {}
Expand Down
12 changes: 10 additions & 2 deletions ext/intl/formatter/formatter_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion ext/intl/formatter/formatter_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
#include "php_intl.h"
#include "formatter_data.h"
#include "formatter_format.h"
#include "formatter_arginfo.h"

#include <zend_exceptions.h>
#include "Zend/zend_attributes.h"
#include "Zend/zend_interfaces.h"

#include "formatter_arginfo.h"

zend_class_entry *NumberFormatter_ce_ptr = NULL;
static zend_object_handlers NumberFormatter_handlers;

Expand Down
2 changes: 2 additions & 0 deletions ext/intl/php_intl.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@

#include "php_ini.h"

#include "zend_attributes.h"

#include "php_intl_arginfo.h"

/*
Expand Down
Loading

0 comments on commit 4045cf3

Please sign in to comment.