2017 © Pedro Peláez
 

library properties

Automatically creates a setter and getter via annotations.

image

ymmtmsys/properties

Automatically creates a setter and getter via annotations.

  • Saturday, October 6, 2012
  • by ymmtmsys
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Properties

Properties is automatically creates a setter and getter via annotations., (*1)

Build Status, (*2)

Annotations

@accessor

The @accessor annotation is able to read and write variable., (*3)

@reader

The @reader annotation is able to read variable., (*4)

@writer

The @writer annotation is able to write variable., (*5)

Example

<?php
use Ymmtmsys\Properties\Properties;

class SubClass extends Properties // extend Properties class
{
    /**
     * @accessor
     */
    protected $rdwr = 'Read and wirte property';

    /**
     * @reader
     */
    protected $rdonly = 'Read only property';

    /**
     * @writer
     */
    protected $wronly = 'Write only property';

    protected $no_annotation = 'no annotation';
}

$obj = new SubClass;

// Read
echo $obj->rdonly, "\n"; // => "Read only property"
echo $obj->rdwr,   "\n"; // => "Read and wirte property" 

// Write 
$obj->wronly = 'Yippee!';
$obj->rdwr   = 'Yup!';

// Error!!
$obj->rdonly = 'Oops!';
echo $obj->wronly, "\n";
$obj->no_annotation = 'php';
echo $obj->no_annotation, "\n";

Copyright (c) 2012 ymmtmsys. See LICENSE for further details., (*6)

The Versions

06/10 2012

dev-master

9999999-dev

Automatically creates a setter and getter via annotations.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by YAMAMOTO Masayasu

object

06/10 2012

0.1.0

0.1.0.0

Automatically creates a setter and getter via annotations.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by YAMAMOTO Masayasu

object