Joole Reflector - used to work with the properties of objects, their changes and merges

Overview

Joole Reflector


Joole Reflector is used to work with the properties of objects, their changes and merges.

Getting Started


Download it with composer:

composer require zloynick/joole-reflector

Usage


Init your reflector class:

...
use joole\reflector\Reflector;
...

Build reflection object:


...
$reflectedClass = $reflector->buildFromObject($yourClass);
//OR
$reflectedClass = $reflector->buildFromObject(
    YourClass::class,// class as string
    [$constructorParams1, $constructorParams2],// Using for class constructor
);
...

Change private/protected properties:


...
$reflectedClass->getProperty('exampleProperty')->setValue($value);
// Notice: $value's type must be instance of property type
// or null if property nullable. "exampleProperty" is a property of
// your class, that had reflected.
...

Properties merging:


...
$reflector->merge($class, [
    'id' => $id,
    'value' => $value,
]);
// OR
$reflector->merge($class, $classFrom, [
    'id' => $id,
    'value',//if exists at $classFrom
]);
...

You might also like...
More options when uploading files such as name changes, resizing or compression through TinyPNG.

Kirby Upload Extended More options when uploading files like name changes, resizing via Kirby or compression and optional resizing via TinyPNG. Thanks

This component changes the way Magento 2 generates Interceptor classes

ABOUT This component changes the way Magento 2 generates Interceptor classes (a mechanism that allows plugins to work together). Instead of generating

Project that aims to create a website for a gym, where the clients and employees can access their data, buy in the gym store and check the gym activities.

Gym_Management_Project Project that aims to create a website for a gym, where the clients and employees can access their data, buy in the gym store an

The system that will administer or manage companies and their employees and clients.

About - - Business Management System The system that will administer or manage companies and their employees and clients. Resources Use of Notificatio

Orangescrum is a simple yet powerful free and open source project management software that helps team to organize their tasks, projects and deliver more.
Orangescrum is a simple yet powerful free and open source project management software that helps team to organize their tasks, projects and deliver more.

Free, open source Project Management software Introduction Orangescrum is the simple yet powerful free and open source project management software tha

A Magento 2 module that allows admins to duplicate CMS blocks and pages from their respective grids and en masse.
A Magento 2 module that allows admins to duplicate CMS blocks and pages from their respective grids and en masse.

element119 | CMS Duplicator 📝 Features ✔️ Allows merchants to duplicate CMS blocks and pages from the Action column in the admin grid ✔️ Allows merch

This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects

sabre/vobject The VObject library allows you to easily parse and manipulate iCalendar and vCard objects using PHP. The goal of the VObject library is

Allows generate class files parse from json and map json to php object, including multi-level and complex objects;

nixihz/php-object Allows generate class files parse from json and map json to php object, including multi-level and complex objects; Installation You

Comments
  • 2.1.5 release.

    2.1.5 release.

    [Property.php] Added new methods: hasDefaultValue(), getDefaultValue(), getProperty(), haveValue(), getVisibility(); [Property.php] Rewrote methods: getValue(); [Property.php] Refactoring: $owner is now the object that was passed by reflection;

    [ReflectedObject] Refactor: method init() some changes;

    [Reflector] Refactor: logic;

    [test.cmd] Removed;

    opened by ZloyNick 0
Releases(v2.1.5)
  • v2.1.5(Mar 5, 2022)

    [Property.php] Added new methods: hasDefaultValue(), getDefaultValue(), getProperty(), haveValue(), getVisibility(); [Property.php] Rewrote methods: getValue(); [Property.php] Refactoring: $owner is now the object that was passed by reflection;

    [ReflectedObject] Refactor: method init() some changes;

    [Reflector] Refactor: logic;

    [test.cmd] Removed;

    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Feb 25, 2022)

Owner
Ravil Sitdikov
Web Developer, 21 y.o.
Ravil Sitdikov
A tool for diff'ing this and OpenTHC lab metrics, creating their objects, and docs.

wcia-analytes-tool Consumes OpenTHC Lab Metrics and WCIA Analytes, and produces diff objects and docs for use in WA State interop. version 0.9.8 Getti

Confidence Analytics 1 Jan 15, 2022
A web application built on PHP for user to view their credit information in their mysql database

TheCreditInfo Table of Content About Inspiration Technologies Client Pages Usage About Credere is a website created to help you track your credit hist

Abdul-Baseet Shabi 0 Jul 21, 2022
PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.

?? Yell PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects. Requirement

Zeeshan Ahmad 20 Dec 8, 2018
A PHP Library To Make Your Work Work Easier/Faster

This Is A Php Library To Make Your Work Easier/Faster,

functionality 2 Dec 30, 2022
Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.DeepEqual().

Deeper Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.De

Joubert RedRat 4 Feb 12, 2022
Validated properties in PHP8.1 and above using attribute rules

PHP Validated Properties Add Rule attributes to your model properties to make sure they are valid. Why this package? When validating external data com

null 23 Oct 18, 2022
Allow multiple options for Magento 2 checkout layout. Provides capabilities to AB test checkout changes and more.

Aimes_CheckoutDesigns Features Please note: This module is currently still considered a proof of concept. This module provides the ability to change c

Rob Aimes 30 Aug 8, 2022
PHPStan extension to support #[Readonly] constructor properties

icanhazstring/phpstan-readonly-property Support #[Readonly] promoted constructor properties for PHPStan. This library is used to have a full transitio

Andreas Frömer 4 Apr 5, 2022
A small package to add computed properties to any PHP class. 🐘

Computed Properties This package provides a trait and attribute that can provide computed property support. Installation This package can be installed

Ryan Chandler 22 Mar 28, 2022
[READ-ONLY] Properties define model metadata.

Charcoal Property Properties define object's metadata. They provide the building blocks of the Model's definition. Properties are defined globally for

The Charcoal PHP Framework 0 Jun 21, 2022