From f348af5d1fcac718e8e575cfee4dcfa50a5335b3 Mon Sep 17 00:00:00 2001 From: Can Celasun Date: Thu, 30 Jan 2014 17:08:52 +0200 Subject: [PATCH 1/3] Implement stub file for auto-complete support in IDEs --- README.md | 5 ++ stubs/ProtobufMessage.php | 108 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 stubs/ProtobufMessage.php diff --git a/README.md b/README.md index cef0c40..443dd03 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,11 @@ Compatibility PHP Protobuf does not support repeated packed fields. +IDE Helper and Auto-complete support +------------------------------------ + +To integrate this extension with your IDE (PhpStorm, Eclipse etc.) and get auto-complete support, simply include `stubs\ProtobufMessage.php` anywhere under your project root. + References ---------- diff --git a/stubs/ProtobufMessage.php b/stubs/ProtobufMessage.php new file mode 100644 index 0000000..13734fc --- /dev/null +++ b/stubs/ProtobufMessage.php @@ -0,0 +1,108 @@ + Date: Thu, 30 Jan 2014 17:18:27 +0200 Subject: [PATCH 2/3] Formatting fixes. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 443dd03..e329a3d 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ Compatibility PHP Protobuf does not support repeated packed fields. -IDE Helper and Auto-complete support +IDE Helper and Auto-Complete Support ------------------------------------ To integrate this extension with your IDE (PhpStorm, Eclipse etc.) and get auto-complete support, simply include `stubs\ProtobufMessage.php` anywhere under your project root. From 163c0ff6673c14e13bdba376704217e7f91fae60 Mon Sep 17 00:00:00 2001 From: Duru Can Celasun Date: Thu, 30 Jan 2014 19:11:15 +0200 Subject: [PATCH 3/3] Add default values to several method signatures. --- stubs/ProtobufMessage.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stubs/ProtobufMessage.php b/stubs/ProtobufMessage.php index 13734fc..d17536a 100644 --- a/stubs/ProtobufMessage.php +++ b/stubs/ProtobufMessage.php @@ -47,7 +47,7 @@ public function clear($position) * * @return string */ - public function dump($onlySet = true, $indentation) + public function dump($onlySet = true, $indentation = 0) { } @@ -67,7 +67,7 @@ public function count($position) * * @return mixed */ - public function get($position) + public function get($position = -1) { } @@ -100,9 +100,8 @@ public function serializeToString() * * @return null */ - public function set($position, $value) + public function set($position = -1, $value) { } - }