login consent app sql
This commit is contained in:
47
vendor/symfony/form/ChoiceList/View/ChoiceGroupView.php
vendored
Normal file
47
vendor/symfony/form/ChoiceList/View/ChoiceGroupView.php
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\ChoiceList\View;
|
||||
|
||||
/**
|
||||
* Represents a group of choices in templates.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*
|
||||
* @implements \IteratorAggregate<array-key, ChoiceGroupView|ChoiceView>
|
||||
*/
|
||||
class ChoiceGroupView implements \IteratorAggregate
|
||||
{
|
||||
public $label;
|
||||
public $choices;
|
||||
|
||||
/**
|
||||
* Creates a new choice group view.
|
||||
*
|
||||
* @param array<array-key, ChoiceGroupView|ChoiceView> $choices the choice views in the group
|
||||
*/
|
||||
public function __construct(string $label, array $choices = [])
|
||||
{
|
||||
$this->label = $label;
|
||||
$this->choices = $choices;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return \Traversable<array-key, ChoiceGroupView|ChoiceView>
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getIterator()
|
||||
{
|
||||
return new \ArrayIterator($this->choices);
|
||||
}
|
||||
}
|
59
vendor/symfony/form/ChoiceList/View/ChoiceListView.php
vendored
Normal file
59
vendor/symfony/form/ChoiceList/View/ChoiceListView.php
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\ChoiceList\View;
|
||||
|
||||
/**
|
||||
* Represents a choice list in templates.
|
||||
*
|
||||
* A choice list contains choices and optionally preferred choices which are
|
||||
* displayed in the very beginning of the list. Both choices and preferred
|
||||
* choices may be grouped in {@link ChoiceGroupView} instances.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class ChoiceListView
|
||||
{
|
||||
public $choices;
|
||||
public $preferredChoices;
|
||||
|
||||
/**
|
||||
* Creates a new choice list view.
|
||||
*
|
||||
* @param ChoiceGroupView[]|ChoiceView[] $choices The choice views
|
||||
* @param ChoiceGroupView[]|ChoiceView[] $preferredChoices the preferred choice views
|
||||
*/
|
||||
public function __construct(array $choices = [], array $preferredChoices = [])
|
||||
{
|
||||
$this->choices = $choices;
|
||||
$this->preferredChoices = $preferredChoices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether a placeholder is in the choices.
|
||||
*
|
||||
* A placeholder must be the first child element, not be in a group and have an empty value.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPlaceholder()
|
||||
{
|
||||
if ($this->preferredChoices) {
|
||||
$firstChoice = reset($this->preferredChoices);
|
||||
|
||||
return $firstChoice instanceof ChoiceView && '' === $firstChoice->value;
|
||||
}
|
||||
|
||||
$firstChoice = reset($this->choices);
|
||||
|
||||
return $firstChoice instanceof ChoiceView && '' === $firstChoice->value;
|
||||
}
|
||||
}
|
54
vendor/symfony/form/ChoiceList/View/ChoiceView.php
vendored
Normal file
54
vendor/symfony/form/ChoiceList/View/ChoiceView.php
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\ChoiceList\View;
|
||||
|
||||
use Symfony\Component\Translation\TranslatableMessage;
|
||||
|
||||
/**
|
||||
* Represents a choice in templates.
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class ChoiceView
|
||||
{
|
||||
public $label;
|
||||
public $value;
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* Additional attributes for the HTML tag.
|
||||
*/
|
||||
public $attr;
|
||||
|
||||
/**
|
||||
* Additional parameters used to translate the label.
|
||||
*/
|
||||
public $labelTranslationParameters;
|
||||
|
||||
/**
|
||||
* Creates a new choice view.
|
||||
*
|
||||
* @param mixed $data The original choice
|
||||
* @param string $value The view representation of the choice
|
||||
* @param string|TranslatableMessage|false $label The label displayed to humans; pass false to discard the label
|
||||
* @param array $attr Additional attributes for the HTML tag
|
||||
* @param array $labelTranslationParameters Additional parameters used to translate the label
|
||||
*/
|
||||
public function __construct($data, string $value, $label, array $attr = [], array $labelTranslationParameters = [])
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->value = $value;
|
||||
$this->label = $label;
|
||||
$this->attr = $attr;
|
||||
$this->labelTranslationParameters = $labelTranslationParameters;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user