Skip to content

Commit

Permalink
hiding private members of port data type
Browse files Browse the repository at this point in the history
  • Loading branch information
icheishvili committed Mar 12, 2012
1 parent 97498a6 commit b0c4783
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 9 deletions.
78 changes: 72 additions & 6 deletions src/Hurricane/Erlang/DataType/Port.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ class Port
/** /**
* @var Atom * @var Atom
*/ */
public $atom; private $_atom;


/** /**
* @var integer * @var integer
*/ */
public $identifier; private $_identifier;


/** /**
* @var integer * @var integer
*/ */
public $creation; private $_creation;


/** /**
* Set the given data on the object. * Set the given data on the object.
Expand All @@ -31,8 +31,74 @@ class Port
*/ */
public function __construct($atom, $identifier, $creation) public function __construct($atom, $identifier, $creation)
{ {
$this->atom = $atom; $this->_atom = $atom;
$this->identifier = $identifier; $this->_identifier = $identifier;
$this->creation = $creation; $this->_creation = $creation;
}

/**
* Setter for atom.
*
* @param \Hurricane\Erlang\DataType\Atom $atom
*
* @return void
*/
public function setAtom($atom)
{
$this->_atom = $atom;
}

/**
* Getter for atom.
*
* @return \Hurricane\Erlang\DataType\Atom
*/
public function getAtom()
{
return $this->_atom;
}

/**
* Setter for creation.
*
* @param int $creation
*
* @return void
*/
public function setCreation($creation)
{
$this->_creation = $creation;
}

/**
* Getter for creation.
*
* @return int
*/
public function getCreation()
{
return $this->_creation;
}

/**
* Setter for identifier.
*
* @param int $identifier
*
* @return void
*/
public function setIdentifier($identifier)
{
$this->_identifier = $identifier;
}

/**
* Getter for identifier.
*
* @return int
*/
public function getIdentifier()
{
return $this->_identifier;
} }
} }
6 changes: 3 additions & 3 deletions src/Hurricane/Erlang/Util.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -646,9 +646,9 @@ public static function encode_reference(DataType\Reference $data, StreamInterfac
public static function encode_port(DataType\Port $data, StreamInterface $stream) public static function encode_port(DataType\Port $data, StreamInterface $stream)
{ {
$stream->write(chr(102)); $stream->write(chr(102));
self::encode($data->atom, $stream, false); self::encode($data->getAtom(), $stream, false);
$stream->write(pack('N', $data->identifier)); $stream->write(pack('N', $data->getIdentifier()));
$stream->write(chr($data->creation)); $stream->write(chr($data->getCreation()));
} }


/** /**
Expand Down

0 comments on commit b0c4783

Please sign in to comment.