config icon indicating copy to clipboard operation
config copied to clipboard

Get all supported extensions

Open nochso opened this issue 10 years ago • 2 comments

A new public method getSupportedFileExtensions that returns the collected extensions of all parsers.

This would make it easier to scan directories only for supported file types.

Edit: If that's too specific, a getSupportedFileParsers would be fine too :)

I'm happy to implement either, just looking for feedback first.

nochso avatar Jan 17 '16 20:01 nochso

I think a getSupportedFileParsers() would be ideal, since we could check if those classes exist.

hassankhan avatar Jan 23 '16 21:01 hassankhan

Only the parsers themselves should have to figure out if they can currently support a file extension.

My suggestion:

  • Add isInstalled to FileParserInterface or alternatively add a new optional interface Installable.
  • Config can now avoid using parsers that are not currently useable like the YAML parser.

What do you think? The interface would be more backwards compatible I guess, but then you have to check for it each time if it's not part of FileParserInterface.

nochso avatar Jan 24 '16 10:01 nochso