public static function defineCloseableSubclasses() { self::$closes = ClassLoader::defineClass('_WithTest_C0', Object::class, [Closeable::class], '{ public $closed= false; public function close() { $this->closed= true; } }'); self::$raises = ClassLoader::defineClass('_WithTest_C1', Object::class, [Closeable::class], '{ public function close() { throw new \\lang\\IllegalArgumentException("Cannot close"); } }'); }
public static function defineCloseableSubclasses() { self::$closes = ClassLoader::defineClass('_WithTest_C0', Object::class, [Closeable::class], '{ public $closed= false; public function close() { $this->closed= true; } }'); self::$raises = ClassLoader::defineClass('_WithTest_C1', Object::class, [Closeable::class], '{ private $throwable; public function __construct($class) { $this->throwable= $class; } public function close() { throw new $this->throwable("Cannot close"); } }'); }