php-semver-checker icon indicating copy to clipboard operation
php-semver-checker copied to clipboard

Implement Markdown table

Open nochso opened this issue 10 years ago • 3 comments

It's compatible to Symfony's Table class, except for configuration, styling and col/rowspan support.

Sample output comparing master to this PR:

$ php-semver-checker/bin/php-semver-checker compare php-semver-checker2/src php-semver-checker/src

Suggested semantic versioning change: MINOR

Class (MINOR)

Level Location Target Reason Code
MINOR php-semver-checker/src/PHPSemVerChecker/Console/MarkdownTable.php:12 PHPSemVerChecker\Console\MarkdownTable Class was added. V014
PATCH php-semver-checker/src/PHPSemVerChecker/Reporter/Reporter.php:73 PHPSemVerChecker\Reporter\Reporter::outputTable [protected] Method implementation changed. V024

[Scanned files] Before: 1, After: 2, Identical: 60 Time: 0.058 seconds, Memory: 7.67 MB

Implements #71

nochso avatar Jan 25 '16 20:01 nochso

Ok, namespace was changed and phpdocs were fixed.

nochso avatar Jan 26 '16 19:01 nochso

After testing it out, I'm not sure I want it to replace the Table itself in all cases. I think it would be more appropriate to have an option to specify the output format, and only in the case where --format=markdown would we use this markdown table.

Opinion?

tomzx avatar Jan 27 '16 04:01 tomzx

Well, why? If you're missing the styled headers, those can be added. Otherwise I don't know if anyone even noticed the difference..

I suppose we could reuse SymfonyStyle, overriding its table(). That new Style class would then switch table implementations based on --format-table?

In another project I'm preparing a SymfonyStyle / OutputStyle in a base Command's initialize() and assigning it to a field io. That way you simply write $this->io->table() in the commands and you're assured that all commands rely on the same style.

nochso avatar Jan 27 '16 21:01 nochso