PHP code example of zilbam / oss-rendu1-gitmoji

1. Go to this page and download the library: Download zilbam/oss-rendu1-gitmoji 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/ */

    

zilbam / oss-rendu1-gitmoji example snippets


    use Zilbam\OssRendu1Gitmoji\GitmojisService;
    ...
    
    // Initialize the service
    $gitmojisService = new GitmojisService();
    
    // Get all the gitmojis
    $gitmojis = $gitmojisService->getGitmojis();
    
    // Get a gitmoji by its name
    $bug = $gitmojisService['bug'];
    
    // Display the gitmoji
    echo $bug;
    
    // Echo the gitmoji's description
    echo $bug->description;
    
    // Get the gitmoji's name
    $gitmojiName = $bug->name;
    
    // Get the gitmoji's code
    $gitmojiCode = $bug->code;
bash
php vendor/bin/phpstan analyse src --level=max
bash
php vendor/bin/php-cs-fixer fix src --rules=@PSR12
bash
php vendor/bin/phpunit tests