2017 © Pedro Peláez
 

library strict-objects

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

image

kdyby/strict-objects

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

  • Monday, May 22, 2017
  • by fprochazka
  • Repository
  • 6 Watchers
  • 18 Stars
  • 157,707 Installations
  • PHP
  • 18 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 3 Versions
  • 25 % Grown

The README.md

Kdyby/StrictObjects

Simple set of traits to make your classes strict, when calling or accessing an undefined member (property or method)., (*1)

Build Status Downloads this Month Latest stable Coverage Status, (*2)

This library is heavily inspired by Nette\ObjectMixin., (*3)

Installation

The best way to install Kdyby/StrictObjects is using Composer:, (*4)

composer require kdyby/strict-objects

Usage

Simply include the trait in your class and it will behave strictly!, (*5)

use Kdyby\StrictObjects\Scream;

class MyClass
{
    use Scream;

    // my code
}

If you for some reason can't or don't want to make all undefined property and method access strict, you can enable the behavior selectively by using specific traits:, (*6)

  • Kdyby\StrictObjects\PropertyReadScreamer: Will throw when attempting to read an undeclared property.
  • Kdyby\StrictObjects\PropertyWriteScreamer: Will throw when attempting to write to an undeclared property.
  • Kdyby\StrictObjects\PropertyExistsScreamer: Will throw when attempting to check existence of an undeclared property.
  • Kdyby\StrictObjects\PropertyRemovalScreamer: Will throw when attempting to unset an undeclared property.
  • Kdyby\StrictObjects\InstanceMethodCallScreamer: Will throw when attempting to call an undefined instance method.
  • Kdyby\StrictObjects\StaticMethodCallScreamer: Will throw when attempting to call an undefined static method.

For convenience, there are also:, (*7)

  • Kdyby\StrictObjects\PropertyScreamer: Combines all property access, will throw on any interaction.
  • Kdyby\StrictObjects\MethodCallScreamer: Combines both method call types, will throw for all methods.
  • Kdyby\StrictObjects\Scream combines all screamers into one.

Homepage https://www.kdyby.org and repository https://github.com/Kdyby/StrictObjects., (*8)

The Versions

22/05 2017

dev-master

9999999-dev http://kdyby.org

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

magic members object kdyby exceptions methods properties strict accessors scream

26/08 2016

v1.0.0

1.0.0.0 http://kdyby.org

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

  • php >=5.4

 

The Development Requires

magic members object kdyby exceptions methods properties strict accessors scream

29/03 2016

v0.1

0.1.0.0 http://kdyby.org

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

  • php >=5.4

 

The Development Requires

orm doctrine dbal magic kdyby accessors