Skip to content
Permalink
Browse files

Merge pull request #1442 from neos/albe-typehandling-fix

BUGFIX: Properly parse `DateTimeImmutable` types
  • Loading branch information...
jonnitto committed Nov 25, 2018
2 parents a00a751 + 19880d9 commit f92ec4094b70dc74ba44afec8052bc2ca05e6b11
@@ -24,7 +24,7 @@ abstract class TypeHandling
/**
* A property type parse pattern.
*/
const PARSE_TYPE_PATTERN = '/^\\\\?(?P<type>integer|int|float|double|boolean|bool|string|DateTime|[a-zA-Z0-9\\\\_]+|object|array|ArrayObject|SplObjectStorage|Doctrine\\\\Common\\\\Collections\\\\Collection|Doctrine\\\\Common\\\\Collections\\\\ArrayCollection)(?:<\\\\?(?P<elementType>[a-zA-Z0-9\\\\_]+)>)?/';
const PARSE_TYPE_PATTERN = '/^\\\\?(?P<type>integer|int|float|double|boolean|bool|string|DateTime(?:Immutable)?|[a-zA-Z0-9\\\\_]+|object|array|ArrayObject|SplObjectStorage|Doctrine\\\\Common\\\\Collections\\\\Collection|Doctrine\\\\Common\\\\Collections\\\\ArrayCollection)(?:<\\\\?(?P<elementType>[a-zA-Z0-9\\\\_]+)>)?/';
/**
* A type pattern to detect literal types.
@@ -45,6 +45,7 @@ public function types()
['int', ['type' => 'integer', 'elementType' => null]],
['string', ['type' => 'string', 'elementType' => null]],
['DateTime', ['type' => 'DateTime', 'elementType' => null]],
['DateTimeImmutable', ['type' => 'DateTimeImmutable', 'elementType' => null]],
['TYPO3\Foo\Bar', ['type' => 'TYPO3\Foo\Bar', 'elementType' => null]],
['\TYPO3\Foo\Bar', ['type' => 'TYPO3\Foo\Bar', 'elementType' => null]],
['\stdClass', ['type' => 'stdClass', 'elementType' => null]],

0 comments on commit f92ec40

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.