PHP code example of seblegall / php-trello-burndown

1. Go to this page and download the library: Download seblegall/php-trello-burndown library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

seblegall / php-trello-burndown example snippets


// Create a new sprint
$sprint = new \TrelloBurndown\Model\Sprint();
// Set a start date
$sprint->setStart(new \DateTime('2016-05-24'));
// Set a duration
$sprint->setDuration(new \DateInterval('P14D'));

//Create a new Trello Client
$trelloClient = new \TrelloBurndown\Client\TrelloClient('{Your Key}', '{Your Token');

// Create a new generator and pass your client as argument.
$burndownGenerator = new \TrelloBurndown\BurndownGenerator($trelloClient);
/*
 * Add on or more board with the board full name.
 * Pay attention, if the board name is wrong or cannot
 * be find with your Trello client connection, this will do nothing.
 */
$burndownGenerator->addBoard('My Board');
/*
 * Add one or more Todo List with the list full name.
 * If you have add more than one board and some of the boards you've  add
 * contain lists with the same name, you can specify the board name as second parameter.
 * addTodoList('Todo', 'My second Board');
 *
 */
$burndownGenerator->addTodoList('Todo');
/*
 * Add one or more Work In Progress list with the list full name.
 */
$burndownGenerator->addWipList('In Progress');
/*
 * Add one or more Done list with the list full name.
 */
$burndownGenerator->addDoneList('To Validate 1');
$burndownGenerator->addDoneList('To Validate 2');

/*
 * Generate the Story Point Burndown by passing the sprint as agument.
 * This method will return a StoryPointBurndown Object
 */
$burndown = $burndownGenerator->getStoryPointBurndown($sprint);

/*
 * Call the generate() method to get an array representing your burndown
 */
 echo $burndown->generate();