Skip to content

Declare ext/intl constants in stubs - part 7 #9269

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

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ext/intl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ if test "$PHP_INTL" != "no"; then
resourcebundle/resourcebundle.c \
resourcebundle/resourcebundle_class.c \
resourcebundle/resourcebundle_iterator.c \
transliterator/transliterator.c \
transliterator/transliterator_class.c \
transliterator/transliterator_methods.c \
uchar/uchar.c \
Expand Down
1 change: 0 additions & 1 deletion ext/intl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ if (PHP_INTL != "no") {
}

ADD_SOURCES(configure_module_dirname + "/transliterator", "\
transliterator.c \
transliterator_class.c \
transliterator_methods.c",
"intl");
Expand Down
3 changes: 0 additions & 3 deletions ext/intl/php_intl.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ PHP_MINIT_FUNCTION( intl )
/* Register 'Transliterator' PHP class */
transliterator_register_Transliterator_class( );

/* Register Transliterator constants */
transliterator_register_constants( INIT_FUNC_ARGS_PASSTHRU );

/* Register 'IntlTimeZone' PHP class */
timezone_register_IntlTimeZone_class( );

Expand Down
48 changes: 0 additions & 48 deletions ext/intl/transliterator/transliterator.c

This file was deleted.

2 changes: 0 additions & 2 deletions ext/intl/transliterator/transliterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
#define TRANSLITERATOR_TRANSLITERATOR_H

#include <php.h>
#include <unicode/utypes.h>
#include <unicode/utrans.h>

#include "zend_smart_str.h"

void transliterator_register_constants( INIT_FUNC_ARGS );
smart_str transliterator_parse_error_to_string( UParseError* pe );

#endif /* #ifndef TRANSLITERATOR_TRANSLITERATOR_H */
11 changes: 11 additions & 0 deletions ext/intl/transliterator/transliterator.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
/** @not-serializable */
class Transliterator
{
/**
* @var int
* @cvalue TRANSLITERATOR_FORWARD
*/
public const FORWARD = UNKNOWN;
/**
* @var int
* @cvalue TRANSLITERATOR_REVERSE
*/
public const REVERSE = UNKNOWN;

public readonly string $id;

final private function __construct() {}
Expand Down
14 changes: 13 additions & 1 deletion ext/intl/transliterator/transliterator_arginfo.h

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

3 changes: 0 additions & 3 deletions ext/intl/transliterator/transliterator_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,5 @@ void transliterator_register_Transliterator_class( void )
Transliterator_handlers.offset = XtOffsetOf(Transliterator_object, zo);
Transliterator_handlers.free_obj = Transliterator_objects_free;
Transliterator_handlers.clone_obj = Transliterator_clone_obj;

/* constants are declared in transliterator_register_constants, called from MINIT */

}
/* }}} */