cjrasmussen/objectify

Simple functions for converting associative arrays to objects and vice-versa

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/cjrasmussen/objectify

1.0.0 2024-06-30 01:58 UTC

This package is auto-updated.

Last update: 2025-10-05 17:07:36 UTC


README

Simple functions for converting associative arrays to objects and vice-versa.

There are better ways to do this for specific cases but this covers some extremely general cases easy enough.

Usage

use cjrasmussen\Objectify\Objectify;

$array = [
    'foo' => 'bar',
    'baz' => [
        'alpha' => 1,
        'beta' => 2,
    ],
];
$object = Objectify::toObject($array);

Installation

Simply add a dependency on cjrasmussen/objectify to your composer.json file if you use Composer to manage the dependencies of your project:

composer require cjrasmussen/objectify

Although it's recommended to use Composer, you can actually include the file(s) any way you want.

License

Objectify is MIT licensed.