An open API service indexing awesome lists of open source software.

https://github.com/baguettephp/objectsystem

Object system implementation for PHP
https://github.com/baguettephp/objectsystem

magic-method object-system oop packagist php teto-kasane

Last synced: about 2 months ago
JSON representation

Object system implementation for PHP

Awesome Lists containing this project

README

          

Teto Objectsystem
=================

[![Package version](http://img.shields.io/packagist/v/zonuexe/objectsystem.svg?style=flat)](https://packagist.org/packages/zonuexe/objectsystem)
[![Build Status](https://travis-ci.org/BaguettePHP/objectsystem.svg?branch=master)](https://travis-ci.org/BaguettePHP/objectsystem)
[![Packagist](http://img.shields.io/packagist/dt/zonuexe/objectsystem.svg?style=flat)](https://packagist.org/packages/zonuexe/objectsystem)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/BaguettePHP/objectsystem/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/BaguettePHP/objectsystem/?branch=master)

Object system implementation for PHP

Document
--------

* [API Reference](http://baguettephp.github.io/objectsystem/) (generated By [ApiGen](https://github.com/ApiGen/ApiGen) 4.1.2)
* in Japanese: [`TypedProperty`について](./poem.ja.md).
* in Japanese: [private/protectedなプロパティを外部から読み込み可能にする - Qiita](http://qiita.com/tadsan/items/2049243e47495764b191)

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

### [Composer](https://getcomposer.org/)

```sh
cd /path/to/your/project
composer require zonuexe/objectsystem
```

Features
--------

* Property type check at run time
* `trait TypedProperty`
* `trait TypeAssert`
* `class TypeDefinision`
* Object container
* `class ObjectArray`
* `interface ToArrayInterface`
* Trait for general class
* `trait ReadOnlyTrait`: Restrict write to not accessable property.
* `trait PrivateGetter`: Private property behaves like read only.
* Very simple, but you may not be able to imagine the behavior of trait in the inherited class.
* Behavior of undefined property depends on [error_reporting()](http://php.net/manual/function.error-reporting.php) and [set_error_handler()](http://php.net/manual/function.set-error-handler.php).
* `trait PrivateStrictGetter`: Private property behaves like read only.
* Throws `OutOfRangeException` if propery is undefined.
* `trait MethodAlias`: Make alias of method.
* `trait PropertyLikeMethod`: Call method as property.

References
----------

* [phpDocumentor Definition of a ‘Type’](http://www.phpdoc.org/docs/latest/references/phpdoc/types.html)

Copyright
---------

see `./LICENSE`.

Object system implementation for PHP
Copyright (c) 2016 [Baguette HQ](http://baguettephp.github.io/) / [USAMI Kenta](https://tadsan.github.io/)

Teto Kasane
-----------

I love [Teto Kasane](http://utau.wikia.com/wiki/Teto_Kasane). (ja: [Teto Kasane official site](http://kasaneteto.jp/))

```
       r /
  __ , --ヽ!-- .、_
 !  `/::::;::::ヽ l
 !二二!::/}::::丿ハニ|
 !ニニ.|:/ ノ/ }::::}コ
 L二lイ  0´ 0 ,':ノコ
 lヽノ/ヘ、 '' ▽_ノイ ソ
 ソ´ /}`ス / ̄ ̄ ̄ ̄/
   .(_:;つ/ 0401 / カタカタ
 ̄ ̄ ̄ ̄ ̄\/____/
```