for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is a part of graphql-youshido project.
*
* @author Alexandr Viniychuk <[email protected]>
* created: 11/27/15 1:22 AM
*/
namespace Youshido\GraphQL\Type\Scalar;
class TimestampType extends AbstractScalarType
{
/**
* @param $value \DateTime
* @return null|string
public function serialize($value)
if ($value === null) {
return null;
}
return $value->getTimestamp();
public function isValidValue($value)
return is_int($value);