PHP badges library
PHP Gherkin
Latest commit f5db562 Feb 11, 2017 @jmleroux jmleroux committed on GitHub Rework travis file (#22)
Rework travis file:
* remove composer update because it is done automatically by Travis now
* remove xdebug without test on PHP version to be more versatile
* Update composer.lock
* Add php-cs-fixer
* Apply PSR2 fixes
* Ad composer cache

PHP badges poser

This is a php library that creates badges like Badge Poser and I'm a badge and dark, according to Shields specification.

This library is used by

Latest Stable Version Latest Unstable Version Total Downloads Build Status


  • PHP 5.3 or higher
  • GD extension

Use as command

1. Create a project

$ composer create-project badges/poser ~1.2
$ ln -s poser/bin/poser /usr/local/bin/poser

2. Launch the command

Create an image

$ poser license MIT blue -p "license.svg"

Flush an image

$ poser license MIT blue

Usage as library

1. Add to composer

composer require badges/poser ~1.2

2. Use in your project as lib

    use PUGX\Poser\Render\SvgRender;
    use PUGX\Poser\Poser;

    $render = new SvgRender();
    $poser = new Poser(array($render));

    echo $poser->generate('license', 'MIT', '428F7E', 'plastic');
    // or
    echo $poser->generateFromURI('license-MIT-428F7E.plastic');
    // or
    $image = $poser->generate('license', 'MIT', '428F7E', 'plastic');

    echo $image->getFormat();


Dashes --- Dash

Underscores ___ Underscore

_ or Space → Space


For more info please see the behat features and the examples in the php-spec folder


Active contribution and patches are very welcome. See the github issues. To keep things in shape we have quite a bunch of examples and features. If you're submitting pull requests please make sure that they are still passing and if you add functionality please take a look at the coverage as well it should be pretty high :)

  • First fork or clone the repository
git clone git://
cd poser
  • Install vendors:
composer install
  • Run specs:
./bin/phpspec run --format=pretty
  • Then run behat:
./bin/behat run