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

Commit

Permalink
Merge pull request #20 from dcelasun/master
Browse files Browse the repository at this point in the history
Implement stub file for auto-complete support in IDEs
  • Loading branch information
hjagodzinski committed Feb 3, 2014
2 parents 5839c25 + 163c0ff commit fb59222
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------

Expand Down
107 changes: 107 additions & 0 deletions stubs/ProtobufMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

die("This is a stub file for IDEs, don't use it directly!");

abstract class ProtobufMessage
{
const PB_TYPE_DOUBLE = 1;
const PB_TYPE_FIXED_32 = 2;
const PB_TYPE_FIXED_64 = 3;
const PB_TYPE_FLOAT = 4;
const PB_TYPE_INT = 5;
const PB_TYPE_SIGNED_INT = 6;
const PB_TYPE_STRING = 7;
const PB_TYPE_BOOL = 8;

protected $values = array();

/**
* @return null
*/
abstract public function reset();

/**
* @param int $position
* @param mixed $value
*
* @return null
*/
public function append($position, $value)
{

}

/**
* @param int $position
*
* @return null
*/
public function clear($position)
{

}

/**
* @param bool $onlySet
* @param int $indentation
*
* @return string
*/
public function dump($onlySet = true, $indentation = 0)
{

}

/**
* @param int $position
*
* @return int
*/
public function count($position)
{

}

/**
* @param int $position
*
* @return mixed
*/
public function get($position = -1)
{

}

/**
* @param string $packed
*
* @throws Exception
*
* @return mixed
*/
public function parseFromString($packed)
{

}

/**
* @throws Exception
*
* @return string
*/
public function serializeToString()
{

}

/**
* @param int $position
* @param mixed $value
*
* @return null
*/
public function set($position = -1, $value)
{

}
}

0 comments on commit fb59222

Please sign in to comment.