Skip to content

Commit

Permalink
[Task] Add @param and @return php doc types to non-internal public an…
Browse files Browse the repository at this point in the history
…d protected methods (#636)

* [Task] Add @param and @return php doc types to non-internal public and protected methods

* Apply php-cs-fixer changes

* [Task] Add @param and @return php doc types to non-internal public and protected methods
mixed parameter types

* Apply php-cs-fixer changes

Co-authored-by: mcop1 <[email protected]>
  • Loading branch information
mcop1 and mcop1 authored Nov 29, 2022
1 parent 996812b commit 3a454f2
Show file tree
Hide file tree
Showing 208 changed files with 702 additions and 648 deletions.
7 changes: 4 additions & 3 deletions src/Command/GraphQL/RebuildDefinitionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ protected function configure()
}

/**
*
* @deprecated Use Pimcore\Bundle\DataHubBundle\Command\Configuration\RebuildWorkspacesCommand instead.
*
* @param InputInterface $input
* @param OutputInterface $output
*
* @return int|void|null
* @return int
*
* @throws \Exception
*
*@deprecated Use Pimcore\Bundle\DataHubBundle\Command\Configuration\RebuildWorkspacesCommand instead.
*
*/
public function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
40 changes: 5 additions & 35 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public function __construct($type, $path, $name = null, $configuration = null)
$this->setConfiguration($configuration ?? []);
}

/**
* @return array
*/
public function getObjectVars()
{
$data = parent::getObjectVars();
Expand Down Expand Up @@ -133,24 +136,18 @@ public function getModificationDate()
return $this->modificationDate;
}

/**
* @return string
*/
public function getType(): string
{
return $this->type;
}

/**
* @param string $type
*/
public function setType(string $type): void
{
$this->type = $type;
}

/**
* @param mixed $configuration
* @param array|null $configuration
*/
public function setConfiguration($configuration): void
{
Expand All @@ -164,7 +161,7 @@ public function setConfiguration($configuration): void
}

/**
* @return mixed
* @return array
*/
public function getConfiguration()
{
Expand All @@ -182,33 +179,21 @@ public function setName($name): void
$this->name = $name;
}

/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}

/**
* @return string|null
*/
public function getGroup(): ?string
{
return $this->group;
}

/**
* @param string|null $group
*/
public function setGroup(?string $group): void
{
$this->group = $group;
}

/**
* @return string|null
*/
public function getSqlObjectCondition(): ?string
{
return $this->configuration && $this->configuration['general'] ? $this->configuration['general']['sqlObjectCondition'] ?? null : null;
Expand Down Expand Up @@ -238,9 +223,6 @@ public function setPath($path): void
$this->path = $path;
}

/**
* @return string|null
*/
public function getPath(): ?string
{
return $this->path;
Expand Down Expand Up @@ -306,9 +288,6 @@ public function save(): void
\Pimcore::getEventDispatcher()->dispatch($event, ConfigurationEvents::CONFIGURATION_POST_SAVE);
}

/**
* @return void
*/
public function delete(): void
{
if (!$this->isAllowed('delete')) {
Expand Down Expand Up @@ -349,9 +328,6 @@ public static function getByName($name): ?self
}
}

/**
* @return array
*/
public function getQueryEntities(): array
{
$schema = $this->configuration['schema'] ?? null;
Expand All @@ -361,9 +337,6 @@ public function getQueryEntities(): array
return $entities;
}

/**
* @return array
*/
public function getSpecialEntities(): array
{
$schema = $this->configuration['schema'] ?? null;
Expand All @@ -372,9 +345,6 @@ public function getSpecialEntities(): array
return $entities;
}

/**
* @return array
*/
public function getMutationEntities(): array
{
$schema = $this->configuration['schema'] ?? null;
Expand Down
12 changes: 9 additions & 3 deletions src/Configuration/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public function delete(): void
$this->deleteData($this->model->getName());
}

