Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 authored and github-actions[bot] committed Feb 7, 2023
1 parent 31f572e commit ac85677
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable
'10.6',
'Usage of @ParamConverter annotation is deprecated. please use #[DataObjectParam] argument attribute instead.'
);
$options[0] = new DataObjectParam($converter->getClass(),$converter->getOptions()['unpublished'] ?? null, $converter->getOptions());
$options[0] = new DataObjectParam($converter->getClass(), $converter->getOptions()['unpublished'] ?? null, $converter->getOptions());
}
}

Expand All @@ -67,6 +67,7 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable

if (!$value && $argument->isNullable()) {
$request->attributes->set($param, null);

return [];
}

Expand Down Expand Up @@ -95,4 +96,4 @@ public function supports(Request $request, ArgumentMetadata $argument)

return is_subclass_of($argument->getType(), AbstractObject::class);
}
}
}
66 changes: 33 additions & 33 deletions lib/Controller/Attribute/ResponseHeader.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?php

declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Controller\Attribute;

use Pimcore\Controller\Configuration\ResponseHeader as BaseResponseHeader;

/**
* Allows to set HTTP headers on the response via attributes. The attribute will
* be processed by ResponseHeaderListener which will set the HTTP headers on the
* response.
*
* See ResponseHeaderBag for documentation on the fields.
*
*/
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)]
final class ResponseHeader extends BaseResponseHeader
{
}
<?php

declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Controller\Attribute;

use Pimcore\Controller\Configuration\ResponseHeader as BaseResponseHeader;

/**
* Allows to set HTTP headers on the response via attributes. The attribute will
* be processed by ResponseHeaderListener which will set the HTTP headers on the
* response.
*
* See ResponseHeaderBag for documentation on the fields.
*
*/
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)]
final class ResponseHeader extends BaseResponseHeader
{
}
3 changes: 2 additions & 1 deletion lib/Controller/Configuration/ResponseHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class ResponseHeader extends ConfigurationAnnotation
* @param string|array $values
* @param bool $replace
*/
public function __construct($key = null, $values = '', $replace = false) {
public function __construct($key = null, $values = '', $replace = false)
{
if (is_array($key)) {
// value is the default key if attribute was called without assignment
// e.g. #[ResponseHeader("X-Foo")] instead of #[ResponseHeader(key="X-Foo")]
Expand Down
62 changes: 31 additions & 31 deletions lib/Request/Attribute/DataObjectParam.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Request\Attribute;

/**
* Argument to resolve a DataObject.
*/
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class DataObjectParam
{
public function __construct(
public ?string $class = null,
public ?bool $unpublished = null,
public ?array $options = null
) {
}
}
<?php
declare(strict_types=1);

/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Commercial License (PCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PCL
*/

namespace Pimcore\Request\Attribute;

/**
* Argument to resolve a DataObject.
*/
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class DataObjectParam
{
public function __construct(
public ?string $class = null,
public ?bool $unpublished = null,
public ?array $options = null
) {
}
}

0 comments on commit ac85677

Please sign in to comment.