Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hiding private members of port data type

  • Loading branch information...
commit b0c478347055bd58801a28e6adf136f284db9990 1 parent 97498a6
@icheishvili icheishvili authored
View
78 src/Hurricane/Erlang/DataType/Port.php
@@ -10,17 +10,17 @@ class Port
/**
* @var Atom
*/
- public $atom;
+ private $_atom;
/**
* @var integer
*/
- public $identifier;
+ private $_identifier;
/**
* @var integer
*/
- public $creation;
+ private $_creation;
/**
* Set the given data on the object.
@@ -31,8 +31,74 @@ class Port
*/
public function __construct($atom, $identifier, $creation)
{
- $this->atom = $atom;
- $this->identifier = $identifier;
- $this->creation = $creation;
+ $this->_atom = $atom;
+ $this->_identifier = $identifier;
+ $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;
}
}
View
6 src/Hurricane/Erlang/Util.php
@@ -646,9 +646,9 @@ public static function encode_reference(DataType\Reference $data, StreamInterfac
public static function encode_port(DataType\Port $data, StreamInterface $stream)
{
$stream->write(chr(102));
- self::encode($data->atom, $stream, false);
- $stream->write(pack('N', $data->identifier));
- $stream->write(chr($data->creation));
+ self::encode($data->getAtom(), $stream, false);
+ $stream->write(pack('N', $data->getIdentifier()));
+ $stream->write(chr($data->getCreation()));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.