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
-------
a28e3b61f6
[Form] Shortcut debug:form for partial type name
This commit is contained in:
commit
d62ecd5521
@ -158,6 +158,12 @@ EOF
|
||||
foreach ($this->namespaces as $namespace) {
|
||||
if (class_exists($fqcn = $namespace.'\\'.$shortClassName)) {
|
||||
$classes[] = $fqcn;
|
||||
} elseif (class_exists($fqcn = $namespace.'\\'.ucfirst($shortClassName))) {
|
||||
$classes[] = $fqcn;
|
||||
} elseif (class_exists($fqcn = $namespace.'\\'.ucfirst($shortClassName).'Type')) {
|
||||
$classes[] = $fqcn;
|
||||
} elseif ('type' === substr($shortClassName, -4) && class_exists($fqcn = $namespace.'\\'.ucfirst(substr($shortClassName, 0, -4).'Type'))) {
|
||||
$classes[] = $fqcn;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user