PHPackages                             rumd3x/php-baseobject - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rumd3x/php-baseobject

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rumd3x/php-baseobject
=====================

A very helpful class to extend from and use as a base for other classes.

1.0.0(7y ago)03682MITPHPPHP &gt;=5.5

Since Dec 1Pushed 7y agoCompare

[ Source](https://github.com/rumd3x/php-baseobject)[ Packagist](https://packagist.org/packages/rumd3x/php-baseobject)[ RSS](/packages/rumd3x-php-baseobject/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (2)

php-baseobject
==============

[](#php-baseobject)

A very helpful class to extend from and use as a base for other classes.

Installation
------------

[](#installation)

To install via composer just run

```
  composer require rumd3x/php-baseobject
```

Usage
-----

[](#usage)

### Inheriting stuff

[](#inheriting-stuff)

Just make any class extending the BaseObject

```
use Rumd3x\BaseObject\BaseObject;

class MyClass extends BaseObject {
    // Your class definition
    private $my_property;
}
```

### Automatic getters and setters

[](#automatic-getters-and-setters)

To use the automatic getters and setters, make your properties snake case, and your methods camel case.

```
$obj = new MyClass;
$obj->my_property = 'value';
// This will automatically do $obj->setMyProperty('value'); if you have defined this method.

$prop_value = $obj->my_property;
// This will automatically do $prop_value = $obj->getMyProperty(); if you have defined this method.
```

### Helpers

[](#helpers)

There are several standard helper method on the base object to help on object manipulation in addidition to the already defined php magic methods.

```
$obj = new MyClass;

// BaseObject::parse($data) Creates a new instance base on the contents of $data.
// Data can be either an object of any class, an array, a json string or a XML string.
MyClass::parse($data); // Returns instance of MyClass.
$obj->parse($data); // Casts $data into the already existing instance.

$obj->toArray(); // Converts the object to an array.
$obj->toJson(); // Converts the object to a json string representation.
$obj->toXml(); // Converts the object to a XML string representation.

// You can also safely use the object to along side with strings.
echo $obj;
$string = "my object value => {$obj}";
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2724d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a9bb5384975b87cebcef2b7642e2b5b3b79d0a3be614fdcbbe008f5b6ca3c08?d=identicon)[edmur](/maintainers/edmur)

---

Top Contributors

[![rumd3x](https://avatars.githubusercontent.com/u/12579932?v=4)](https://github.com/rumd3x "rumd3x (10 commits)")

---

Tags

objectbaserumd3xphp-baseobject

### Embed Badge

![Health badge](/badges/rumd3x-php-baseobject/health.svg)

```
[![Health](https://phpackages.com/badges/rumd3x-php-baseobject/health.svg)](https://phpackages.com/packages/rumd3x-php-baseobject)
```

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[yzen.dev/plain-to-class

Class-transformer to transform your dataset into a structured object

16293.9k6](/packages/yzendev-plain-to-class)[jasny/dotkey

Dot notation access for objects and arrays

14219.5k6](/packages/jasny-dotkey)[mnastalski/baselinker-php

Base.com (formerly BaseLinker) PHP library

1530.4k](/packages/mnastalski-baselinker-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
