@@ -500,7 +500,7 @@ class Image extends ImageAutodoc implements \ArrayAccess
500500 */
501501 public function __construct (\FFI \CData $ pointer )
502502 {
503- $ this ->pointer = \ FFI ::cast (FFI ::ctypes ("VipsImage " ), $ pointer );
503+ $ this ->pointer = FFI ::vips ()-> cast (FFI ::ctypes ("VipsImage " ), $ pointer );
504504 parent ::__construct ($ pointer );
505505 }
506506
@@ -807,7 +807,7 @@ public static function newFromArray(
807807 $ width = count ($ array [0 ]);
808808
809809 $ n = $ width * $ height ;
810- $ a = \ FFI ::new ("double[ $ n] " , true , true );
810+ $ a = FFI ::vips ()-> new ("double[ $ n] " , true , true );
811811 for ($ y = 0 ; $ y < $ height ; $ y ++) {
812812 for ($ x = 0 ; $ x < $ width ; $ x ++) {
813813 $ a [$ x + $ y * $ width ] = $ array [$ y ][$ x ];
@@ -921,7 +921,9 @@ public function newFromImage($value): Image
921921 */
922922 public static function findLoadSource (Source $ source ): ?string
923923 {
924- return FFI ::vips ()->vips_foreign_find_load_source (\FFI ::cast (FFI ::ctypes ('VipsSource ' ), $ source ->pointer ));
924+ return FFI ::vips ()->vips_foreign_find_load_source (
925+ FFI ::vips ()->cast (FFI ::ctypes ('VipsSource ' ), $ source ->pointer )
926+ );
925927 }
926928
927929 /**
@@ -1043,7 +1045,7 @@ public function writeToBuffer(string $suffix, array $options = []): string
10431045 */
10441046 public function writeToMemory (): string
10451047 {
1046- $ p_size = \ FFI ::new ("size_t[1] " );
1048+ $ p_size = FFI ::vips ()-> new ("size_t[1] " );
10471049
10481050 $ pointer = FFI ::vips ()->
10491051 vips_image_write_to_memory ($ this ->pointer , $ p_size );
@@ -1084,7 +1086,7 @@ public function writeToMemory(): string
10841086 */
10851087 public function writeToArray (): array
10861088 {
1087- $ p_size = \ FFI ::new ("size_t[1] " );
1089+ $ p_size = FFI ::vips ()-> new ("size_t[1] " );
10881090
10891091 $ pointer = FFI ::vips ()->
10901092 vips_image_write_to_memory ($ this ->pointer , $ p_size );
@@ -1095,7 +1097,7 @@ public function writeToArray(): array
10951097 // wrap pointer up as a C array of the right type
10961098 $ type_name = FFI ::ftypes ($ this ->format );
10971099 $ n = $ this ->width * $ this ->height * $ this ->bands ;
1098- $ array = \ FFI ::cast ("{$ type_name }[ $ n] " , $ pointer );
1100+ $ array = FFI ::vips ()-> cast ("{$ type_name }[ $ n] " , $ pointer );
10991101
11001102 // copy to PHP memory as a flat array
11011103 $ result = [];
0 commit comments