first commit
This commit is contained in:
14
bundles/KupShop/KupShopBundle/Attribute/EnableCache.php
Normal file
14
bundles/KupShop/KupShopBundle/Attribute/EnableCache.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KupShop\KupShopBundle\Attribute;
|
||||
|
||||
/**
|
||||
* Enables controller to set caching headers, for example using Cache attribute or modifying response.
|
||||
* Without this attribute, all caching is always disabled because of initiated session (see AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER).
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
|
||||
class EnableCache
|
||||
{
|
||||
}
|
||||
21
bundles/KupShop/KupShopBundle/Attribute/OverrideService.php
Normal file
21
bundles/KupShop/KupShopBundle/Attribute/OverrideService.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KupShop\KupShopBundle\Attribute;
|
||||
|
||||
/**
|
||||
* Overrides existing DI service by current class and excludes current class from DI to avoid duplicate services.
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||
class OverrideService
|
||||
{
|
||||
public function __construct(private readonly string $service)
|
||||
{
|
||||
}
|
||||
|
||||
public function getService(): string
|
||||
{
|
||||
return $this->service;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user