From 210ae6e0e0d6d6d8e3235cf1c91837bce965d673 Mon Sep 17 00:00:00 2001 From: Joanhey Date: Sat, 30 Sep 2023 23:04:38 +0200 Subject: [PATCH 1/2] Typehint FFI --- src/WebView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebView.php b/src/WebView.php index d27c94b..4804257 100644 --- a/src/WebView.php +++ b/src/WebView.php @@ -10,7 +10,7 @@ class WebView { - private $ffi; + private FFI $ffi; private $webview; From ae5e7db93daf4a5eb4fa96847090f7ac5bfd51be Mon Sep 17 00:00:00 2001 From: Joanhey Date: Sat, 30 Sep 2023 23:08:59 +0200 Subject: [PATCH 2/2] Delete phpdoc for return types Already type hinted in the methods, phpdoc don't give any extra info --- src/WebView.php | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/WebView.php b/src/WebView.php index 4804257..0ab1346 100644 --- a/src/WebView.php +++ b/src/WebView.php @@ -40,34 +40,21 @@ public function __construct( $this->webview = $this->ffi->webview_create((int)$this->debug, null); } - /** - * @return FFI - */ public function getFFI(): FFI { return $this->ffi; } - /** - * @return mixed - */ - public function getWebview() + public function getWebview(): mixed { return $this->webview; } - - /** - * @return string - */ public function getTitle(): string { return $this->title; } - /** - * @param string $title - */ public function setTitle(string $title): self { $this->title = $title; @@ -75,17 +62,11 @@ public function setTitle(string $title): self return $this; } - /** - * @return int - */ public function getWidth(): int { return $this->width; } - /** - * @param int $width - */ public function setWidth(int $width): self { $this->width = $width; @@ -93,33 +74,21 @@ public function setWidth(int $width): self return $this; } - /** - * @return int - */ public function getHeight(): int { return $this->height; } - /** - * @param int $height - */ public function setHeight(int $height): void { $this->height = $height; } - /** - * @return WindowSizeHint - */ public function getHint(): WindowSizeHint { return $this->hint; } - /** - * @param WindowSizeHint $hint - */ public function setHint(WindowSizeHint $hint): self { $this->hint = $hint; @@ -127,9 +96,6 @@ public function setHint(WindowSizeHint $hint): self return $this; } - /** - * @return bool - */ public function isDebug(): bool { return $this->debug; @@ -214,7 +180,6 @@ public function terminate(): self } /** - * @return string * @throws OsException */ private function getDefaultLibraryFile(): string @@ -233,4 +198,4 @@ private function getDefaultLibraryFile(): string return $this->libraryFile; } -} \ No newline at end of file +}