zonuexe / objectsystem
Object system for PHP
Installs: 12 823
Dependents: 2
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.2||^8.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^8.5||^7.5
- symplify/easy-coding-standard: ^12.0
- yoast/phpunit-polyfills: ^2.0
README
Object system implementation for PHP
Document
- API Reference (generated By ApiGen 4.1.2)
- in Japanese:
TypedProperty
について. - in Japanese: private/protectedなプロパティを外部から読み込み可能にする - Qiita
Installation
Composer
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() and set_error_handler().
trait PrivateStrictGetter
: Private property behaves like read only.- Throws
OutOfRangeException
if propery is undefined.
- Throws
trait MethodAlias
: Make alias of method.trait PropertyLikeMethod
: Call method as property.
References
Copyright
see ./LICENSE
.
Object system implementation for PHP
Copyright (c) 2016 [Baguette HQ](http://baguettephp.github.io/) / [USAMI Kenta](https://tadsan.github.io/) <tadsan@zonu.me>
Teto Kasane
I love Teto Kasane. (ja: Teto Kasane official site)
r /
__ , --ヽ!-- .、_
! `/::::;::::ヽ l
!二二!::/}::::丿ハニ|
!ニニ.|:/ ノ/ }::::}コ
L二lイ 0´ 0 ,':ノコ
lヽノ/ヘ、 '' ▽_ノイ ソ
ソ´ /}`ス / ̄ ̄ ̄ ̄/
.(_:;つ/ 0401 / カタカタ
 ̄ ̄ ̄ ̄ ̄\/____/