Skip to content

Commit

Permalink
BAP-22772: Use override attribute instead of inheritdoc annotations (…
Browse files Browse the repository at this point in the history
…#39344)

- Updated php-cs-fixer config
- Applied new cs rules
- Deleted annotations like "{@inheritdoc}"
- Rector AddOverrideAttributeToOverriddenMethodsRector rule applied
- Updated documentation
  • Loading branch information
OleksandrProtsiuk authored Sep 24, 2024
1 parent b94419d commit 0249850
Show file tree
Hide file tree
Showing 246 changed files with 421 additions and 843 deletions.
8 changes: 2 additions & 6 deletions Autocomplete/AttendeeSearchHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class AttendeeSearchHandler extends ContextSearchHandler
/** @var AttendeeManager */
protected $attendeeManager;

/**
* {@inheritdoc}
*/
#[\Override]
protected function convertItems(array $items)
{
$groupped = $this->groupIdsByEntityName($items);
Expand Down Expand Up @@ -67,9 +65,7 @@ protected function groupIdsByEntityName(array $items)
return $groupped;
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function getSearchAliases()
{
return ['oro_user'];
Expand Down
16 changes: 4 additions & 12 deletions Autocomplete/UserCalendarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public function __construct(
$this->aclHelper = $aclHelper;
}

/**
* {@inheritDoc}
*/
#[\Override]
public function search($query, $page, $perPage, $searchById = false)
{
[$search, $entityClass, $permission, $entityId, $excludeCurrentUser] = explode(';', $query);
Expand Down Expand Up @@ -100,25 +98,19 @@ public function search($query, $page, $perPage, $searchById = false)
];
}

/**
* {@inheritDoc}
*/
#[\Override]
public function getProperties()
{
return ['id'];
}

/**
* {@inheritDoc}
*/
#[\Override]
public function getEntityName()
{
return Calendar::class;
}

/**
* {@inheritDoc}
*/
#[\Override]
public function convertItem($item)
{
/** @var Calendar $item */
Expand Down
4 changes: 1 addition & 3 deletions Controller/AjaxCalendarEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ public function attendeesAutocompleteDataAction($id)
]);
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
7 changes: 4 additions & 3 deletions Controller/Api/Rest/CalendarConnectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function deleteAction($id)
/**
* @return CalendarPropertyApiEntityManager
*/
#[\Override]
public function getManager()
{
return $this->container->get('oro_calendar.calendar_property.manager.api');
Expand All @@ -104,6 +105,7 @@ public function getManager()
/**
* @return Form
*/
#[\Override]
public function getForm()
{
return $this->container->get('oro_calendar.calendar_property.form.api');
Expand All @@ -112,14 +114,13 @@ public function getForm()
/**
* @return ApiFormHandler
*/
#[\Override]
public function getFormHandler()
{
return $this->container->get('oro_calendar.calendar_property.form.handler.api');
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function fixFormData(array &$data, $entity)
{
parent::fixFormData($data, $entity);
Expand Down
1 change: 1 addition & 0 deletions Controller/Api/Rest/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function getDefaultAction()
return new Response(json_encode($result), Response::HTTP_OK);
}

#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
19 changes: 7 additions & 12 deletions Controller/Api/Rest/CalendarEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public function deleteAction(int $id)
/**
* @return ApiEntityManager
*/
#[\Override]
public function getManager()
{
return $this->container->get('oro_calendar.calendar_event.manager.api');
Expand All @@ -309,6 +310,7 @@ public function getManager()
/**
* @return Form
*/
#[\Override]
public function getForm()
{
return $this->container->get('oro_calendar.calendar_event.form.api');
Expand All @@ -317,14 +319,13 @@ public function getForm()
/**
* @return ApiFormHandler
*/
#[\Override]
public function getFormHandler()
{
return $this->container->get('oro_calendar.calendar_event.form.handler.api');
}

/**
* {@inheritdoc}
*/
#[\Override]
public function handleUpdateRequest($id)
{
/** @var CalendarEvent $entity */
Expand All @@ -350,9 +351,7 @@ public function handleUpdateRequest($id)
return $this->buildResponse($view, self::ACTION_UPDATE, ['id' => $id, 'entity' => $entity]);
}

/**
* {@inheritdoc}
*/
#[\Override]
public function handleCreateRequest($_ = null)
{
$isProcessed = false;
Expand All @@ -375,9 +374,7 @@ public function handleCreateRequest($_ = null)
return $this->buildResponse($view, self::ACTION_CREATE, ['success' => $isProcessed, 'entity' => $entity]);
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function fixFormData(array &$data, $entity)
{
parent::fixFormData($data, $entity);
Expand Down Expand Up @@ -420,9 +417,7 @@ function (ConfigInterface $config) {
);
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function createResponseData($entity)
{
$response = parent::createResponseData($entity);
Expand Down
12 changes: 3 additions & 9 deletions Controller/Api/Rest/SystemCalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,20 @@ public function deleteAction(int $id)
return $this->handleDeleteRequest($id);
}

/**
* {@inheritdoc}
*/
#[\Override]
public function getManager()
{
return $this->container->get('oro_calendar.system_calendar.manager.api');
}

/**
* {@inheritdoc}
*/
#[\Override]
public function getForm()
{
throw new \BadMethodCallException('Not implemented');
//return $this->container->get('oro_calendar.system_calendar.form.api');
}

/**
* {@inheritdoc}
*/
#[\Override]
public function getFormHandler()
{
throw new \BadMethodCallException('Not implemented');
Expand Down
4 changes: 1 addition & 3 deletions Controller/AutocompleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ public function autocompleteAttendeesAction(Request $request)
));
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
4 changes: 1 addition & 3 deletions Controller/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ public function viewAction(Calendar $calendar)
];
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
4 changes: 1 addition & 3 deletions Controller/CalendarEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ protected function checkPermissionByParentCalendar(CalendarEvent $entity, $actio
}
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
4 changes: 1 addition & 3 deletions Controller/Dashboard/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ public function myCalendarAction($widget)
);
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(parent::getSubscribedServices(), [
Expand Down
4 changes: 1 addition & 3 deletions Controller/SystemCalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ private function isSystemCalendarManagementEnabled(): bool
return $this->isGranted('oro_system_calendar_management');
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
4 changes: 1 addition & 3 deletions Controller/SystemCalendarEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ protected function getCalendarConfig(): SystemCalendarConfig
return $this->container->get(SystemCalendarConfig::class);
}

/**
* {@inheritdoc}
*/
#[\Override]
public static function getSubscribedServices(): array
{
return array_merge(
Expand Down
4 changes: 1 addition & 3 deletions Datagrid/MassAction/DeleteMassActionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ public function setDeleteManager(DeleteManager $deleteManager): void
$this->deleteManager = $deleteManager;
}

/**
* {@inheritDoc}
*/
#[\Override]
protected function processDelete(object $entity, EntityManagerInterface $manager): void
{
/** @var CalendarEvent $entity */
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Compiler/CalendarProviderPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class CalendarProviderPass implements CompilerPassInterface
{
use PriorityTaggedLocatorTrait;

/**
* {@inheritdoc}
*/
#[\Override]
public function process(ContainerBuilder $container): void
{
$tagName = 'oro_calendar.calendar_provider';
Expand Down
16 changes: 4 additions & 12 deletions DependencyInjection/Compiler/TwigSandboxConfigurationPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
*/
class TwigSandboxConfigurationPass extends AbstractTwigSandboxConfigurationPass
{
/**
* {@inheritdoc}
*/
#[\Override]
protected function getFunctions(): array
{
return [
Expand All @@ -24,25 +22,19 @@ protected function getFunctions(): array
];
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function getFilters(): array
{
return [];
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function getTags(): array
{
return [];
}

/**
* {@inheritdoc}
*/
#[\Override]
protected function getExtensions(): array
{
return [
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
#[\Override]
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('oro_calendar');
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/OroCalendarExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

class OroCalendarExtension extends Extension
{
/**
* {@inheritDoc}
*/
#[\Override]
public function load(array $configs, ContainerBuilder $container): void
{
$config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs);
Expand Down
2 changes: 2 additions & 0 deletions Entity/Attendee.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function getId()
/**
* @return string
*/
#[\Override]
public function getEmail()
{
return $this->email;
Expand Down Expand Up @@ -237,6 +238,7 @@ public function preUpdate()
/**
* @return string
*/
#[\Override]
public function __toString()
{
return (string) $this->displayName;
Expand Down
1 change: 1 addition & 0 deletions Entity/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function __construct()
/**
* @return string
*/
#[\Override]
public function __toString()
{
return empty($this->name)
Expand Down
Loading

0 comments on commit 0249850

Please sign in to comment.