PHP code example of seablast / interfaces

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

    

seablast / interfaces example snippets


// src/IdentityManager.php in a package that consumes seablast/interfaces
namespace Seablast\Auth;

use Seablast\Interfaces\IdentityManagerInterface;

final class IdentityManager implements IdentityManagerInterface
{
    public function getGroups(): array
    {
        return [1, 2];
    }

    public function getRoleId(): int
    {
        return 1;
    }

    public function getUserId(): int
    {
        return 123;
    }

    public function isAuthenticated(): bool
    {
        return true;
    }
}