24708[TASK] Add type converter for core types like Enumeration
Commit message
Review
-
Code review CR +2
- Thomas Maroschik +2
- Stefan Neufeind +1
- Sascha Egerer +1
- Marc Bastian Heinrichs +1
-
Verified V +2
- Thomas Maroschik +2
- Marc Bastian Heinrichs +1
Issues 1
Files 12
- typo3/sysext/core/Classes/Type/Exception/InvalidEnumerationValueException.php+1 −1
- typo3/sysext/core/Classes/Type/Exception/InvalidValueExceptionInterface.php2new+33 −0
- typo3/sysext/core/Classes/Type/Enumeration.php4+14 −8
- typo3/sysext/core/Classes/Type/TypeInterface.php2new+44 −0
- typo3/sysext/core/Tests/Unit/Type/EnumerationTest.php+63 −9
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php1+17 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php+3 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php+3 −0
- typo3/sysext/extbase/Classes/Property/TypeConverter/CoreTypeConverter.php2new+74 −0
- typo3/sysext/extbase/Classes/Utility/TypeHandlingUtility.php+10 −0
- typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php+1 −1
- typo3/sysext/extbase/ext_localconf.php+1 −0
Review log 37
Show 12 earlier messages
-
Sascha Egerer rebased onto patch set 1 10/13/13, 18:50
-
Sascha Egerer commented on patch set 2 10/13/13, 18:51
Custom types added. A big thanks goes to Thomas Maroschik for his awesome help and inspiration :-) -
Mr. Jenkins commented on patch set 1 10/13/13, 19:00
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11448/ : SUCCESS -
Mr. Jenkins commented on patch set 2 10/13/13, 19:11
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11449/ : SUCCESS -
Philipp Gampe commented on patch set 2 10/13/13, 19:28
Enumeration.php:159CLG: space after ifInvalidValueExceptionInterface.php:32IMHO an empty interface does not make sense ... furthermore, why do we need an interface for an exception?TypeInterface.php:31please do so ... this text is rendered on api.typo3.orgCoreTypeConverter.php:70IMHO no interface here ... all exceptions inherit from \Exception thus have the required methods -
Anja Leichsenring commented on patch set 2 CR +1 10/13/13, 19:48
I second the doubt for the ExceptionInterface and will not push for the small typo I found. Will test after things are solved, but looks good.typo Enumration -> Enumeration -
Sascha Egerer commented on patch set 2 10/14/13, 06:16
Thank you for your reviews. I tried to answer your comments for the Exception Interface. If you do not agree feel free to change it :-)Reply
DoneEnumeration.php:159ReplyDoneInvalidValueExceptionInterface.php:32ReplyThe InvalidValueExceptionInterface should be implemented by all CoreType Exceptions that have to be handled by the extbase datamapper. And it's an interface to implement it also in exceptions that are based on other existing exceptions. But feel free to change it if you dont like this conceptTypeInterface.php:31ReplyDoneCoreTypeConverter.php:70ReplyThis exception type is used to say "Hey the object could not be created because you have given some invalid data". This is a type of Validation that is here done by the CoreType (Enumeration) and not by a special validator. -
Sascha Egerer uploaded patch set 3 10/14/13, 06:24
-
Mr. Jenkins commented on patch set 3 10/14/13, 06:37
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11463/ : SUCCESS -
Thomas Maroschik commented on patch set 3 V +1 CR +1 10/14/13, 06:48
Lovely patch. I like the generic concept it introduces. We can now create value objects that boil down to a simple type and use them throughout the system. -
Sascha Egerer commented on patch set 3 10/14/13, 06:55
Are you still fine with that concept of the ExceptionInterface, Thomas? I think is ok like it is. -
Sebastian Fischer voted on patch set 3 CR +1 10/14/13, 07:23
-
Helmut Hummel commented on patch set 3 CR -1 10/14/13, 08:40
Enumeration.php:157This should get proper unit tests -
Sascha Egerer uploaded patch set 4 10/14/13, 09:55
-
Sascha Egerer uploaded patch set 5 10/14/13, 09:57
-
Sascha Egerer commented on patch set 3 10/14/13, 09:58
Added a bunch of new testsEnumeration.php:157ReplyDone. Added a bunch of tests for this method -
Mr. Jenkins commented on patch set 4 CR -1 V -1 10/14/13, 10:09
Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/11470/ : FAILURE -
Mr. Jenkins commented on patch set 5 CR -1 V -1 10/14/13, 10:47
Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/11473/ : FAILURE -
Sascha Egerer uploaded patch set 6 10/14/13, 10:48
-
Sebastian Fischer voted on patch set 6 CR +1 10/14/13, 12:10
-
Mr. Jenkins commented on patch set 6 10/14/13, 12:48
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11483/ : SUCCESS -
Thomas Maroschik voted on patch set 6 CR +1 10/14/13, 12:54
-
Sascha Egerer commented on patch set 6 10/15/13, 05:37
I've added a simple test extension to the ticket that uses an enumeration in model -
Stefan Neufeind commented on patch set 6 CR +1 10/15/13, 09:10
DataMapper.php:247needs to be include full namespace in the doc: \TYPO3\CMS\Core\Type\TypeInterface -
Marc Bastian Heinrichs commented on patch set 6 V -1 10/15/13, 10:19
With your test extension a given wrong type value the error claims a wrong class: "foo.type: Invalid value 5 for TYPO3\CMS\Core\Type\Enumeration" instead of TYPO3\CMS\Core\Versioning\VersionState -
Marc Bastian Heinrichs uploaded patch set 7 10/15/13, 10:50
-
Marc Bastian Heinrichs commented on patch set 7 V +1 CR +1 10/15/13, 10:52
Fixed class name in exception message by using get_class($this) instead of __class__ Fixed comment by Stefan -
Sascha Egerer commented on patch set 7 10/15/13, 11:05
Thank you! -
Marc Bastian Heinrichs uploaded patch set 8 10/15/13, 11:07
-
Marc Bastian Heinrichs commented on patch set 8 V +1 CR +1 10/15/13, 11:09
Also changed get_called_class to get_class($this) in non static contexts on request of Thomas. -
Sascha Egerer commented on patch set 8 CR +1 10/15/13, 11:10
good point. -
Stefan Neufeind voted on patch set 8 CR +1 10/15/13, 11:48
-
Mr. Jenkins commented on patch set 7 10/15/13, 13:29
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11579/ : SUCCESS -
Mr. Jenkins commented on patch set 8 10/15/13, 14:31
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/11584/ : SUCCESS -
Thomas Maroschik voted on patch set 8 V +2 CR +2 10/15/13, 14:33
-
Thomas Maroschik merged patch set 9 10/15/13, 14:33
-
Philipp Gampe commented on patch set 9 10/15/13, 14:43
Please make sure to add needed/useful documentation to the core API manual (at least create an issue with some sample code and some words on the motivation).