cyclonedx-php-composer
cyclonedx-php-composer copied to clipboard
configuration file
benefit: have the config in a file, so no CLI parameters are needed
parameter defaults are read from the config-file, and may override system defaults. parameters can still be overridden via CLI parameters
implementation details: use extra
section of the composer file.
see https://getcomposer.org/doc/04-schema.md#extra
acc / crit
- [ ] config overrides system defaults (therefore config file settings = presets)
- [ ] CLI params override any defaults/presets
- [ ] parameter type checks are (still) in place
- [ ] parameter plausibility checks are still in place
- [ ] config possibility is documented
(+ docs have hint, that this config can be used with the gh-action -- see https://github.com/CycloneDX/gh-php-composer-generate-sbom/issues/1)
implementation idea:
-
Options
propertie are the defaults - new method
Options::setFromPackage()
that accpts a RootPackage - settings are read from theextras
- existing method
Options::setFromInput(InputInterface $input)
only sets existing values/options by checking via$input->hasArgument()
- add a new method
Options::vlidate()
if needed ...
alternative: Options::setFrom...()
become factory methods, that each create new objects ....