PHP 8.2.31
Preview: StringNodeAnnotationToAttributeMapper.php Size: 849 B
/opt/cpanel/ea-wappspector/vendor/rector/rector/src/PhpAttribute/AnnotationToAttributeMapper/StringNodeAnnotationToAttributeMapper.php

<?php

declare (strict_types=1);
namespace Rector\PhpAttribute\AnnotationToAttributeMapper;

use PhpParser\Node\Expr;
use PhpParser\Node\Scalar\String_;
use Rector\BetterPhpDocParser\PhpDoc\StringNode;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
/**
 * @implements AnnotationToAttributeMapperInterface<StringNode>
 */
final class StringNodeAnnotationToAttributeMapper implements AnnotationToAttributeMapperInterface
{
    /**
     * @param mixed $value
     */
    public function isCandidate($value) : bool
    {
        return $value instanceof StringNode;
    }
    /**
     * @param StringNode $value
     */
    public function map($value) : Expr
    {
        return new String_($value->value, [AttributeKey::KIND => $value->getAttribute(AttributeKey::KIND)]);
    }
}

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
3.18 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
2.95 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
982 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.58 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
2.16 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
2.85 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.67 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
849 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).