kenny1911/typed-properties-helper

Set of helper functions to working with typed class properties.

Installs: 2 191

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/kenny1911/typed-properties-helper

v1.0.1 2022-08-01 07:20 UTC

This package is auto-updated.

Last update: 2025-09-29 02:43:30 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