2014-02-06 14:44:16 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace PhpParser\Node\Stmt;
|
|
|
|
|
|
|
|
use PhpParser\Node;
|
|
|
|
|
|
|
|
class Property extends Node\Stmt
|
|
|
|
{
|
2015-02-28 18:44:28 +01:00
|
|
|
/** @var int Modifiers */
|
2016-07-25 13:33:19 +02:00
|
|
|
public $flags;
|
2015-02-28 18:44:28 +01:00
|
|
|
/** @var PropertyProperty[] Properties */
|
|
|
|
public $props;
|
|
|
|
|
2014-02-06 14:44:16 +01:00
|
|
|
/**
|
|
|
|
* Constructs a class property list node.
|
|
|
|
*
|
2016-07-25 13:33:19 +02:00
|
|
|
* @param int $flags Modifiers
|
2014-02-06 14:44:16 +01:00
|
|
|
* @param PropertyProperty[] $props Properties
|
|
|
|
* @param array $attributes Additional attributes
|
|
|
|
*/
|
2016-07-25 13:33:19 +02:00
|
|
|
public function __construct($flags, array $props, array $attributes = array()) {
|
2015-05-02 22:17:34 +02:00
|
|
|
parent::__construct($attributes);
|
2016-07-25 13:33:19 +02:00
|
|
|
$this->flags = $flags;
|
2015-02-28 18:44:28 +01:00
|
|
|
$this->props = $props;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSubNodeNames() {
|
2016-07-25 13:33:19 +02:00
|
|
|
return array('flags', 'props');
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function isPublic() {
|
2016-07-25 13:33:19 +02:00
|
|
|
return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0
|
|
|
|
|| ($this->flags & Class_::VISIBILITY_MODIFER_MASK) === 0;
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function isProtected() {
|
2016-07-25 13:33:19 +02:00
|
|
|
return (bool) ($this->flags & Class_::MODIFIER_PROTECTED);
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function isPrivate() {
|
2016-07-25 13:33:19 +02:00
|
|
|
return (bool) ($this->flags & Class_::MODIFIER_PRIVATE);
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function isStatic() {
|
2016-07-25 13:33:19 +02:00
|
|
|
return (bool) ($this->flags & Class_::MODIFIER_STATIC);
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
2014-11-13 20:18:49 +01:00
|
|
|
}
|