for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* ExcludeAnnotation.php
*
* Jaxon annotation for exclude classes or methods from js export.
* @package jaxon-annotations
* @author Thierry Feuzeu <[email protected]>
* @copyright 2022 Thierry Feuzeu <[email protected]>
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link https://github.com/jaxon-php/jaxon-annotations
*/
namespace Jaxon\Annotations\Annotation;
use mindplay\annotations\AnnotationException;
use function count;
use function is_bool;
* Specifies if a class or method is excluded from js export.
* @usage('class' => true, 'method'=>true)
class ExcludeAnnotation extends AbstractAnnotation
{
* @var bool
protected $bValue;
* @inheritDoc
public static function parseAnnotation($value)
if($value === 'true')
return [true];
}
if($value === 'false')
return [false];
return [$value];
* @throws AnnotationException
public function initAnnotation(array $properties)
if(count($properties) !== 0 &&
(count($properties) !== 1 || !isset($properties[0]) || !is_bool($properties[0])))
throw new AnnotationException('the @exclude annotation requires a single boolean or no property');
$this->bValue = $properties[0] ?? true;
public function getName(): string
return 'protected';
public function getValue()
return $this->bValue;