Null undefined#26
Merged
Merged
Conversation
- Introduce `fromNull` factory and `toNull` conversion across Undefined implementations and tests. - Remove deprecated array factory methods (`fromArray`, `tryFromArray`) and related abstract/interface definitions. - Update `UndefinedTypeInterface` and `UndefinedTypeAbstract` signatures to return `PrimitiveTypeAbstract|static` for `tryFrom*` methods. - Adjust exception messages to use consistent “Undefined type” wording. - Change `jsonSerialize` to return `null` instead of throwing. - Update unit tests for UndefinedStandard, Alias Undefined, and related classes to reflect new behavior and remove array cases. - Modify OptionalFailTest expectations for updated exception messages.
- Move version badges after the **Install** heading and group them by major version. - Add an explicit “Install” heading and separate version badge blocks. - Update the Undefined description to include a reference link. - Adjust the “Other usage examples” heading formatting.
- Update `toDecimal` signatures in `UndefinedTypeAbstract`, `UndefinedTypeInterface`, and `UndefinedStandard` to return `never` since the method always throws.
- Introduce `fromNull` factory method that always throws `BoolTypeException`. - Add `toNull` conversion method that always throws `BoolTypeException`. - Import `BoolTypeException` in `BoolStandard`. - Extend unit tests to assert both methods throw the expected exception.
…TypeException Introduce `fromNull` factory method and `toNull` conversion that always throw `SwitchBoolTypeException`. Extend unit tests to assert both methods raise the expected exception.
…to Undefined factories Document that `fromBool`, `fromDecimal`, `fromFloat`, `fromInt`, `fromString` and `__toString` in `UndefinedTypeAbstract` now declare they may throw `UndefinedTypeException`. Add template‑based PHPDoc for `tryFromBool`, `tryFromDecimal`, `tryFromFloat`, `tryFromInt`, `tryFromMixed` and `tryFromString` in `UndefinedTypeInterface`, specifying the `$default` parameter type and the combined return type.
…TypeException Introduce `fromNull` factory method and `toNull` conversion that always throw `TrueBoolTypeException`. Extend unit tests to assert both methods raise the expected exception.
…olTypeException Introduce `fromNull` factory and `toNull` conversion methods that always throw `FalseBoolTypeException`, and add unit tests to assert the expected exceptions.
Introduce abstract `fromNull` and `toNull` methods that always throw an Exception, and implement them in the unit tests to verify the expected exception behavior.
…TypeException Implement static `fromNull` and instance `toNull` methods that always throw `ToggleBoolTypeException` and add unit tests verifying the expected exceptions.
…imalTypeException Introduce static `fromNull` and instance `toNull` methods that always throw `MoneyDecimalTypeException` and add unit tests verifying the expected exceptions.
…iveDecimalTypeException Introduce static `fromNull` and instance `toNull` methods that always throw `NegativeDecimalTypeException` and add unit tests verifying the expected exceptions.
…nNegativeDecimalTypeException Introduce static `fromNull` and instance `toNull` methods that always throw `NonNegativeDecimalTypeException` and add corresponding unit tests to verify the exception behavior.
…nPositiveDecimalTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `NonPositiveDecimalTypeException` and added unit tests to verify the exception behavior.
…oDecimalTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `NonZeroDecimalTypeException` and added unit tests to verify the exception behavior.
…tDecimalTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `PercentDecimalTypeException` and added unit tests to verify the exception behavior.
…iveDecimalTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `PositiveDecimalTypeException` and added unit tests to verify the exception behavior.
…obabilityDecimalTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `ProbabilityDecimalTypeException` and added unit tests to verify the exception behavior.
…alTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `DecimalTypeException` and added unit tests to verify the exception behavior.
Declare `fromNull` and `toNull` as abstract methods in the base class and add corresponding test implementations that throw an exception for null values.
…eFloatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw NegativeFloatTypeException and added corresponding unit tests.
…egativeFloatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw NonNegativeFloatTypeException and added corresponding unit tests.
…ositiveFloatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `NonPositiveFloatTypeException` and added unit tests to verify the exception behavior.
…loatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `NonZeroFloatTypeException` and added a unit test to verify the exception behavior.
…loatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `PercentFloatTypeException`, and added a unit test to verify the exception behavior.
…eFloatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `PositiveFloatTypeException`, and added unit tests to verify the exception behavior.
…abilityFloatTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `ProbabilityFloatTypeException` and added unit tests to verify the exception behavior.
…peException Implemented static `fromNull` and instance `toNull` methods that always throw `FloatTypeException` and added unit tests to verify the exception behavior.
Declare `fromNull(null)` and `toNull()` as abstract methods in the interface and abstract class, and provide test implementations that always throw `FloatTypeException`.
Update docblocks of `fromDecimal` and conversion methods in all Float classes (Positive, NonNegative, NonPositive, Negative, NonZero, FloatPercent, FloatProbability) to include `@throws FloatTypeException`.
…erTypeException Implemented static `fromNull` and `toNull` methods that always throw `TinyIntegerTypeException` and added unit tests to verify the exception behavior.
…nsignedTinyIntegerTypeException Implemented static `fromNull` and `toNull` methods that always throw `UnsignedTinyIntegerTypeException`.
Declare `fromNull` and `toNull` as abstract methods returning `never` in the base integer type, and add unit tests verifying that both methods throw `UnsignedTinyIntegerTypeException` when invoked.
…yIntegerTypeException Implemented static `fromNull` and `toNull` methods that always throw `WeekDayIntegerTypeException` and added unit tests to verify the exception behavior.
…erTypeException Implemented static `fromNull` and `toNull` methods that always throw `YearIntegerTypeException` and added unit tests to verify the exception behavior.
Declare `fromNull(null)` and `toNull()` as abstract methods returning `never` to enforce consistent null handling across integer types.
…ringTypeException Implemented static `fromNull` and `toNull` methods that always throw `Base64StringTypeException`; updated docblocks to reference the correct exception and added unit tests to verify the exception behavior.
…ntryCodeStringTypeException Update docblocks to reference the correct exception, remove the unused `StringTypeException` import, and add unit tests that verify both methods throw `CountryCodeStringTypeException`.
…rrencyCodeStringTypeException Remove unused `StringTypeException` import, update docblocks to reference the correct exception, and add unit tests verifying the new null handling methods.
…ringTypeException Update docblocks to reference the correct exception and add unit tests verifying the new null handling behavior.
…ngTypeException Update docblocks to reference EmailStringTypeException, remove the unused `StringTypeException` import, and add unit tests verifying the new null handling behavior.
…eException Add unit tests verifying that both methods throw the exception.
…meStringTypeException Update docblocks to reference `FileNameStringTypeException`, remove the unused `StringTypeException` import, and add unit tests verifying that both methods throw the exception.
…peException Removed unused `StringTypeException` import, updated docblocks to reference `HexStringTypeException`, and added unit tests verifying the new null handling methods.
…teTypeException Implemented static `fromNull` and `toNull` methods that always throw `Iso8601DateTypeException`. Updated docblocks accordingly and added unit tests to verify the exception behavior for both methods.
…TypeException Implemented static `fromNull` and instance `toNull` methods that always throw `DateTimeTypeException`. Updated docblocks accordingly and added unit tests to verify the exception behavior for both methods.
…DateTimeTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `CookieDateTimeTypeException`. Updated docblocks accordingly and added unit tests to verify the exception behavior for both methods.
…23DateTimeTypeException Added `fromNull` and `toNull` methods that always throw `RFC1123DateTimeTypeException` and introduced unit tests to confirm the exception behavior.
…22DateTimeTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `RFC2822DateTimeTypeException`. Updated docblocks accordingly and added unit tests to verify the exception behavior.
…mNull and toNull throw DateTimeTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `DateTimeTypeException`. Updated docblocks accordingly and added unit tests to verify the exception behavior.
…xtended Add describe blocks that verify `fromNull` and `toNull` throw `DateTimeTypeException` for both DateTimeRFC3339 and DateTimeRFC3339Extended classes.
…ypeException Implemented static `fromNull` and static `toNull` methods that always throw `DateTimeTypeException`. Updated docblocks and added unit tests to verify the exception behavior.
Declare `fromNull` and `toNull` as abstract never‑returning methods that throw `DateTimeTypeException` and add unit tests confirming the exception behavior.
…ypeException Implemented static `fromNull` and `toNull` methods that always throw `DateTimeTypeException` and added unit tests confirming the exception behavior.
…meTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `Iso8601TimeTypeException` and added unit tests to verify the exception behavior.
… TimestampTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `TimestampTypeException` and added unit tests to verify the exception behavior.
… TimestampTypeException Implemented static `fromNull` and instance `toNull` methods that always throw `TimestampTypeException` and added unit tests to verify the exception behavior.
…estampTypeException` Implemented static `fromNull` and instance `toNull` methods that always throw `TimestampTypeException`; added unit tests confirming the exception behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.