Skip to content

Commit

Permalink
fix: remove readopnly classes and fix annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Beru committed Jun 18, 2024
1 parent 56d8140 commit bfb4d6c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
6 changes: 4 additions & 2 deletions src/Client/GotenbergClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

final class GotenbergClient implements GotenbergClientInterface
{
public function __construct(private readonly string $gotenbergBaseUri, private readonly HttpClientInterface $client)
{
public function __construct(
private readonly string $gotenbergBaseUri,
private readonly HttpClientInterface $client,
) {
}

public function call(string $endpoint, array $multipartFormData, array $headers = []): GotenbergResponse
Expand Down
11 changes: 7 additions & 4 deletions src/Formatter/AssetBaseDirFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

use Symfony\Component\Filesystem\Filesystem;

final readonly class AssetBaseDirFormatter
final class AssetBaseDirFormatter
{
private string $baseDir;
private readonly string $baseDir;

public function __construct(private Filesystem $filesystem, private string $projectDir, string $baseDir)
{
public function __construct(
private readonly Filesystem $filesystem,
private readonly string $projectDir,
string $baseDir,
) {
$this->baseDir = rtrim($baseDir, '/');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Gotenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Psr\Container\ContainerInterface;

final readonly class Gotenberg implements GotenbergInterface
final class Gotenberg implements GotenbergInterface
{
public function __construct(
private ContainerInterface $container,
private readonly ContainerInterface $container,
) {
}

Expand Down
17 changes: 9 additions & 8 deletions src/GotenbergPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Sensiolabs\GotenbergBundle\Builder\Pdf\PdfBuilderInterface;
use Sensiolabs\GotenbergBundle\Builder\Pdf\UrlPdfBuilder;

final readonly class GotenbergPdf implements GotenbergPdfInterface
final class GotenbergPdf implements GotenbergPdfInterface
{
public function __construct(
private ContainerInterface $container,
private readonly ContainerInterface $container,
) {
}

Expand All @@ -24,12 +24,13 @@ public function get(string $builder): PdfBuilderInterface
/**
* @param 'html'|'url'|'markdown'|'office'|'merge' $key
*
* @return ($key is 'html' ? HtmlPdfBuilder :
* $key is 'url' ? UrlPdfBuilder :
* $key is 'markdown' ? MarkdownPdfBuilder :
* $key is 'office' ? LibreOfficePdfBuilder :
* $key is 'merge' ? MergePdfBuilder :
* PdfBuilderInterface)
* @return (
* $key is 'html' ? HtmlPdfBuilder :
* $key is 'url' ? UrlPdfBuilder :
* $key is 'markdown' ? MarkdownPdfBuilder :
* $key is 'office' ? LibreOfficePdfBuilder :
* $key is 'merge' ? MergePdfBuilder :
* PdfBuilderInterface
* )
*/
private function getInternal(string $key): PdfBuilderInterface
Expand Down
13 changes: 7 additions & 6 deletions src/GotenbergScreenshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use Sensiolabs\GotenbergBundle\Builder\Screenshot\ScreenshotBuilderInterface;
use Sensiolabs\GotenbergBundle\Builder\Screenshot\UrlScreenshotBuilder;

final readonly class GotenbergScreenshot implements GotenbergScreenshotInterface
final class GotenbergScreenshot implements GotenbergScreenshotInterface
{
public function __construct(
private ContainerInterface $container,
private readonly ContainerInterface $container,
) {
}

Expand All @@ -23,10 +23,11 @@ public function get(string $builder): ScreenshotBuilderInterface
/**
* @param 'html'|'url'|'markdown' $key
*
* @return ($key is 'html' ? HtmlScreenshotBuilder :
* $key is 'url' ? UrlScreenshotBuilder :
* $key is 'markdown' ? MarkdownScreenshotBuilder :
* ScreenshotBuilderInterface)
* @return (
* $key is 'html' ? HtmlScreenshotBuilder :
* $key is 'url' ? UrlScreenshotBuilder :
* $key is 'markdown' ? MarkdownScreenshotBuilder :
* ScreenshotBuilderInterface
* )
*/
private function getInternal(string $key): ScreenshotBuilderInterface
Expand Down

0 comments on commit bfb4d6c

Please sign in to comment.