PHP code example of boatrace / types

1. Go to this page and download the library: Download boatrace/types 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/ */

    

boatrace / types example snippets




oatrace\Types\Enums\Grade;
use Boatrace\Types\Enums\Rank;
use Boatrace\Types\Enums\Stadium;

$stadium = Stadium::from(22);           // Stadium::福岡
$stadium = Stadium::fromName('福岡');   // Stadium::福岡
$grade = Grade::from(5);                // Grade::OPEN
$rank = Rank::fromShortName('A1');      // Rank::A1級
$rank->name();                          // A1級

print_r(Grade::toArray());

Array
(
    [0] => Array
        (
            [number] => 1
            [name] => SG
        )

    [1] => Array
        (
            [number] => 2
            [name] => G1
        )

    [2] => Array
        (
            [number] => 3
            [name] => G2
        )

    [3] => Array
        (
            [number] => 4
            [name] => G3
        )

    [4] => Array
        (
            [number] => 5
            [name] => OPEN
        )

    [5] => Array
        (
            [number] => 6
            [name] => PG1
        )

)