Skip to content

Commit

Permalink
minor #1513 Update SourceCodeExtension.php (parijke)
Browse files Browse the repository at this point in the history
This PR was merged into the main branch.

Discussion
----------

Update SourceCodeExtension.php

Use property promotion

We use property promotion all over the code base.

Commits
-------

473c257 Update SourceCodeExtension.php
  • Loading branch information
javiereguiluz committed Apr 15, 2024
2 parents 26741c8 + 473c257 commit 12f7357
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Twig/SourceCodeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@
*/
final class SourceCodeExtension extends AbstractExtension
{
private FileLinkFormatter $fileLinkFormat;
private string $projectDir;
/**
* @var callable|null
*/
private $controller;

public function __construct(
FileLinkFormatter $fileLinkFormat,
private FileLinkFormatter $fileLinkFormat,
#[Autowire('%kernel.project_dir%')]
string $projectDir,
private string $projectDir,
) {
$this->fileLinkFormat = $fileLinkFormat;
$this->projectDir = str_replace('\\', '/', $projectDir).'/';
}

Expand Down

0 comments on commit 12f7357

Please sign in to comment.