Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 authored and github-actions[bot] committed Jul 5, 2024
1 parent 0c15e78 commit 94e5b76
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 116 deletions.
6 changes: 0 additions & 6 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ private static function getRepository(): LocationAwareConfigRepository
}

/**
* @return bool
*
* @throws \Exception
*/
Expand All @@ -72,7 +71,6 @@ public static function get(): array
}

/**
* @param array $data
*
* @throws \Exception
*/
Expand All @@ -98,8 +96,6 @@ public static function save(array $data): void
/**
* @static
*
* @return array
*
* @internal
*/
public static function getWeb2PrintConfig(): array
Expand All @@ -117,8 +113,6 @@ public static function getWeb2PrintConfig(): array
/**
* @static
*
* @param array $config
*
* @internal
*/
public static function setWeb2PrintConfig(array $config): void
Expand Down
37 changes: 1 addition & 36 deletions src/Controller/Document/PrintpageControllerBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ abstract class PrintpageControllerBase extends DocumentControllerBase
/**
* @Route("/get-data-by-id", name="getdatabyid", methods={"GET"})
*
* @param Request $request
*
* @return JsonResponse
*
* @throws Exception
*/
public function getDataByIdAction(Request $request): JsonResponse
Expand Down Expand Up @@ -90,10 +86,6 @@ static function (Task $task) {
/**
* @Route("/save", name="save", methods={"PUT", "POST"})
*
* @param Request $request
*
* @return JsonResponse
*
* @throws ValidationException
*/
public function saveAction(Request $request): JsonResponse
Expand All @@ -115,7 +107,7 @@ public function saveAction(Request $request): JsonResponse
}
}

list($task, $page, $version) = $this->saveDocument($page, $request);
[$task, $page, $version] = $this->saveDocument($page, $request);