/**
* @param array $data
*
* @return void
*/
public function setVariables($data)
{
$this->model->setConfiguration($data);
Expand Down Expand Up @@ -146,11 +151,12 @@ public static function getByName($name)

/**
*
* @deprecated will be removed with pimcore 11
* @return int
*
*@deprecated will be removed with pimcore 11
*
* get latest modification date of configuration file.
*
* @return bool|int
*/
public static function getConfigModificationDate()
{
Expand All @@ -160,7 +166,7 @@ public static function getConfigModificationDate()
/**
* get the whole configuration file content.
*
* @return array|mixed|null
* @return array
*/
private function &getConfig()
{
Expand Down
39 changes: 0 additions & 39 deletions src/Configuration/Workspace/AbstractWorkspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,65 +58,41 @@ abstract class AbstractWorkspace extends AbstractModel
*/
public $delete = false;

/**
* @return string
*/
public function getConfiguration(): string
{
return $this->configuration;
}

/**
* @param string $configuration
*/
public function setConfiguration(string $configuration): void
{
$this->configuration = $configuration;
}

/**
* @return int
*/
public function getCid(): int
{
return $this->cid;
}

/**
* @param int $cid
*/
public function setCid(int $cid): void
{
$this->cid = $cid;
}

/**
* @return string
*/
public function getCpath(): string
{
return $this->cpath;
}

/**
* @param string $cpath
*/
public function setCpath(string $cpath): void
{
$this->cpath = $cpath;
}

/**
* @return bool
*/
public function isCreate(): bool
{
return $this->create;
}

/**
* @param bool $create
*/
public function setCreate(bool $create): void
{
$this->create = $create;
Expand All @@ -130,41 +106,26 @@ public function getRead()
return $this->read;
}

/**
* @param bool $read
*/
public function setRead(bool $read): void
{
$this->read = $read;
}

/**
* @return bool
*/
public function isUpdate(): bool
{
return $this->update;
}

/**
* @param bool $update
*/
public function setUpdate(bool $update): void
{
$this->update = $update;
}

/**
* @return bool
*/
public function isDelete(): bool
{
return $this->delete;
}

/**
* @param bool $delete
*/
public function setDelete(bool $delete): void
{
$this->delete = $delete;
Expand Down
25 changes: 11 additions & 14 deletions src/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public function listAction(Request $request): JsonResponse
*
* @param Request $request
*
* @return JsonResponse
* @return JsonResponse|null
*
* @throws \Exception
* @throws ConfigWriteException
*/
public function deleteAction(Request $request): ?JsonResponse
{
Expand Down Expand Up @@ -162,9 +162,9 @@ public function deleteAction(Request $request): ?JsonResponse
*
* @param Request $request
*
* @throws \Exception
* @return JsonResponse|null
*
* @return JsonResponse
* @throws ConfigWriteException
*/
public function addAction(Request $request): ?JsonResponse
{
Expand Down Expand Up @@ -200,9 +200,7 @@ public function addAction(Request $request): ?JsonResponse
*
* @param Request $request
*
* @throws \Exception
*
* @return JsonResponse
* @return JsonResponse|null
*/
public function cloneAction(Request $request): ?JsonResponse
{
Expand Down Expand Up @@ -243,10 +241,11 @@ public function cloneAction(Request $request): ?JsonResponse
*
* @param Request $request
* @param Service $graphQlService
*
* @throws \Exception
* @param EventDispatcherInterface $eventDispatcher
*
* @return JsonResponse
*
* @throws \Exception
*/
public function getAction(Request $request, Service $graphQlService, EventDispatcherInterface $eventDispatcher): JsonResponse
{
Expand Down Expand Up @@ -397,9 +396,7 @@ public function getAction(Request $request, Service $graphQlService, EventDispat
*
* @param Request $request
*
* @throws \Exception
*
* @return JsonResponse
* @return JsonResponse|null
*/
public function saveAction(Request $request): ?JsonResponse
{
Expand Down Expand Up @@ -483,9 +480,9 @@ public function saveAction(Request $request): ?JsonResponse
* @param RouterInterface $routingService
* @param Request $request
*
* @throws \Exception
* @return JsonResponse|null
*
* @return JsonResponse
* @throws \Exception
*/
public function getExplorerUrlAction(RouterInterface $routingService, Request $request): ?JsonResponse
{
Expand Down
7 changes: 3 additions & 4 deletions src/Controller/WebserviceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use GraphQL\Error\DebugFlag;
use GraphQL\Error\Warning;
use GraphQL\GraphQL;
use GraphQL\Server\RequestError;
use GraphQL\Validator\DocumentValidator;
use GraphQL\Validator\Rules\DisableIntrospection;
use Pimcore\Bundle\DataHubBundle\Configuration;
Expand Down Expand Up @@ -66,9 +67,6 @@ class WebserviceController extends FrontendController
*/
private $uploadService;

/**
* @param EventDispatcherInterface $eventDispatcher
*/
public function __construct(
EventDispatcherInterface $eventDispatcher,
CheckConsumerPermissionsService $permissionsService,
Expand All @@ -86,10 +84,11 @@ public function __construct(
* @param LocaleServiceInterface $localeService
* @param Factory $modelFactory
* @param Request $request
* @param LongRunningHelper $longRunningHelper
*
* @return JsonResponse
*
* @throws \Exception
* @throws RequestError
*/
public function webonyxAction(
Service $service,
Expand Down
Loading

0 comments on commit 3a454f2

Please sign in to comment.