woocommerce/apigen/ApiGen/ReflectionFunction.php

65 lines
1.5 KiB
PHP

<?php
/**
* ApiGen 2.8.0 - API documentation generator for PHP 5.3+
*
* Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
* Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
* Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
*
* For the full copyright and license information, please view
* the file LICENSE.md that was distributed with this source code.
*/
namespace ApiGen;
/**
* Function reflection envelope.
*
* Alters TokenReflection\IReflectionFunction functionality for ApiGen.
*/
class ReflectionFunction extends ReflectionFunctionBase
{
/**
* Returns if the function is valid.
*
* @return boolean
*/
public function isValid()
{
if ($this->reflection instanceof \TokenReflection\Invalid\ReflectionFunction) {
return false;
}
return true;
}
/**
* Returns if the function should be documented.
*
* @return boolean
*/
public function isDocumented()
{
if (null === $this->isDocumented && parent::isDocumented()) {
$fileName = self::$generator->unPharPath($this->reflection->getFilename());
foreach (self::$config->skipDocPath as $mask) {
if (fnmatch($mask, $fileName, FNM_NOESCAPE)) {
$this->isDocumented = false;
break;
}
}
if (true === $this->isDocumented) {
foreach (self::$config->skipDocPrefix as $prefix) {
if (0 === strpos($this->reflection->getName(), $prefix)) {
$this->isDocumented = false;
break;
}
}
}
}
return $this->isDocumented;
}
}