Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Remove group options without data on debug:form command #25404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ protected function collectOptions(ResolvedFormTypeInterface $type)
}

$this->overriddenOptions = array_filter($this->overriddenOptions);
$this->parentOptions = array_filter($this->parentOptions);
$this->extensionOptions = array_filter($this->extensionOptions);
$this->requiredOptions = $optionsResolver->getRequiredOptions();

$this->parents = array_keys($this->parents);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,32 @@ protected function describeOption(OptionsResolver $optionsResolver, array $optio

private function normalizeAndSortOptionsColumns(array $options)
{
foreach ($options as $group => &$opts) {
foreach ($options as $group => $opts) {
$sorted = false;
foreach ($opts as $class => $opt) {
if (is_string($class)) {
unset($options[$group][$class]);
}

if (!is_array($opt) || 0 === count($opt)) {
continue;
}

unset($opts[$class]);

if (!$sorted) {
$opts = array();
$options[$group] = array();
} else {
$opts[] = null;
$options[$group][] = null;
}
$opts[] = sprintf('<info>%s</info>', (new \ReflectionClass($class))->getShortName());
$opts[] = new TableSeparator();
$options[$group][] = sprintf('<info>%s</info>', (new \ReflectionClass($class))->getShortName());
$options[$group][] = new TableSeparator();

sort($opt);
$sorted = true;
$opts = array_merge($opts, $opt);
$options[$group] = array_merge($options[$group], $opt);
}

if (!$sorted) {
sort($opts);
sort($options[$group]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function getDescribeResolvedFormTypeTestData()
$parent = new ResolvedFormType(new FormType(), $typeExtensions);

yield array(new ResolvedFormType(new ChoiceType(), array(), $parent), array('decorated' => false), 'resolved_form_type_1');
yield array(new ResolvedFormType(new FormType()), array('decorated' => false), 'resolved_form_type_2');
}

public function getDescribeOptionTestData()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"class": "Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType",
"block_prefix": "form",
"options": {
"own": [
"action",
"attr",
"auto_initialize",
"block_name",
"by_reference",
"compound",
"data",
"data_class",
"disabled",
"empty_data",
"error_bubbling",
"inherit_data",
"label",
"label_attr",
"label_format",
"mapped",
"method",
"post_max_size_message",
"property_path",
"required",
"translation_domain",
"trim",
"upload_max_size_message"
],
"overridden": [],
"parent": [],
"extension": [],
"required": []
},
"parent_types": [],
"type_extensions": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Symfony\Component\Form\Extension\Core\Type\FormType (Block prefix: "form")
==========================================================================

-------------------------
Options
-------------------------
action
attr
auto_initialize
block_name
by_reference
compound
data
data_class
disabled
empty_data
error_bubbling
inherit_data
label
label_attr
label_format
mapped
method
post_max_size_message
property_path
required
translation_domain
trim
upload_max_size_message
-------------------------

Morty Proxy This is a proxified and sanitized view of the page, visit original site.