PHP code example of garethellis / cricket-stats-helper

1. Go to this page and download the library: Download garethellis/cricket-stats-helper 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/ */

    

garethellis / cricket-stats-helper example snippets

 php

use Garethellis\CricketStatsHelper\CricketStatsHelper;
$helper = new CricketStatsHelper();
 php
$helper = new CricketStatsHelper(8);
 php
$helper = new CricketStatsHelper();
$helper->setBallsPerOver(8);
 php

use Garethellis\CricketStatsHelper\CricketStatsHelper;
$helper = new CricketStatsHelper();
$battingAverage = $helper->calculateBattingAverage($runsScored, $inningsPlayed, $numberOfTimesNotOut);
 php

use Garethellis\CricketStatsHelper\CricketStatsHelper;
$helper = new CricketStatsHelper();
$bowlingAverage = $helper->calculateBowlingAverage($runsConceded, $wicketsTaken);
 php

use Garethellis\CricketStatsHelper\CricketStatsHelper;
$helper = new CricketStatsHelper();
$bowlingEconomy = $helper->calculateBowlingEconomy($runsConceded, $oversBowled);
 php

use Garethellis\CricketStatsHelper\CricketStatsHelper;
$helper = new CricketStatsHelper();
$numberOfBalls = $helper->convertOversToBalls($overs);
 php

use Garethellis\CricketStatsHelper\CricketStatsHelper;
$helper = new CricketStatsHelper();
$numberOfOvers = $helper->convertBallsToOvers($balls);