diff --git a/src/SDL.php b/src/SDL.php index 6ce1d18..f49df8e 100644 --- a/src/SDL.php +++ b/src/SDL.php @@ -39,11 +39,6 @@ final class SDL implements Enums */ public LibraryInformation $info; - /** - * @var \FFI|SDLNativeApiAutocomplete - */ - private \FFI $ffi; - /** * @var Loader */ @@ -60,7 +55,6 @@ public function __construct() $this->loader = $this->loader(); $this->info = $this->loadLibrary(new Library()); - $this->ffi = $this->info->ffi; self::setInstance($this); } @@ -179,7 +173,7 @@ public function type($type): CType try { /** @noinspection StaticInvocationViaThisInspection */ - return $this->ffi->type($type); + return $this->info->ffi->type($type); } catch (ParserException $e) { $error = \sprintf('Structure "%s" not found. %s', $type, \ucfirst($e->getMessage())); @@ -201,7 +195,7 @@ public static function __callStatic(string $name, array $arguments) */ public function __get(string $name) { - return $this->ffi->$name; + return $this->info->ffi->$name; } /** @@ -212,6 +206,6 @@ public function __get(string $name) */ public function __set(string $name, $value): void { - $this->ffi->$name = $value; + $this->info->ffi->$name = $value; } }