for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* PHP version 7.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace PhUml\Code\Attributes;
use PhUml\Code\DocBlock;
use PhUml\Code\TypeDeclaration;
* It used to create a type declaration for the attribute
class AttributeDocBlock extends DocBlock
{
private static $varExpression = '/@var\s*([\w]+(\[\])?)/';
public static function from(string $text): AttributeDocBlock
return new AttributeDocBlock($text);
}
public function getType(): TypeDeclaration
$type = null;
if (preg_match(self::$varExpression, $this->comment, $matches)) {
$type = trim($matches[1]);
return TypeDeclaration::from($type);