Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/1.3' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Aug 7, 2024
2 parents b907d56 + 3bb74df commit 418de7c
Show file tree
Hide file tree
Showing 26 changed files with 104 additions and 125 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/codeception.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
include:
- { php-version: 8.1, database: "mariadb:10.3", dependencies: lowest, experimental: false }
- { php-version: 8.2, database: "mariadb:10.11", dependencies: highest, experimental: false }
- { php-version: 8.3, database: "mariadb:10.11", dependencies: highest, pimcore_version: "11.x-dev as 11.0.0", experimental: true }
- { php-version: 8.3, database: "mariadb:10.11", dependencies: highest, pimcore_version: "11.x-dev", experimental: true }

services:
redis:
Expand Down Expand Up @@ -99,6 +99,7 @@ jobs:
run: |
if [ ! -z "$PIMCORE_VERSION" ]; then
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
composer require --no-update pimcore/admin-ui-classic-bundle:1.x-dev
fi
- name: "Install dependencies with Composer"
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

name: "PHP-CS-Fixer"

on:
pull_request_target:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "feature-*"
push:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "*_actions"
- "feature-*"

permissions:
contents: read
Expand All @@ -16,13 +22,14 @@ jobs:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:latest

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply php-cs-fixer changes
3 changes: 2 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
include:
- { php-version: "8.1", database: "mariadb:10.11", dependencies: "lowest", phpstan_args: "", experimental: false }
- { php-version: "8.2", database: "mariadb:10.11", dependencies: "highest", phpstan_args: "", experimental: false }
- { php-version: "8.3", database: "mariadb:10.11", dependencies: "highest", pimcore_version: "11.x-dev as 11.0.0", phpstan_args: "", experimental: true }
- { php-version: "8.3", database: "mariadb:10.11", dependencies: "highest", pimcore_version: "11.x-dev", phpstan_args: "", experimental: true }
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
Expand All @@ -48,6 +48,7 @@ jobs:
run: |
if [ ! -z "$PIMCORE_VERSION" ]; then
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
composer require --no-update pimcore/admin-ui-classic-bundle:1.x-dev
fi
- name: "Install dependencies with Composer"
Expand Down
6 changes: 3 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/config'
])

->exclude([
__DIR__ . '/tests/_output',
__DIR__ . '/tests/Support/_generated',
])

// do not fix views
->notName('*.html.php')
;

// do not enable self_accessor as it breaks pimcore models relying on get_called_class()
Expand All @@ -21,6 +19,7 @@
'@PSR1' => true,
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'list_syntax' => ['syntax' => 'short'],

'header_comment' => [
'comment_type' => 'PHPDoc',
Expand Down Expand Up @@ -54,6 +53,7 @@
'no_leading_namespace_whitespace' => true,
'no_short_bool_cast' => true,
'no_spaces_around_offset' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true],
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
Expand Down
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';
}
Loading

0 comments on commit 418de7c

Please sign in to comment.