php-src/ext/intl/breakiterator/breakiterator.stub.php
Christoph M. Becker f06ac9a486
Fix GH-7939: Cannot unserialize IntlTimeZone objects
As it is now, `IntlTimeZone`, `IntlCalendar` and `IntlDateFormatter`
and some other intl class instances can be serialized, but the
representation is meaningless, and unserialization yields uninitialized/
unusable objects.  To prevent users from noticing this too late, we deny
serialization of such objects in the first place.

Closes GH-7945.
2022-02-17 15:06:29 +01:00

96 lines
2.8 KiB
PHP

<?php
/** @generate-class-entries */
/** @not-serializable */
class IntlBreakIterator implements IteratorAggregate
{
/** @tentative-return-type */
public static function createCharacterInstance(?string $locale = null): ?IntlBreakIterator {}
/** @tentative-return-type */
public static function createCodePointInstance(): IntlCodePointBreakIterator {}
/** @tentative-return-type */
public static function createLineInstance(?string $locale = null): ?IntlBreakIterator {}
/** @tentative-return-type */
public static function createSentenceInstance(?string $locale = null): ?IntlBreakIterator {}
/** @tentative-return-type */
public static function createTitleInstance(?string $locale = null): ?IntlBreakIterator {}
/** @tentative-return-type */
public static function createWordInstance(?string $locale = null): ?IntlBreakIterator {}
private function __construct() {}
/** @tentative-return-type */
public function current(): int {}
/** @tentative-return-type */
public function first(): int {}
/** @tentative-return-type */
public function following(int $offset): int {}
/** @tentative-return-type */
public function getErrorCode(): int {}
/** @tentative-return-type */
public function getErrorMessage(): string {}
/** @tentative-return-type */
public function getLocale(int $type): string|false {}
/** @tentative-return-type */
public function getPartsIterator(string $type = IntlPartsIterator::KEY_SEQUENTIAL): IntlPartsIterator {}
/** @tentative-return-type */
public function getText(): ?string {}
/** @tentative-return-type */
public function isBoundary(int $offset): bool {}
/** @tentative-return-type */
public function last(): int {}
/** @tentative-return-type */
public function next(?int $offset = null): int {}
/** @tentative-return-type */
public function preceding(int $offset): int {}
/** @tentative-return-type */
public function previous(): int {}
/** @tentative-return-type */
public function setText(string $text): ?bool {} // TODO return false instead of null in case of failure
public function getIterator(): Iterator {}
}
/** @not-serializable */
class IntlRuleBasedBreakIterator extends IntlBreakIterator
{
public function __construct(string $rules, bool $compiled = false) {}
/** @tentative-return-type */
public function getBinaryRules(): string|false {}
/** @tentative-return-type */
public function getRules(): string|false {}
/** @tentative-return-type */
public function getRuleStatus(): int {}
/** @tentative-return-type */
public function getRuleStatusVec(): array|false {}
}
/** @not-serializable */
class IntlCodePointBreakIterator extends IntlBreakIterator
{
/** @tentative-return-type */
public function getLastCodePoint(): int {}
}