<?php
declare(strict_types = 1);
abstract class Object
{}
interface iObjectID
{
public function getId();
public function setId(int $id = NULL);
}
trait tObjectID
{
/**
* @TF: {column => id, type => int}
* integer $id
*/
protected $id;
public function getId()
{
return $this->id;
}
public function setId(int $id = NULL)
{
$this->id = $id;
}
}
trait tObjectName
{
/**
* @TF: {column => name, type => string}
* string $name
*/
protected $name;
public function getName(): string
{
return $this->name;
}
public function setName(string $name = NULL)
{
$this->name = $name;
}
}
trait tObjectCoolurl
{
/**
* @TF: {column => coolurl, type => string}
* string $coolurl
*/
protected $coolurl;
public function getCoolurl(): string
{
return $this->coolurl;
}
public function setCoolurl(string $coolurl = NULL)
{
$this->coolurl = $coolurl;
}
}
class Gallery extends Object implements iObjectID
{
use tObjectID;
use tObjectName;
use tObjectCoolurl;
}
//Instantiate the reflection object
$reflector = new ReflectionClass('Gallery');
// Now get all the properties from class A in to $properties array
$properties = $reflector->getProperties();
var_dump($properties);
Warning: Unsupported declare 'strict_types' in /in/AWRtc on line 2
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/AWRtc on line 43
Process exited with code 255.