From d8ff19e3cf89aea8e3f15c4154c9000018b8b0ca Mon Sep 17 00:00:00 2001
From: Andreas Wolf <andreas.wolf@typo3.org>
Date: Sun, 2 Sep 2012 11:29:31 +0200
Subject: [PATCH] [TASK] ResourceStorage: Remove getFileInfoByIdentifier()
 method

The method getFileInfoByIdentifier() has been marked as deprecated long
ago. Additionally, the getFileInfo() method currently uses incorrect
semantics - it expects an identifier, while it should use a file object
to be in line with all other public FAL API methods.

Change-Id: Id76c1a03dcbcead33a16c6410ad93c66dafaa5c6
Resolves: #40520
Releases: 6.0
Reviewed-on: http://review.typo3.org/14281
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Mario Rimann
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
---
 .../core/Classes/Resource/ResourceStorage.php   | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/typo3/sysext/core/Classes/Resource/ResourceStorage.php b/typo3/sysext/core/Classes/Resource/ResourceStorage.php
index 875f0a3d5530..1656c6a5be3a 100644
--- a/typo3/sysext/core/Classes/Resource/ResourceStorage.php
+++ b/typo3/sysext/core/Classes/Resource/ResourceStorage.php
@@ -796,24 +796,23 @@ class ResourceStorage {
 	}
 
 	/**
-	 * Get file by identifier
+	 * Get information about a file
 	 *
-	 * @param \TYPO3\CMS\Core\Resource\FileInterface $identifier
+	 * @param \TYPO3\CMS\Core\Resource\FileInterface $fileObject
 	 * @return array
 	 */
-	public function getFileInfo($identifier) {
-		return $this->driver->getFileInfo($identifier);
+	public function getFileInfo(FileInterface $fileObject) {
+		return $this->driver->getFileInfo($fileObject);
 	}
 
 	/**
-	 * Get file by identifier
+	 * Get information about a file by its identifier
 	 *
-	 * @deprecated To be removed before final release of FAL. Use combination of getFileInfoByIdentifier() with a file object as argument instead.
 	 * @param string $identifier
-	 * @return \TYPO3\CMS\Core\Resource\FileInterface
+	 * @return array
 	 */
 	public function getFileInfoByIdentifier($identifier) {
-		return $this->driver->getFileInfoByIdentifier($identifier);
+		throw new \BadMethodCallException("The method ResourceStorage::getFileInfoByIdentifier() has been deprecated. Please fix your method call and use getFileInfo with the file object instead.", 1346577887);
 	}
 
 	/**
@@ -1967,4 +1966,4 @@ class ResourceStorage {
 }
 
 
-?>
\ No newline at end of file
+?>
-- 
GitLab