2017 © Pedro Peláez
 

library properties

Add a possibility to define class variables with strict data type behaviors

image

imponeer/properties

Add a possibility to define class variables with strict data type behaviors

  • Tuesday, July 10, 2018
  • by MekDrop
  • Repository
  • 2 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

License GitHub release Build Status Packagist Maintainability Test Coverage, (*1)

Properties

PHP library for handling strict type class variables. This package can be used only for adding functionality for other classes., (*2)

Installation

composer require imponeer/properties, (*3)

Usage

To add some custom properties support to a class first you need to extend that class. Here is example how to do it:, (*4)

use Imponeer\Properties;

class Base extends Properties {

}

Next thing what you need is to define variables in class constructor. Here an example how to do:, (*5)

use Imponeer\Properties;

class Base extends Properties {

  public function __construct() {
    $this->initVar('varA', self::DTYPE_INTEGER, null, false);
    $this->initVar('varB', self::DTYPE_STRING, null, true, 150);
    $this->initVar('varC', self::DTYPE_INTEGER, 100, false);
  }
}

Than is possible to use such vars. This would work for previous example in such way:, (*6)


// Creates instance $obj = new Base(); // Print current objects vars var_dump($obj->toArray()); // Modify vars with some integer values and prints $obj->varA = 57; $obj->varB = 58; $obj->varC = 59; var_dump($obj->toArray()); // Modify vars with some string values and prints $obj->varA = "A"; $obj->varB = "B"; $obj->varC = "C"; var_dump($obj->toArray());

How to contribute?

If you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, tryinteractive GitHub tutorial., (*7)

If you found any bug or have some questions, use issues tab and write there your questions., (*8)

The Versions

10/07 2018

dev-dependabot/composer/phpunit/phpunit-5.star|6.star

dev-dependabot/composer/phpunit/phpunit-5.star|6.star

Add a possibility to define class variables with strict data type behaviors

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimondas Rimkevičius

09/07 2018

dev-dependabot/composer/phpunit/phpunit-5.star|7.star

dev-dependabot/composer/phpunit/phpunit-5.star|7.star

Add a possibility to define class variables with strict data type behaviors

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimondas Rimkevičius

09/07 2018

dev-master

9999999-dev

Add a possibility to define class variables with strict data type behaviors

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimondas Rimkevičius