PHP code example of archict / firewall

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

    

archict / firewall example snippets




namespace Archict\Firewall;

interface UserProvider 
{
    public function getCurrentUser(ServerRequestInterface $request): UserWithRoles;
}



namespace Archict\Firewall;

interface UserWithRoles
{
    /**
     * @return string[]
     */
    public function getRoles(): array;
}



namespace Archict\Firewall;

interface UserAccessChecker
{
    public function canUserAccessResource(ServerRequestInterface $request): bool;
}