Move lastRelease jsonFile to attribute
This commit is contained in:
parent
38a53c6bd3
commit
aa05a1c98e
@ -19,7 +19,3 @@ services:
|
||||
- '../src/DependencyInjection/'
|
||||
- '../src/Entity/'
|
||||
- '../src/Kernel.php'
|
||||
|
||||
App\Service\LastRelease:
|
||||
arguments:
|
||||
- '%kernel.project_dir%/release.json'
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Service;
|
||||
|
||||
use JetBrains\PhpStorm\ArrayShape;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
|
||||
class LastRelease
|
||||
{
|
||||
@ -18,7 +19,7 @@ class LastRelease
|
||||
])]
|
||||
private array $lastRelease = [];
|
||||
|
||||
public function __construct(string $jsonFile)
|
||||
public function __construct(#[Autowire('%kernel.project_dir%/release.json')] string $jsonFile)
|
||||
{
|
||||
if (file_exists($jsonFile)) {
|
||||
$this->lastRelease = json_decode(file_get_contents($jsonFile), true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user