Skip to content

Commit

Permalink
Merge PR #27 from @zonky2
Browse files Browse the repository at this point in the history
Set options array to nullable for check if options set.
  • Loading branch information
stefanheimes committed Feb 15, 2024
2 parents f3888c9 + a32317e commit a4994cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .phpcq.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ phpcq:
- D2CCAC42F6295E7D
# PHP_CodeSniffer
- 31C7E470E2138192
- 9093F8B32E4815AA
- 5E6DDE998AB73B8E
# Composer normalize
- C00543248C87FB13
# phpmd
Expand Down
45 changes: 21 additions & 24 deletions src/Event/GetOptionsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of menatwork/contao-multicolumnwizard-bundle.
*
* (c) 2012-2019 MEN AT WORK.
* (c) 2012-2024 MEN AT WORK.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -14,9 +14,10 @@
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Fritz Michael Gschwantner <fmg@inspiredminds.at>
* @author Ingolf Steinhardt <info@e-spin.de>
* @copyright 2011 Andreas Schempp
* @copyright 2011 certo web & design GmbH
* @copyright 2013-2019 MEN AT WORK
* @copyright 2013-2024 MEN AT WORK
* @license https://github.com/menatwork/contao-multicolumnwizard-bundle/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand All @@ -26,6 +27,7 @@
use ContaoCommunityAlliance\DcGeneral\Data\ModelInterface;
use ContaoCommunityAlliance\DcGeneral\EnvironmentInterface;
use MenAtWork\MultiColumnWizardBundle\Contao\Widgets\MultiColumnWizard as BundleMultiColumnWizard;
use MultiColumnWizard;
use Symfony\Contracts\EventDispatcher\Event;

/**
Expand All @@ -39,7 +41,7 @@ class GetOptionsEvent extends Event
public const NAME = 'men-at-work.multi-column-wizard-bundle.get-options';

/**
* The name of the multi column wizard.
* The name of the multi-column wizard.
*
* @var string
*/
Expand Down Expand Up @@ -67,41 +69,36 @@ class GetOptionsEvent extends Event
protected $model;

/**
* The multi column wizard.
* The multi-column wizard.
*
* @var \MultiColumnWizard
* @var MultiColumnWizard
*/
protected $widget;

/**
* The options array.
*
* @var array
* @var array|null
*/
protected $options;

/**
* Create a new instance.
*
* @param string $propertyName The name of the multi column wizard widget.
*
* @param string $subPropertyName The name of the sub widget.
*
* @param EnvironmentInterface $environment The environment instance.
*
* @param ModelInterface $model The current model.
*
* @param \MultiColumnWizard|BundleMultiColumnWizard $widget The multi column wizard instance.
*
* @param array $options The current options (defaults to empty array).
* @param string $propertyName The name of the multi-column wizard widget.
* @param string $subPropertyName The name of the sub widget.
* @param EnvironmentInterface $environment The environment instance.
* @param ModelInterface $model The current model.
* @param MultiColumnWizard|BundleMultiColumnWizard $widget The multi-column wizard instance.
* @param array|null $options The current options (defaults to empty array).
*/
public function __construct(
$propertyName,
$subPropertyName,
EnvironmentInterface $environment,
ModelInterface $model,
$widget,
$options = array()
$options = []
) {
$this->propertyName = $propertyName;
$this->subPropertyName = $subPropertyName;
Expand All @@ -112,7 +109,7 @@ public function __construct(
}

/**
* Retrieve the name of the multi column wizard property.
* Retrieve the name of the multi-column wizard property.
*
* @return string
*/
Expand All @@ -122,7 +119,7 @@ public function getPropertyName()
}

/**
* Retrieve the name of the property within the multi column wizard.
* Retrieve the name of the property within the multi-column wizard.
*
* @return string
*/
Expand Down Expand Up @@ -152,9 +149,9 @@ public function getModel()
}

/**
* Retrieve the multi column wizard instance emitting the event.
* Retrieve the multi-column wizard instance emitting the event.
*
* @return \MultiColumnWizard
* @return MultiColumnWizard
*/
public function getWidget()
{
Expand All @@ -164,7 +161,7 @@ public function getWidget()
/**
* Retrieve the options.
*
* @return array
* @return array|null
*/
public function getOptions()
{
Expand All @@ -174,7 +171,7 @@ public function getOptions()
/**
* Set the options.
*
* @param array $options The options.
* @param array|null $options The options.
*
* @return GetOptionsEvent
*/
Expand Down

0 comments on commit a4994cf

Please sign in to comment.