https://github.com/phpbadge/phpbadge
A PHP library to build badges as seen in README's of many open source libraries.
https://github.com/phpbadge/phpbadge
badge php php71 phpbadge svg
Last synced: 10 months ago
JSON representation
A PHP library to build badges as seen in README's of many open source libraries.
- Host: GitHub
- URL: https://github.com/phpbadge/phpbadge
- Owner: phpbadge
- License: mit
- Created: 2015-04-23T18:23:34.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-02-22T10:29:26.000Z (almost 7 years ago)
- Last Synced: 2025-04-09T20:04:06.350Z (10 months ago)
- Topics: badge, php, php71, phpbadge, svg
- Language: PHP
- Homepage:
- Size: 177 KB
- Stars: 25
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phpbadge
[](https://travis-ci.org/phpbadge/phpbadge)
[](https://scrutinizer-ci.com/g/phpbadge/phpbadge/?branch=master)
[](https://scrutinizer-ci.com/g/phpbadge/phpbadge/?branch=master)
[](https://www.versioneye.com/user/projects/55394d401d2989cb7800001d)
[](https://insight.sensiolabs.com/projects/1c61e728-9b88-4e82-9d95-f91dc4cd6b93)
A PHP library to build badges as seen in README's of many open source libraries.
## Getting started
It's recommended to install this library via [Composer](https://getcomposer.org).
```bash
composer require phpbadge/phpbadge
```
The current master branch is considered stable. The badges on top of this document should confirm this.
## Requirements
As from version 2.0.0 this library needs a PHP version >= 7.1.
Older version of the library run on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7 and HHVM.
## Example
```php
setBorderRadius(3);
$badge->addPart(new Part('build', '#555', '#fff', new Font(11, 'verdana', 'fonts/verdana.ttf')));
$badge->addPart(new Part('passing', '#4c1', '#fff', new Font(11, 'verdana', 'fonts/verdana.ttf')));
$renderer = new SvgRenderer(new GdDimensionCalculator());
echo $renderer->render($badge);
```