PHP code example of surfnet / stepup-middleware-client-bundle

1. Go to this page and download the library: Download surfnet/stepup-middleware-client-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/ */

    

surfnet / stepup-middleware-client-bundle example snippets


    public function registerBundles()
    {
        // ...
        $bundles[] = new Surfnet\StepupMiddlewareClientBundle\SurfnetStepupMiddlewareClientBundle;
    }
    

# In the context of a Symfony2 controller action
$command = new \Surfnet\StepupMiddlewareClientBundle\Identity\Command\CreateIdentityCommand();
$command->id = \Surfnet\StepupMiddlewareClientBundle\Uuid\Uuid::generate();
$command->nameId = \Surfnet\StepupMiddlewareClientBundle\Uuid\Uuid::generate();

/** @var \Surfnet\StepupMiddlewareClientBundle\Service\CommandService $service */
$service = $this->get('surfnet_stepup_middleware_client.service.command');
$result = $service->execute($command);

/** @var \Surfnet\StepupMiddlewareClientBundle\Identity\Service\IdentityService $service */
$service = $container->get('surfnet_stepup_middleware_client.identity.service.identity');
/** @var null|\Surfnet\StepupMiddlewareClientBundle\Identity\Dto\Identity */
$identity = $service->get($id);