ACC SHELL

Path : /srv/www/vhosts/centrumlb/3rdparty/Nette/Reflection/
File Upload :
Current File : /srv/www/vhosts/centrumlb/3rdparty/Nette/Reflection/Property.php

<?php

/**
 * This file is part of the Nette Framework (http://nette.org)
 * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 * @package Nette\Reflection
 */



/**
 * Reports information about a classes variable.
 *
 * @author     David Grudl
 * @property-read NClassReflection $declaringClass
 * @property-read IAnnotation[][] $annotations
 * @property-read string $description
 * @property-read string $name
 * @property  mixed $value
 * @property-read bool $public
 * @property-read bool $private
 * @property-read bool $protected
 * @property-read bool $static
 * @property-read bool $default
 * @property-read int $modifiers
 * @property-read string $docComment
 * @property-write bool $accessible
 * @package Nette\Reflection
 */
class NPropertyReflection extends ReflectionProperty
{

	public function __toString()
	{
		return 'Property ' . parent::getDeclaringClass()->getName() . '::$' . $this->getName();
	}


	/********************* Reflection layer ****************d*g**/


	/**
	 * @return NClassReflection
	 */
	public function getDeclaringClass()
	{
		return new NClassReflection(parent::getDeclaringClass()->getName());
	}


	/********************* NAnnotations support ****************d*g**/


	/**
	 * Has property specified annotation?
	 * @param  string
	 * @return bool
	 */
	public function hasAnnotation($name)
	{
		$res = NAnnotationsParser::getAll($this);
		return !empty($res[$name]);
	}


	/**
	 * Returns an annotation value.
	 * @param  string
	 * @return IAnnotation
	 */
	public function getAnnotation($name)
	{
		$res = NAnnotationsParser::getAll($this);
		return isset($res[$name]) ? end($res[$name]) : NULL;
	}


	/**
	 * Returns all annotations.
	 * @return IAnnotation[][]
	 */
	public function getAnnotations()
	{
		return NAnnotationsParser::getAll($this);
	}


	/**
	 * Returns value of annotation 'description'.
	 * @return string
	 */
	public function getDescription()
	{
		return $this->getAnnotation('description');
	}


	/********************* NObject behaviour ****************d*g**/


	/**
	 * @return NClassReflection
	 */
	public function getReflection()
	{
		return new NClassReflection($this);
	}


	public function __call($name, $args)
	{
		return NObjectMixin::call($this, $name, $args);
	}


	public function &__get($name)
	{
		return NObjectMixin::get($this, $name);
	}


	public function __set($name, $value)
	{
		NObjectMixin::set($this, $name, $value);
	}


	public function __isset($name)
	{
		return NObjectMixin::has($this, $name);
	}


	public function __unset($name)
	{
		NObjectMixin::remove($this, $name);
	}

}

ACC SHELL 2018