refactor multiple widget controllers; replace caching logic with action classes for data retrieval, enhancing code clarity and maintainability
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Widget\Actions;
|
||||
|
||||
use App\Containers\Widget\Tasks\FindPostByIdTask;
|
||||
|
||||
class GetSinglePostAction
|
||||
{
|
||||
public function __construct(
|
||||
private readonly FindPostByIdTask $findPostByIdTask
|
||||
) {}
|
||||
|
||||
public function run(int $id)
|
||||
{
|
||||
return $this->findPostByIdTask->run($id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user