godruoyi commented on code in PR #2782:
URL: 
https://github.com/apache/incubator-opendal/pull/2782#discussion_r1286663098


##########
bindings/php/opendal-php.stubs.php:
##########
@@ -20,6 +20,111 @@
 
 // Stubs for opendal-php
 
-namespace {
-    function debug(): string {}
+namespace OpenDAL {
+    class Operator {
+        public function __construct(string $scheme_str, array $config) {}
+
+        /**
+         * Write bytes into given path.
+         */
+        public function write(string $path, string $content): mixed {}
+
+        /**
+         * Read the whole path into bytes.
+         */
+        public function read(string $path): string {}
+
+        /**
+         * Check if this path exists or not.
+         */
+        public function is_exist(string $path): int {}
+
+        /**
+         * Get current path's metadata **without cache** directly.
+         *
+         * # Notes
+         *
+         * Use `stat` if you:
+         *
+         * - Want detect the outside changes of path.
+         * - Don't want to read from cached metadata.
+         */
+        public function stat(string $path): \OpenDAL\Metadata {}
+
+        /**
+         * Delete given path.
+         *
+         * # Notes
+         *
+         * - Delete not existing error won't return errors.
+         */
+        public function delete(string $path): mixed {}
+
+        /**
+         * Create a dir at given path.
+         *
+         * # Notes
+         *
+         * To indicate that a path is a directory, it is compulsory to include
+         * a trailing / in the path. Failure to do so may result in
+         * `NotADirectory` error being returned by OpenDAL.
+         *
+         * # Behavior
+         *
+         * - Create on existing dir will succeed.
+         * - Create dir is always recursive, works like `mkdir -p`
+         */
+        public function create_dir(string $path): mixed {}
+    }
+
+    class Metadata {
+        public $mode;
+
+        public $content_type;
+
+        public $etag;
+
+        public $content_md5;
+
+        public $content_disposition;
+
+        public $content_length;
+
+        public function content_disposition(): ?string {}
+
+        /**
+         * Content length of this entry.
+         */
+        public function content_length(): int {}

Review Comment:
   PHP's int refers to signed integer, which is int64 on 64-bit systems. I 
notice that we use `u64` as the return type in rust, should we change it to i64?
   ```rust
   /// Content length of this entry.
       #[getter]
       pub fn content_length(&self) -> u64 {
           self.0.content_length()
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to