PHP code example of skrip42 / avatar-bundle

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

    

skrip42 / avatar-bundle example snippets


....
use Symfony\Component\Security\Core\User\UserInterface;
use Skrip42\Bundle\AvatarBundle\UserInterface as AvataredUserInterface;

class User implements UserInterface, AvataredUserInterface
{
    public function getUsername() : string
    {
        ...
    }
    public function getLastName() : ?string
    {
        ...
    }
    public function getFirstName() : ?string
    {
        ...
    }
    public function getPatronymicName() : ?string
    {
        ...
    }
    public function getAvatar() : ?string
    {
        ...
    }
    .....
}

namespace App\Utils;

use Skrip42\Bundle\AvatarBundle\AvatarGeneratorInterface;
use Skrip42\Bundle\AvatarBundle\UserInterface;

class AvatarGenerator implements AvatarGeneratorInterface
{
    public function getAvatar(UserInterface $user) : string
    {
        ....
    }
}