1<?php 2 3declare(strict_types=1); 4 5namespace JMS\Serializer\Tests\Handler; 6 7use Psr\Container\ContainerInterface; 8 9class LazyHandlerRegistryWithPsr11ContainerTest extends LazyHandlerRegistryTest 10{ 11 protected function createContainer() 12 { 13 return new Psr11Container(); 14 } 15 16 protected function registerHandlerService($serviceId, $listener) 17 { 18 $this->container->set($serviceId, $listener); 19 } 20} 21 22class Psr11Container implements ContainerInterface 23{ 24 private $services; 25 26 public function get($id) 27 { 28 return $this->services[$id]; 29 } 30 31 public function has($id) 32 { 33 return isset($this->services[$id]); 34 } 35 36 public function set($id, $service) 37 { 38 $this->services[$id] = $service; 39 } 40} 41