Skip to content

Commit

Permalink
Comments for JsonSchema\Rfc3339
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Oct 3, 2017
1 parent a139c54 commit d74c343
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/JsonSchema/Rfc3339.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

namespace JsonSchema;

/**
* Helper for creating DateTime objects from an RFC-3339 string
*
* @package justinrainbow\json-schema
*
* @license MIT
*/
class Rfc3339
{
/** The regular expression used to tokenize the RFC-3339 date-time string */
const REGEX = '/^(\d{4}-\d{2}-\d{2}[T ]{1}\d{2}:\d{2}:\d{2})(\.\d+)?(Z|([+-]\d{2}):?(\d{2}))$/';

/**
* Try creating a DateTime instance
* Create a DateTime object based on an RFC-3339 string
*
* @param string $string
* @param string $string The string to parse
*
* @return \DateTime|null
* @return \DateTime|null A DateTime object corresponding to the given string, or null on error
*/
public static function createFromString($string)
{
Expand Down

0 comments on commit d74c343

Please sign in to comment.