for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\SchemaOrg\Generator\Parser\Tasks;
use Spatie\SchemaOrg\Generator\Constant;
use Symfony\Component\DomCrawler\Crawler;
class ParseConstant extends Task
{
public function __invoke(): ?Constant
$node = new Crawler($this->definition);
$constant = new Constant();
$constant->name = preg_replace('/\s+/', '_', $this->getText($node, '[property="rdfs:label"]'));
if (empty($constant->name)) {
return null;
}
$constant->description = $this->getText($node, '[property="rdfs:comment"]');
$constant->value = $this->getAttribute($node, 'resource');
return $constant;