consolidation / annotated-command

Create Symfony Console commands from annotated command class methods.
Other
221 stars 37 forks source link

Fix bug with simple options with dashes in their names. #295

Closed greg-1-anderson closed 1 year ago

greg-1-anderson commented 1 year ago

Disposition

This pull request:

Summary

Is it a bug, or is it a feature? It is an oversight. The $options array allows for options that contain dashes in their name, but if you define an option with an $argumentName, there is no way to represent a dash.

Description

This PR allows an @option annotation or option attribute to define an option-name with a dash that will then map to a variable named either $optionName or $optionName.

codecov[bot] commented 1 year ago

Codecov Report

Merging #295 (8fee912) into 4.x (ed8ae76) will increase coverage by 0.04%. The diff coverage is 95.83%.

:exclamation: Current head 8fee912 differs from pull request most recent head c1b8366. Consider uploading reports for the commit c1b8366 to get more accurate results

@@             Coverage Diff              @@
##                4.x     #295      +/-   ##
============================================
+ Coverage     88.11%   88.16%   +0.04%     
- Complexity      770      777       +7     
============================================
  Files            46       46              
  Lines          2070     2087      +17     
============================================
+ Hits           1824     1840      +16     
- Misses          246      247       +1     
Impacted Files Coverage Δ
src/Parser/CommandInfo.php 95.35% <90.90%> (-0.24%) :arrow_down:
src/CommandData.php 92.75% <100.00%> (ø)
src/Parser/DefaultsWithDescriptions.php 96.82% <100.00%> (+0.52%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more