Skip to content

Commit

Permalink
Remove superfluous PHPDoc (pimcore#15282)
Browse files Browse the repository at this point in the history
* Remove superfluous phpdoc

* Remove useless {@inheritdoc}

* Manually remove some more useless {@inheritdoc}

* Manually remove broken/invalid {@inheritdoc}

* Make PHPStan happy
  • Loading branch information
jdreesen authored Jun 15, 2023
1 parent dd654dd commit 68f198d
Show file tree
Hide file tree
Showing 749 changed files with 25 additions and 7,217 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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
55 changes: 0 additions & 55 deletions bundles/ApplicationLoggerBundle/src/ApplicationLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public function setComponent(string $component): void
}

/**
* @param FileObject|string $fileObject
*
* @deprecated
*
Expand All @@ -89,7 +88,6 @@ public function setFileObject(FileObject|string $fileObject): void
}

/**
* @param \Pimcore\Model\Asset|int|\Pimcore\Model\Document|\Pimcore\Model\DataObject\AbstractObject $relatedObject
*
* @deprecated
*/
Expand All @@ -108,11 +106,6 @@ public function setRelatedObject(\Pimcore\Model\Asset|int|\Pimcore\Model\Documen
}
}

/**
* {@inheritdoc}
*
* @return void
*/
public function log($level, $message, array $context = []): void
{
if (!isset($context['component'])) {
Expand Down Expand Up @@ -165,7 +158,6 @@ public function log($level, $message, array $context = []): void
/**
* Resolve logging source
*
* @return string
*/
protected function resolveLoggingSource(): string
{
Expand Down Expand Up @@ -229,81 +221,41 @@ protected function resolveLoggingSource(): string
return $source;
}

/**
* {@inheritdoc}
*
* @return void
*/
public function emergency($message, array $context = []): void
{
$this->handleLog('emergency', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function critical($message, array $context = []): void
{
$this->handleLog('critical', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function error($message, array $context = []): void
{
$this->handleLog('error', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function alert($message, array $context = []): void
{
$this->handleLog('alert', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function warning($message, array $context = []): void
{
$this->handleLog('warning', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function notice($message, array $context = []): void
{
$this->handleLog('notice', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function info($message, array $context = []): void
{
$this->handleLog('info', $message, func_get_args());
}

/**
* {@inheritdoc}
*
* @return void
*/
public function debug($message, array $context = []): void
{
$this->handleLog('debug', $message, func_get_args());
Expand Down Expand Up @@ -337,13 +289,6 @@ protected function handleLog(mixed $level, string $message, array $params): void
$this->log($level, $message, $context);
}

/**
* @param string $message
* @param \Throwable $exceptionObject
* @param string|null $priority
* @param \Pimcore\Model\DataObject\AbstractObject|null $relatedObject
* @param string|null $component
*/
public function logException(string $message, \Throwable $exceptionObject, ?string $priority = 'alert', \Pimcore\Model\DataObject\AbstractObject $relatedObject = null, string $component = null): void
{
if (is_null($priority)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ private function parseDateObject(?string $date, ?string $time): ?\DateTime
/**
* @Route("/log/priority-json", name="pimcore_admin_bundle_applicationlogger_log_priorityjson", methods={"GET"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function priorityJsonAction(Request $request): JsonResponse
{
Expand All @@ -190,9 +188,7 @@ public function priorityJsonAction(Request $request): JsonResponse
/**
* @Route("/log/component-json", name="pimcore_admin_bundle_applicationlogger_log_componentjson", methods={"GET"})
*
* @param Request $request
*
* @return JsonResponse
*/
public function componentJsonAction(Request $request): JsonResponse
{
Expand Down
4 changes: 0 additions & 4 deletions bundles/ApplicationLoggerBundle/src/FileObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ final class FileObject

protected string $data;

/**
* @param string $data
* @param string|null $filename
*/
public function __construct(string $data, string $filename = null)
{
$this->data = $data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public function __construct(Connection $db, Config $config, LoggerInterface $log
$this->logger = $logger;
}

/**
* {@inheritdoc}
*/
public function execute(): void
{
$db = $this->db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function __construct(Connection $db, Config $config)
$this->config = $config;
}

/**
* {@inheritdoc}
*/
public function execute(): void
{
$db = $this->db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ protected function configure(): void
);
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$conditionVariables = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ protected function configure(): void
);
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$conditions = ['customSettings LIKE ?'];
Expand Down
3 changes: 0 additions & 3 deletions bundles/CoreBundle/src/Command/Bundle/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ protected function configure(): void
PostStateChange::configureStateChangeCommandOptions($this);
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$bundle = $this->getBundle();
Expand Down
3 changes: 0 additions & 3 deletions bundles/CoreBundle/src/Command/Bundle/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ protected function configure(): void
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$details = $input->getOption('details');
Expand Down
3 changes: 0 additions & 3 deletions bundles/CoreBundle/src/Command/Bundle/UninstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ protected function configure(): void
PostStateChange::configureStateChangeCommandOptions($this);
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$bundle = $this->getBundle();
Expand Down
3 changes: 0 additions & 3 deletions bundles/CoreBundle/src/Command/CacheClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ protected function configure(): void
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
Expand Down
12 changes: 0 additions & 12 deletions bundles/CoreBundle/src/Command/CacheWarmingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ protected function configure(): void
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
if ($input->getOption('maintenance-mode')) {
Expand Down Expand Up @@ -162,11 +159,7 @@ protected function writeWarmingMessage(string $type, array $types, string $extra
/**
* A,B,C -> A, B or C (with an optional template for each item)
*
* @param array $list
* @param string $glue
* @param string|null $template
*
* @return string
*/
protected function humanList(array $list, string $glue = 'or', string $template = null): string
{
Expand All @@ -189,12 +182,7 @@ protected function humanList(array $list, string $glue = 'or', string $template
* Get one of types, document, asset or object types, handle "all" value
* and list input validation.
*
* @param string $option
* @param string $property
* @param string $singular
* @param bool $fallback
*
* @return mixed
*/
protected function getArrayOption(string $option, string $property, string $singular, bool $fallback = false): mixed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ protected function configure(): void
);
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$objectClassesFolders = array_unique([PIMCORE_CLASS_DEFINITION_DIRECTORY, PIMCORE_CUSTOM_CONFIGURATION_CLASS_DEFINITION_DIRECTORY]);
Expand Down
3 changes: 0 additions & 3 deletions bundles/CoreBundle/src/Command/ClassesRebuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ public function setClassDefinitionManager(ClassDefinitionManager $classDefinitio
$this->classDefinitionManager = $classDefinitionManager;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
if ($input->getOption('delete-classes')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ protected function configure(): void
$this->configureDryRunOption();
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$path = $this->getPath();
Expand Down Expand Up @@ -117,7 +114,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/**
* Validate and return path to JSON file
*
* @return string
*/
protected function getPath(): string
{
Expand All @@ -132,7 +128,6 @@ protected function getPath(): string
/**
* Load JSON data from file
*
* @param string $path
*
* @return string|false
*/
Expand All @@ -154,9 +149,7 @@ protected function getJson(string $path): bool|string
/**
* Ask for confirmation before overwriting
*
* @param string $name
*
* @return bool
*/
protected function askConfirmation(string $name): bool
{
Expand All @@ -177,44 +170,34 @@ protected function askConfirmation(string $name): bool
/**
* Get type
*
* @return string
*/
abstract protected function getType(): string;

/**
* Get definition name from filename (e.g. class_Customer_export.json -> Customer)
*
* @param string $filename
*
* @return string|null
*/
abstract protected function getDefinitionName(string $filename): ?string;

/**
* Try to load definition by name
*
* @param string $name
*
* @return AbstractModel|null
*/
abstract protected function loadDefinition(string $name): ?AbstractModel;

/**
* Create a new definition
*
* @param string $name
*
* @return AbstractModel|null
*/
abstract protected function createDefinition(string $name): ?AbstractModel;

/**
* Process import
*
* @param AbstractModel $definition
* @param string $json
*
* @return bool
*/
abstract protected function import(AbstractModel $definition, string $json): bool;
}
Loading

0 comments on commit 68f198d

Please sign in to comment.