Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.

Commit fb59222

Browse files
committed
Merge pull request #20 from dcelasun/master
Implement stub file for auto-complete support in IDEs
2 parents 5839c25 + 163c0ff commit fb59222

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ Compatibility
181181

182182
PHP Protobuf does not support repeated packed fields.
183183

184+
IDE Helper and Auto-Complete Support
185+
------------------------------------
186+
187+
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.
188+
184189
References
185190
----------
186191

stubs/ProtobufMessage.php

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?php
2+
3+
die("This is a stub file for IDEs, don't use it directly!");
4+
5+
abstract class ProtobufMessage
6+
{
7+
const PB_TYPE_DOUBLE = 1;
8+
const PB_TYPE_FIXED_32 = 2;
9+
const PB_TYPE_FIXED_64 = 3;
10+
const PB_TYPE_FLOAT = 4;
11+
const PB_TYPE_INT = 5;
12+
const PB_TYPE_SIGNED_INT = 6;
13+
const PB_TYPE_STRING = 7;
14+
const PB_TYPE_BOOL = 8;
15+
16+
protected $values = array();
17+
18+
/**
19+
* @return null
20+
*/
21+
abstract public function reset();
22+
23+
/**
24+
* @param int $position
25+
* @param mixed $value
26+
*
27+
* @return null
28+
*/
29+
public function append($position, $value)
30+
{
31+
32+
}
33+
34+
/**
35+
* @param int $position
36+
*
37+
* @return null
38+
*/
39+
public function clear($position)
40+
{
41+
42+
}
43+
44+
/**
45+
* @param bool $onlySet
46+
* @param int $indentation
47+
*
48+
* @return string
49+
*/
50+
public function dump($onlySet = true, $indentation = 0)
51+
{
52+
53+
}
54+
55+
/**
56+
* @param int $position
57+
*
58+
* @return int
59+
*/
60+
public function count($position)
61+
{
62+
63+
}
64+
65+
/**
66+
* @param int $position
67+
*
68+
* @return mixed
69+
*/
70+
public function get($position = -1)
71+
{
72+
73+
}
74+
75+
/**
76+
* @param string $packed
77+
*
78+
* @throws Exception
79+
*
80+
* @return mixed
81+
*/
82+
public function parseFromString($packed)
83+
{
84+
85+
}
86+
87+
/**
88+
* @throws Exception
89+
*
90+
* @return string
91+
*/
92+
public function serializeToString()
93+
{
94+
95+
}
96+
97+
/**
98+
* @param int $position
99+
* @param mixed $value
100+
*
101+
* @return null
102+
*/
103+
public function set($position = -1, $value)
104+
{
105+
106+
}
107+
}

0 commit comments

Comments
 (0)