-
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 IconFactory proxy
Necessary because of upcoming changes in core which makes this class final.
- Loading branch information
1 parent
3a426a8
commit eddaa81
Showing
3 changed files
with
48 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,42 @@ | ||
<?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\Imaging\Icon; | ||
use TYPO3\CMS\Core\Imaging\IconFactory; | ||
use TYPO3\CMS\Core\Imaging\IconSize; | ||
use TYPO3\CMS\Core\Imaging\IconState; | ||
|
||
/** | ||
* Final/readonly classes is a great way to give all your developer community users the middle finger. | ||
* | ||
* @codeCoverageIgnore | ||
*/ | ||
class IconFactoryProxy | ||
{ | ||
private IconFactory $iconFactory; | ||
|
||
public function __construct(IconFactory $iconFactory) | ||
{ | ||
$this->iconFactory = $iconFactory; | ||
} | ||
|
||
/** | ||
* @param string|IconSize $size | ||
* @param \TYPO3\CMS\Core\Type\Icon\IconState|IconState|null $state | ||
*/ | ||
public function getIcon( | ||
string $identifier, | ||
$size, | ||
?string $overlayIdentifier = null, | ||
$state = null | ||
): Icon { | ||
return $this->iconFactory->getIcon($identifier, $size, $overlayIdentifier, $state); | ||
} | ||
} |
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