style: fix indentation, alignment, and docblock annotations
- Correct getChoices() docblock to reflect translated label => enum backing value order instead of value => label - Re-indent Smart Links menu config to match actual array nesting - Align assignment operators in RefreshStatsCommand - Add missing newline at end of RefreshStatsCommand.php
This commit is contained in:
1 parent
07773acb8d
commit
b138056e43
90 files changed
+622
-272
No files matched your search
@@ -103,13 +103,18 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
/**
|
||||
* Never save the slug of an existing link: it is immutable once created. The field is
|
||||
* disabled in the form, so nothing is submitted for it, this is a safety net.
|
||||
*
|
||||
* @param SmartLink $entity
|
||||
* @param string $action
|
||||
* @param int|null $objectId
|
||||
* @param bool $isClone
|
||||
*/
|
||||
protected function beforeEntitySave($entity, Form $form, $action, $objectId = null, $isClone = false): bool
|
||||
{
|
||||
if ($entity instanceof SmartLink && null !== $entity->getId()) {
|
||||
$formSlug = $form->has('slug') ? (string) $form->get('slug')->getData() : '';
|
||||
if ('' !== $formSlug && $formSlug !== (string) $entity->getSlug()) {
|
||||
$this->addFlashMessage('mt3s.smart_links.smart_links.error.slug_immutable', ['%slug%' => $formSlug], \Mautic\CoreBundle\FlashBag::LEVEL_ERROR);
|
||||
$this->addFlashMessage('mt3s.smart_links.smart_links.error.slug_immutable', ['%slug%' => $formSlug], \Mautic\CoreBundle\Service\FlashBag::LEVEL_ERROR);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -123,6 +128,7 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
* also displayed above the form of a link), and the number of hits of each link.
|
||||
*
|
||||
* @param array<string, mixed> $args
|
||||
* @param string $action
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
@@ -134,7 +140,7 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
$model = $this->getModel($this->getModelName());
|
||||
\assert($model instanceof SmartLinkModel);
|
||||
|
||||
$args['viewParameters']['shortLinkDomain'] = $model->getShortLinkDomain();
|
||||
$args['viewParameters']['shortLinkDomain'] = $model->getShortLinkDomain();
|
||||
$args['viewParameters']['hitCounts'] = $model->getHitCounts();
|
||||
}
|
||||
|
||||
@@ -151,6 +157,8 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
|
||||
/**
|
||||
* Smart Links don't have a detail page; after Save or Cancel go back to the list.
|
||||
*
|
||||
* @param string $action
|
||||
*/
|
||||
protected function getPostActionControllerAction($action): string
|
||||
{
|
||||
@@ -159,9 +167,11 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
|
||||
/**
|
||||
* A saved Smart Link is never cloned: its slug is immutable, and a clone would need a new one.
|
||||
*
|
||||
* @param int|null $objectId
|
||||
*/
|
||||
public function cloneAction(Request $request, $objectId): Response
|
||||
{
|
||||
$this->accessDenied();
|
||||
$this->throwAccessDenied();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user