for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of Railt package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Railt\Reflection\Definition;
use Railt\Reflection\AbstractTypeDefinition;
use Railt\Reflection\Contracts\Definition\ScalarDefinition as ScalarDefinitionInterface;
use Railt\Reflection\Contracts\Type as TypeInterface;
use Railt\Reflection\Type;
* Class ScalarDefinition
class ScalarDefinition extends AbstractTypeDefinition implements ScalarDefinitionInterface
{
* @return TypeInterface
public static function getType(): TypeInterface
return Type::of(Type::SCALAR);
}
* @param mixed $value
* @return mixed
public function parse($value)
foreach ($this->getParents() as $parent) {
if ($parent instanceof ScalarDefinitionInterface) {
$value = $value->parse($value);
return $value;
public function serialize($value)
$value = $value->serialize($value);