kenny1911 / typed-properties-helper
Set of helper functions to working with typed class properties.
Package info
github.com/Kenny1911/typed-properties-helper
pkg:composer/kenny1911/typed-properties-helper
v1.0.1
2022-08-01 07:20 UTC
Requires
- php: ^7.4 | ^8.0
Requires (Dev)
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2026-03-29 00:30:45 UTC
README
TypedPropertiesHelper is a set of helper function to working with typed class properties.
Installation
composer require kenny1911/typed-properties-helper
Usage
Check, that object property initialized:
use function Kenny1911\TypedProperties\is_initialized; $obj = new class { public int $init = 123; public int $notInit; }; is_initialized($obj, 'init'); // True is_initialized($obj, 'notInit'); // False
Check, that object property typed:
use function Kenny1911\TypedProperties\is_typed; $obj = new class { public int $typed; public $notTyped; }; is_typed($obj, 'typed'); // True is_typed($obj, 'notTyped'); // False