Skip to content

Commit

Permalink
Merge branch 'Leuchtfeuer:mautic5-support' into mautic5-support
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasLudwig1998 authored Oct 17, 2024
2 parents 8ec4052 + 691832d commit 48ea0c5
Show file tree
Hide file tree
Showing 24 changed files with 138 additions and 150 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Continous Integration
on:
push:
branches:
- master
- mautic5-support
- '[0-9]+\-[0-9]+\-x'
pull_request:

Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
php-version: [ 8.0 ]
php-version: [ 8.1 ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -23,4 +23,4 @@ jobs:
- name: Install composer requirements.
run: composer install
- name: Check PHP CS
run: ./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php --dry-run --using-cache no --show-progress dots -v
run: ./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php --dry-run --using-cache no --show-progress dots -v
2 changes: 1 addition & 1 deletion Api/GototrainingApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GototrainingApi
use GoToApi;

public function __construct(
private GototrainingIntegration $integration
private GototrainingIntegration $integration
) {
}

Expand Down
2 changes: 1 addition & 1 deletion Api/GotowebinarApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(
*
* @throws ApiErrorException
*/
public function request(string $operation, array $parameters = [], string $method = 'GET', string $organizerKey = null): mixed
public function request(string $operation, array $parameters = [], string $method = 'GET', ?string $organizerKey = null): mixed
{
$settings = [
'module' => 'G2W',
Expand Down
3 changes: 0 additions & 3 deletions Command/SyncCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ protected function configure(): void
parent::configure();
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$options = $input->getOptions();
Expand Down
3 changes: 0 additions & 3 deletions Entity/GoToEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ public function setEventType(string $eventType): static
return $this;
}

/**
* @param mixed $joinUrl
*/
public function setJoinUrl($joinUrl): void
{
$this->joinUrl = $joinUrl;
Expand Down
8 changes: 2 additions & 6 deletions Entity/GoToEventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ class GoToEventRepository extends CommonRepository
/**
* Fetch the base event data from the database.
*
* @return mixed
*
* @throws \InvalidArgumentException
*/
public function getEvents(string $product, string $eventType, \DateTime $fromDate = null)
public function getEvents(string $product, string $eventType, ?\DateTime $fromDate = null)
{
$q = $this->createQueryBuilder('c');

Expand Down Expand Up @@ -50,7 +48,7 @@ public function getEvents(string $product, string $eventType, \DateTime $fromDat
*
* @return mixed[]
*/
public function getEventsForTimeline(mixed $product, int $leadId = null, array $options = []): array
public function getEventsForTimeline(mixed $product, ?int $leadId = null, array $options = []): array
{
$eventType = null;
if (is_array($product)) {
Expand Down Expand Up @@ -160,7 +158,6 @@ public function getEntities(array $args = []): Paginator

/**
* @param QueryBuilder|\Doctrine\DBAL\Query\QueryBuilder $qb
* @param mixed $filter
*
* @return mixed[]
*/
Expand All @@ -172,7 +169,6 @@ protected function addCatchAllWhereClause($qb, $filter): array

/**
* @param QueryBuilder|\Doctrine\DBAL\Query\QueryBuilder $q
* @param mixed $filter
*
* @return mixed[]
*/
Expand Down
18 changes: 0 additions & 18 deletions Entity/GoToProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,49 +44,31 @@ public static function loadMetadata(ClassMetadata $metadata): void
$builder->addNamedField('status', 'text', 'status', true);
}

/**
* @return mixed
*/
public function getId()
{
return $this->id;
}

/**
* @param mixed $id
*/
public function setId($id): void
{
$this->id = $id;
}

/**
* @return mixed
*/
public function getProductKey()
{
return $this->product_key;
}

/**
* @param mixed $product_key
*/
public function setProductKey($product_key): void
{
$this->product_key = $product_key;
}

/**
* @return mixed
*/
public function getOrganizerKey()
{
return $this->organizer_key;
}

/**
* @param mixed $organizer_key
*/
public function setOrganizerKey($organizer_key): void
{
$this->organizer_key = $organizer_key;
Expand Down
4 changes: 2 additions & 2 deletions Entity/GoToProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getFutureProducts(): mixed
/**
* @throws \Exception
*/
public function getProductsBetweenSpecificDates(\DateTime $from = null, \DateTime $to = null): mixed
public function getProductsBetweenSpecificDates(?\DateTime $from = null, ?\DateTime $to = null): mixed
{
if (null === $to) {
$to = new \DateTime('now + 50 years');
Expand All @@ -81,7 +81,7 @@ public function getProductsBetweenSpecificDates(\DateTime $from = null, \DateTim
$from = new \DateTime('now - 10 years');
}

$qb = $this->createQueryBuilder('e');
$qb = $this->createQueryBuilder('e');
$expr = $qb->expr();
$qb
->andWhere('e.date BETWEEN :from AND :to')
Expand Down
12 changes: 6 additions & 6 deletions EventListener/FormSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function getSubscribedEvents(): array
/**
* @throws ValidationException
*/
private function _doRegistration(SubmissionEvent $event, string $product, string $startType = null): void
private function _doRegistration(SubmissionEvent $event, string $product, ?string $startType = null): void
{
$submission = $event->getSubmission();
$form = $submission->getForm();
Expand Down Expand Up @@ -224,11 +224,11 @@ public function onAssistRemote(SubmissionEvent $event): void
public function onResponse(PluginIntegrationRequestEvent $event): void
{
// /** @var Response $response */
// $response = $event->getResponse();
// $this->goToHelper->log(
// PHP_EOL. //$response->getStatusCode() . ' ' .
// print_r($response, true)
// );
// $response = $event->getResponse();
// $this->goToHelper->log(
// PHP_EOL. //$response->getStatusCode() . ' ' .
// print_r($response, true)
// );
}

/**
Expand Down
1 change: 0 additions & 1 deletion EventListener/LeadSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use MauticPlugin\LeuchtfeuerGoToBundle\Helper\GoToHelper;
use MauticPlugin\LeuchtfeuerGoToBundle\Helper\GoToProductTypes;
use MauticPlugin\LeuchtfeuerGoToBundle\Model\GoToModel;
use MauticPlugin\MauticSocialBundle\Entity\Lead;
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand Down
3 changes: 0 additions & 3 deletions EventListener/PluginEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ public function __construct(Connection $connection, LoggerInterface $logger)
$this->logger = $logger;
}

/**
* {@inheritDoc}
*/
public static function getSubscribedEvents(): array
{
return [
Expand Down
26 changes: 12 additions & 14 deletions Form/Type/GoToActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public function __construct(
}

/**
* {@inheritdoc}
*
* @throws ServiceCircularReferenceException
* @throws ServiceNotFoundException
* @throws ConstraintDefinitionException
Expand All @@ -44,9 +42,9 @@ public function __construct(
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
if (!(array_key_exists('attr', $options) && array_key_exists('data-product', $options['attr'])) ||
!GoToProductTypes::isValidValue($options['attr']['data-product']) ||
!$this->goToHelper->isAuthorized('Goto'.$options['attr']['data-product'])
if (!(array_key_exists('attr', $options) && array_key_exists('data-product', $options['attr']))
|| !GoToProductTypes::isValidValue($options['attr']['data-product'])
|| !$this->goToHelper->isAuthorized('Goto'.$options['attr']['data-product'])
) {
return;
}
Expand Down Expand Up @@ -76,9 +74,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
$choices[$f['id']] = $f['label'];
}

if (array_key_exists('data-product-action', $options['attr']) &&
('register' === $options['attr']['data-product-action'] ||
'start' === $options['attr']['data-product-action'])
if (array_key_exists('data-product-action', $options['attr'])
&& ('register' === $options['attr']['data-product-action']
|| 'start' === $options['attr']['data-product-action'])
) {
$products = [
'form' => 'User selection from form',
Expand Down Expand Up @@ -108,9 +106,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
);
}

if (array_key_exists('data-product-action', $options['attr']) &&
('register' === $options['attr']['data-product-action'] ||
'screensharing' === $options['attr']['data-product-action'])
if (array_key_exists('data-product-action', $options['attr'])
&& ('register' === $options['attr']['data-product-action']
|| 'screensharing' === $options['attr']['data-product-action'])
) {
$builder->add(
'firstname',
Expand Down Expand Up @@ -196,9 +194,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
]
);

if (array_key_exists('data-product-action', $options['attr']) &&
('start' === $options['attr']['data-product-action'] ||
'screensharing' === $options['attr']['data-product-action'])
if (array_key_exists('data-product-action', $options['attr'])
&& ('start' === $options['attr']['data-product-action']
|| 'screensharing' === $options['attr']['data-product-action'])
) {
$defaultOptions = [
'label' => 'plugin.citrix.emailtemplate',
Expand Down
2 changes: 0 additions & 2 deletions Form/Type/GoToCampaignActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public function __construct(
}

/**
* {@inheritdoc}
*
* @throws ServiceCircularReferenceException
* @throws ServiceNotFoundException
* @throws \InvalidArgumentException
Expand Down
2 changes: 0 additions & 2 deletions Form/Type/GoToCampaignEventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public function __construct(
}

/**
* {@inheritdoc}
*
* @throws ServiceCircularReferenceException
* @throws ServiceNotFoundException
* @throws \InvalidArgumentException
Expand Down
5 changes: 0 additions & 5 deletions Form/Type/GoToListType.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public function __construct(private GoToModel $citrixModel)
{
}

/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$selectMessage = 'Please Select...';
Expand Down Expand Up @@ -222,8 +219,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
}

/**
* {@inheritdoc}
*
* @throws AccessException
*/
public function configureOptions(OptionsResolver $resolver): void
Expand Down
3 changes: 0 additions & 3 deletions Helper/BasicEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public static function isValidName(string $name, bool $strict = false): bool
return in_array(strtolower($name), $keys, true);
}

/**
* @param mixed $value
*/
public static function isValidValue($value, bool $strict = true): bool
{
$values = array_values(self::getConstants());
Expand Down
11 changes: 0 additions & 11 deletions Helper/GoToHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,6 @@ public function getCleanString(string $str, int $limit = 20): string
}

/**
* @param mixed $productId
* @param mixed $email
* @param mixed $firstname
* @param mixed $lastname
* @param mixed $company
*
* @throws BadRequestHttpException
*/
public function registerToProduct(string $product, $productId, $email, $firstname, $lastname, $company): bool
Expand Down Expand Up @@ -287,11 +281,6 @@ public function registerToProduct(string $product, $productId, $email, $firstnam
}

/**
* @param mixed $productId
* @param mixed $email
* @param mixed $firstname
* @param mixed $lastname
*
* @throws BadRequestHttpException
*/
public function startToProduct(string $product, $productId, $email, $firstname, $lastname): bool|string
Expand Down
Loading

0 comments on commit 48ea0c5

Please sign in to comment.