if ($task === self::TASK_PUBLISH || $task === self::TASK_UNPUBLISH) {
$treeData = $this->getTreeNodeConfig($page);
Expand Down Expand Up @@ -145,9 +137,7 @@ public function saveAction(Request $request): JsonResponse
/**
* @Route("/add", name="add", methods={"POST"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function addAction(Request $request): JsonResponse
{
Expand Down Expand Up @@ -246,10 +236,6 @@ protected function setValuesToDocument(Request $request, Document $document): vo
/**
* @Route("/active-generate-process", name="activegenerateprocess", methods={"POST"})
*
* @param Request $request
*
* @return JsonResponse
*
* @throws Exception
*/
public function activeGenerateProcessAction(Request $request): JsonResponse
Expand Down Expand Up @@ -284,10 +270,6 @@ public function activeGenerateProcessAction(Request $request): JsonResponse
/**
* @Route("/pdf-download", name="pdfdownload", methods={"GET"})
*
* @param Request $request
*
* @return BinaryFileResponse
*
* @throws Exception
*/
public function pdfDownloadAction(Request $request): BinaryFileResponse
Expand All @@ -314,11 +296,6 @@ public function pdfDownloadAction(Request $request): BinaryFileResponse
/**
* @Route("/start-pdf-generation", name="startpdfgeneration", methods={"POST"})
*
* @param Request $request
* @param \Pimcore\Config $config
*
* @return JsonResponse
*
* @throws Exception
*/
public function startPdfGenerationAction(Request $request, \Pimcore\Config $config): JsonResponse
Expand Down Expand Up @@ -352,9 +329,7 @@ public function startPdfGenerationAction(Request $request, \Pimcore\Config $conf
/**
* @Route("/check-pdf-dirty", name="checkpdfdirty", methods={"GET"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function checkPdfDirtyAction(Request $request): JsonResponse
{
Expand All @@ -371,9 +346,7 @@ public function checkPdfDirtyAction(Request $request): JsonResponse
/**
* @Route("/get-processing-options", name="getprocessingoptions", methods={"GET"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function getProcessingOptionsAction(Request $request): JsonResponse
{
Expand Down Expand Up @@ -422,10 +395,6 @@ private function saveProcessingOptions(int $documentId, array $options): void
/**
* @Route("/cancel-generation", name="cancelgeneration", methods={"DELETE"})
*
* @param Request $request
*
* @return JsonResponse
*
* @throws Exception
*/
public function cancelGenerationAction(Request $request): JsonResponse
Expand All @@ -438,9 +407,7 @@ public function cancelGenerationAction(Request $request): JsonResponse
/**
* Checks if a file exists on the filesystem.
*
* @param string $filePath
*
* @return bool
*/
private function checkFileExists(string $filePath): bool
{
Expand All @@ -453,9 +420,7 @@ private function checkFileExists(string $filePath): bool
* Invalidates the FS cache for a given file path by opening and closing the directory.
* This is a workaround for a bug which happens when the local filesystem is using a NFS with cache.
*
* @param string $filePath
*
* @return void
*/
private function invalidateFsCacheFor(string $filePath): void
{
Expand Down
6 changes: 0 additions & 6 deletions src/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ class SettingsController extends UserAwareController
/**
* @Route("/get-web2print", name="pimcore_bundle_web2print_settings_getweb2print", methods={"GET"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function getWeb2printAction(Request $request): JsonResponse
{
Expand All @@ -60,9 +58,7 @@ public function getWeb2printAction(Request $request): JsonResponse
/**
* @Route("/set-web2print", name="pimcore_bundle_web2print_settings_setweb2print", methods={"PUT"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function setWeb2printAction(Request $request): JsonResponse
{
Expand All @@ -85,9 +81,7 @@ public function setWeb2printAction(Request $request): JsonResponse
/**
* @Route("/test-web2print", name="pimcore_bundle_web2print_settings_testweb2print", methods={"GET"})
*
* @param Request $request
*
* @return Response
*/
public function testWeb2printAction(Request $request): Response
{
Expand Down
3 changes: 0 additions & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('pimcore_web_to_print');
Expand Down
2 changes: 0 additions & 2 deletions src/Event/Model/PrintConfigEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class PrintConfigEvent extends Event
/**
* DocumentEvent constructor.
*
* @param Processor $processor
* @param array $arguments
*/
public function __construct(Processor $processor, array $arguments = [])
{
Expand Down
4 changes: 0 additions & 4 deletions src/Model/Document/PrintAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ abstract class PrintAbstract extends PageSnippet
/**
* @internal
*
* @var int|null
*/
protected ?int $lastGenerated = null;

/**
* @internal
*
* @var string|null
*/
protected ?string $lastGenerateMessage = null;

/**
* @internal
*
* @var string|null
*/
protected ?string $controller = 'web2print';

Expand Down Expand Up @@ -114,7 +111,6 @@ public function pdfIsDirty(): bool
/**
* @internal
*
* @return string
*/
public function getLockKey(): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/Model/Document/PrintAbstract/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Dao extends Document\PageSnippet\Dao
/**
* Contains the valid database columns
*
* @var array
*/
protected array $validColumnsPage = [];

Expand All @@ -46,7 +45,6 @@ public function init(): void
/**
* Get the data for the object by the given id, or by the id which is set in the object
*
* @param int|null $id
*
* @throws \Exception
*/
Expand Down
5 changes: 0 additions & 5 deletions src/Model/Document/Printcontainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,17 @@
*/
class Printcontainer extends PrintAbstract
{
/**
* {@inheritdoc}
*/
protected string $type = 'printcontainer';

/**
* @internal
*
* @var string
*/
protected string $action = 'container';

private array $allChildren = [];

/**
* @return array
*
* @internal
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Model/Document/Printpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@
*/
class Printpage extends PrintAbstract
{
/**
* {@inheritdoc}
*/
protected string $type = 'printpage';
}
20 changes: 0 additions & 20 deletions src/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ public static function getInstance(): PdfReactor|Gotenberg|Chromium|Processor
}

/**
* @param int $documentId
* @param array $config
*
* @return bool
*
* @throws \Exception
*/
Expand Down Expand Up @@ -95,9 +92,7 @@ public function preparePdfGeneration(int $documentId, array $config): bool
}

/**
* @param int $documentId
*
* @return string|null
*
* @throws Model\Element\ValidationException
* @throws NotPreparedException
Expand Down Expand Up @@ -153,10 +148,7 @@ public function startPdfGeneration(int $documentId): ?string
}

/**
* @param PrintAbstract $document
* @param object $config
*
* @return string
*
* @throws \Exception
*/
Expand All @@ -180,9 +172,7 @@ protected function loadJobConfigObject(int $documentId): ?\stdClass
}

/**
* @param int $documentId
*
* @return PrintAbstract
*
* @throws \Exception
*/
Expand All @@ -204,9 +194,6 @@ public static function getJobConfigFile(int $processId): string
abstract public function getProcessingOptions(): array;

/**
* @param int $documentId
* @param int $status
* @param string $statusUpdate
*
* @throws CancelException
*/
Expand Down Expand Up @@ -235,7 +222,6 @@ public function getStatusUpdate(int $documentId): ?array
}

/**
* @param int $documentId
*
* @throws \Exception
*/
Expand All @@ -252,10 +238,7 @@ public function cancelGeneration(int $documentId): void
}

/**
* @param string $html
* @param array $params
*
* @return string
*
* @throws \Exception
*/
Expand Down Expand Up @@ -293,11 +276,8 @@ protected function getLock(PrintAbstract $document): LockInterface
/**
* Returns the generated pdf file. Its path or data depending supplied parameter
*
* @param string $html
* @param array $params
* @param bool $returnFilePath return the path to the pdf file or the content
*
* @return string
*/
abstract public function getPdfFromString(string $html, array $params = [], bool $returnFilePath = false): string;
}
2 changes: 0 additions & 2 deletions src/Processor/PdfReactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class PdfReactor extends Processor
/**
* returns the default web2print config
*
* @param object $config
*
* @return array
*/
protected function getConfig(object $config): array
{
Expand Down
2 changes: 0 additions & 2 deletions src/Twig/Extension/PrintCatalogExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class PrintCatalogExtension extends AbstractExtension
/**
* PrintCatalogExtension constructor.
*
* @param Translator $translator
* @param Placeholder $placeholderHelper
*/
public function __construct(Translator $translator, Placeholder $placeholderHelper)
{
Expand Down
Loading

0 comments on commit 94e5b76

Please sign in to comment.