[FEATURE] Add AbstractCondition for TS conditions 95/32695/11
authorBenjamin Mack <benni@typo3.org>
Tue, 9 Sep 2014 19:42:37 +0000 (21:42 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 24 Sep 2014 18:27:41 +0000 (20:27 +0200)
commit071c4a163f4be74c829793ccd83259772d112945
tree9acc9b6decdd9c0e13984a4c1281df068997d78a
parentfb861ae719620d4f455f0e70a75a344d83793031
[FEATURE] Add AbstractCondition for TS conditions

In order to streamline conditions and make
TypoScript conditions more flexible, an abstract class
AbstractCondition is introduced. Any class can extend
this abstract class, and TypoScript seamlessly calls
the class's main function that can completely flexibly
deal with the value that is set after the class.

possible conditions are:

[ACME\TypoScriptLovePackage\BennisCondition]

[ACME\TypoScriptLovePackage\BennisCondition = 7]

[ACME\TypoScriptLovePackage\BennisCondition = 7, != 6]

where the TypoScript Condition can deal with =/!= etc
by itself.

Additionally, this change fixes one bug, where the
AbstractConditionMatcher would check on a condition name
and would not match, then there is an additional
run through the subclass although not needed.

Releases: master
Resolves: #61489
Change-Id: I891edd367bb29b042cbbf6aa368cbf173dc3815d
Reviewed-on: http://review.typo3.org/32695
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractCondition.php [new file with mode: 0644]
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Classes/Configuration/TypoScript/Exception/InvalidTypoScriptConditionException.php [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Feature-61489-AbstractTypoScriptCondition.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcherTest.php
typo3/sysext/frontend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/Fixtures/TestCondition.php [new file with mode: 0644]
typo3/sysext/frontend/Tests/Unit/Configuration/TypoScript/ConditionMatching/Fixtures/TestConditionException.php [new file with mode: 0644]