[TASK] Remove deprecated methods/properties in Extbase 16/28716/4
authorAlexander Schnitzler <typo3@alexanderschnitzler.de>
Mon, 24 Mar 2014 17:37:31 +0000 (18:37 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 25 Mar 2014 14:20:57 +0000 (15:20 +0100)
Releases: 6.2
Resolves: #57242
Resolves: #44327
Change-Id: I0cfd55e8bbaab690cc6b22b30e18972b0e8747c0
Reviewed-on: https://review.typo3.org/28716
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Klee
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php
typo3/sysext/extbase/Classes/Persistence/Generic/Typo3QuerySettings.php
typo3/sysext/extbase/Classes/Security/Cryptography/HashService.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryResultTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Storage/Typo3DbQueryParserTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Typo3QuerySettingsTest.php

index c752d9b..d09cdb6 100644 (file)
@@ -37,17 +37,6 @@ use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
 class QueryResult implements QueryResultInterface {
 
        /**
-        * This field is only needed to make debugging easier:
-        * If you call current() on a class that implements Iterator, PHP will return the first field of the object
-        * instead of calling the current() method of the interface.
-        * We use this unusual behavior of PHP to return the warning below in this case.
-        *
-        * @var string
-        * @deprecated since Extbase 1.3.0; will be removed in Extbase 6.1
-        */
-       private $warning = 'You should never see this warning. If you do, you probably used PHP array functions like current() on the TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult. To retrieve the first result, you can use the getFirst() method.';
-
-       /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
         * @inject
         */
index c65706c..6f6ebaa 100644 (file)
@@ -288,36 +288,6 @@ class Typo3QuerySettings implements QuerySettingsInterface {
        }
 
        /**
-        * Sets the flag if the visibility in the frontend should be respected.
-        *
-        * @param bool $respectEnableFields TRUE if the visibility in the frontend should be respected. If TRUE, the "enable fields" of TYPO3 will be added to the query statement.
-        * @return QuerySettingsInterface
-        * @deprecated since Extbase 6.0, will be removed two versions later. Use setIgnoreEnableFields() and setEnableFieldsToBeIgnored() instead.
-        * @see setIgnoreEnableFields()
-        * @see setEnableFieldsToBeIgnored()
-        * @api
-        */
-       public function setRespectEnableFields($respectEnableFields) {
-               GeneralUtility::logDeprecatedFunction();
-               $this->setIgnoreEnableFields(!$respectEnableFields);
-               $this->setIncludeDeleted(!$respectEnableFields);
-               return $this;
-       }
-
-       /**
-        * Returns the state, if the visibility settings for the frontend should be respected for the query.
-        *
-        * @return bool TRUE, if the visibility settings for the frontend should should be respected; otherwise FALSE.
-        * @deprecated since Extbase 6.0, will be removed two versions later. Use getIgnoreEnableFields() and getEnableFieldsToBeIgnored() instead.
-        * @see getIgnoreEnableFields()
-        * @see getEnableFieldsToBeIgnored()
-        */
-       public function getRespectEnableFields() {
-               GeneralUtility::logDeprecatedFunction();
-               return !($this->getIgnoreEnableFields() && $this->getIncludeDeleted());
-       }
-
-       /**
         * Sets a flag indicating whether all or some enable fields should be ignored. If TRUE, all enable fields are ignored.
         * If--in addition to this--enableFieldsToBeIgnored is set, only fields specified there are ignored. If FALSE, all
         * enable fields are taken into account, regardless of the enableFieldsToBeIgnored setting.
index 0243b4b..c051db7 100644 (file)
@@ -37,18 +37,6 @@ namespace TYPO3\CMS\Extbase\Security\Cryptography;
 class HashService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
-        * Generate a hash for a given string
-        *
-        * @param string $string The string for which a hash should be generated
-        * @return string The hash of the string
-        * @deprecated since Extbase 6.0, will be removed in Extbase 6.2
-        */
-       public function generateHash($string) {
-               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
-               return $this->generateHmac($string);
-       }
-
-       /**
         * Generate a hash (HMAC) for a given string
         *
         * @param string $string The string for which a hash should be generated
@@ -80,19 +68,6 @@ class HashService implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * Test if a string $string has the hash given by $hash.
-        *
-        * @param string $string The string which should be validated
-        * @param string $hash The hash of the string
-        * @return boolean TRUE if string and hash fit together, FALSE otherwise.
-        * @deprecated since Extbase 6.0, will be removed in Extbase 6.2
-        */
-       public function validateHash($string, $hash) {
-               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
-               return $this->validateHmac($string, $hash);
-       }
-
-       /**
         * Tests if a string $string matches the HMAC given by $hash.
         *
         * @param string $string The string which should be validated
index f78f009..620dfec 100644 (file)
@@ -175,10 +175,9 @@ class QueryResultTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
-       public function usingCurrentOnTheQueryResultReturnsAWarning() {
+       public function usingCurrentOnTheQueryResultReturnsNull() {
                $queryResult = new \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult($this->mockQuery);
-               $expectedResult = 'You should never see this warning. If you do, you probably used PHP array functions like current() on the TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult. To retrieve the first result, you can use the getFirst() method.';
                $actualResult = current($queryResult);
-               $this->assertEquals($expectedResult, $actualResult);
+               $this->assertNull($actualResult);
        }
 }
index 7bccefe..47bc5c1 100644 (file)
@@ -313,8 +313,10 @@ class Typo3DbQueryParserTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $GLOBALS['TSFE'] = new \stdClass();
                $GLOBALS['TSFE']->sys_page = new \TYPO3\CMS\Frontend\Page\PageRepository();
                $GLOBALS['SIM_ACCESS_TIME'] = 123456789;
+               /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings $mockQuerySettings */
                $mockQuerySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings', array('dummy'), array(), '', FALSE);
-               $mockQuerySettings->setRespectEnableFields($respectEnableFields);
+               $mockQuerySettings->setIgnoreEnableFields(!$respectEnableFields);
+               $mockQuerySettings->setIncludeDeleted(!$respectEnableFields);
                $sql = array();
 
                /** @var $mockEnvironmentService \TYPO3\CMS\Extbase\Service\EnvironmentService | \PHPUnit_Framework_MockObject_MockObject */
index c0a9822..a852c5f 100644 (file)
@@ -139,24 +139,6 @@ class Typo3QuerySettingsTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         *
         * @param boolean $input
         */
-       public function setRespectEnableFieldsSetsRespectEnableFieldsCorrectly($input) {
-               $this->typo3QuerySettings->setRespectEnableFields($input);
-               $this->assertEquals($input, $this->typo3QuerySettings->getRespectEnableFields());
-       }
-
-       /**
-        * @test
-        */
-       public function setRespectEnableFieldsAllowsChaining() {
-               $this->assertTrue($this->typo3QuerySettings->setRespectEnableFields(TRUE) instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface);
-       }
-
-       /**
-        * @test
-        * @dataProvider booleanValueProvider
-        *
-        * @param boolean $input
-        */
        public function setIgnoreEnableFieldsSetsIgnoreEnableFieldsCorrectly($input) {
                $this->typo3QuerySettings->setIgnoreEnableFields($input);
                $this->assertEquals($input, $this->typo3QuerySettings->getIgnoreEnableFields());