PHP code example of zjkiza / tmp-storage-bundle

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

    

zjkiza / tmp-storage-bundle example snippets




declare(strict_types=1);

return [
    // other bundles
    Zjk\TmpStorage\Bridge\Symfony\ZJKizaTmpStorageBundle::class => ['all' => true],
];



use Zjk\TmpStorage\Contract\TmpStorageInterface

class MyService {
    private TmpStorageInterface $storage;
    
    public function __construct(TmpStorageInterface $storage) 
    {
        $this->storage = $storage;
    }
    
    public function register(): string
    {
        $dto = new RegisterDto('[email protected]', 'lorem123');

        return $this->storage->storage($dto);
    }
    
    public function login(string $id): void
    {
        $dto = $this->storage->fetch($id);
        ......
    }
}