-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Introduce ResourceFactory proxy
Necessary because of upcoming core changes that make the class final.
- Loading branch information
1 parent
c1b468a
commit 5030838
Showing
3 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace FluidTYPO3\Flux\Proxy; | ||
|
||
/* | ||
* This file is part of the FluidTYPO3/Flux project under GPLv2 or later. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.md file that was distributed with this source code. | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Resource\FileReference; | ||
use TYPO3\CMS\Core\Resource\ResourceFactory; | ||
|
||
/** | ||
* Final/readonly class is unnecessary coercion - and using it in shared libraries is arrogant and very disrespectful. | ||
* | ||
* @codeCoverageIgnore | ||
*/ | ||
class ResourceFactoryProxy | ||
{ | ||
private ResourceFactory $resourceFactory; | ||
|
||
public function __construct(ResourceFactory $resourceFactory) | ||
{ | ||
$this->resourceFactory = $resourceFactory; | ||
} | ||
|
||
public function getFileReferenceObject(int $uid): FileReference | ||
{ | ||
return $this->resourceFactory->getFileReferenceObject($uid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters