Commit 673279f
committed
bug #1882 [TwigComponent] Restrict anonymous component lookup to Twig files in debug command (squrious)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[TwigComponent] Restrict anonymous component lookup to Twig files in debug command
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| Issues |
| License | MIT
Hi!
The `debug:twig-component` command looks for files in the anonymous template directory, but fails if some files are actually not Twig components (like .md).
For example, with a `README.md` file in `templates/components`:
```shell
$ php bin/console debug:twig-component
[critical] Error thrown while running command "debug:twig-component". Message: "Unknown component "README.md". And no matching anonymous component template was found."
In ComponentFactory.php line 254:
Unknown component "README.md". And no matching anonymous component template was found.
debug:twig-component [<name>]
```
This PR restricts the finder to `*.html.twig` files, so others are ignored.
Commits
-------
df82b4a [TwigComponent] Restrict anonymous component lookup to Twig files in debug commandFile tree
3 files changed
+12
-4
lines changed- src/TwigComponent
- src/Command
- tests
- Fixtures/templates/components
- Integration/Command
3 files changed
+12
-4
lines changedLines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 157 | + | |
160 | 158 | | |
161 | 159 | | |
162 | 160 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
0 commit comments