Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d62ecd5

Browse files
committed
feature #29452 [Form] Shortcut debug:form for partial type name (ro0NL)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Form] Shortcut debug:form for partial type name | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes-ish | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> When running `debug:form` we must specify the short type class case-sensitive. As the current autoloader doesnt check for insensitive names. I propose this shortcut to quickly enable ``` debug:form url debug:form urltype ``` instead of forcing ``` debug:form UrlType ``` Commits ------- a28e3b6 [Form] Shortcut debug:form for partial type name
2 parents 7b03bff + a28e3b6 commit d62ecd5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Form/Command/DebugCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ private function getFqcnTypeClass(InputInterface $input, SymfonyStyle $io, $shor
158158
foreach ($this->namespaces as $namespace) {
159159
if (class_exists($fqcn = $namespace.'\\'.$shortClassName)) {
160160
$classes[] = $fqcn;
161+
} elseif (class_exists($fqcn = $namespace.'\\'.ucfirst($shortClassName))) {
162+
$classes[] = $fqcn;
163+
} elseif (class_exists($fqcn = $namespace.'\\'.ucfirst($shortClassName).'Type')) {
164+
$classes[] = $fqcn;
165+
} elseif ('type' === substr($shortClassName, -4) && class_exists($fqcn = $namespace.'\\'.ucfirst(substr($shortClassName, 0, -4).'Type'))) {
166+
$classes[] = $fqcn;
161167
}
162168
}
163169

0 commit comments

Comments
 (0)