Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Realdom\Crate\Constant Class Reference
Inheritance diagram for Hoa\Realdom\Crate\Constant:

Public Member Functions

 __construct (Realdom\IRealdom\Holder $holder,\Closure $praspel, Praspel\Model\Declaration $declaration=null)
 
 getHolder ()
 
 getTypes ()
 
 getConstantValue ()
 
 getPraspelRepresentation ()
 
 setDeclaration (Praspel\Model\Declaration $declaration)
 
 getDeclaration ()
 
 getConstantRepresentation ()
 
 accept (Visitor\Visit $visitor, &$handle=null, $eldnah=null)
 
- Public Member Functions inherited from Hoa\Visitor\Element
 accept (Visit $visitor, &$handle=null, $eldnah=null)
 

Protected Member Functions

 setHolder (Realdom\IRealdom\Holder $holder)
 
 setPraspelRepresentation (\Closure $praspel)
 

Protected Attributes

 $_holder = null
 
 $_praspelRepresentation = null
 
 $_declaration = null
 

Detailed Description

Class .

Represent a mocked constant.

Definition at line 51 of file Constant.php.

Constructor & Destructor Documentation

Hoa\Realdom\Crate\Constant::__construct ( Realdom\IRealdom\Holder  $holder,
\Closure  $praspel,
Praspel\Model\Declaration  $declaration = null 
)

Constructor.

Parameters
\Hoa\Realdom\IRealdom\Holder$holderHolder.
\Closure$praspelPraspel representation.
\Hoa\Praspel\Model\Declaration$declarationOriginal declaration object.
Returns
void

Definition at line 89 of file Constant.php.

93  {
94  $this->setHolder($holder);
95  $this->setPraspelRepresentation($praspel);
96  $this->setDeclaration($declaration);
97 
98  return;
99  }
setPraspelRepresentation(\Closure $praspel)
Definition: Constant.php:175
setHolder(Realdom\IRealdom\Holder $holder)
Definition: Constant.php:107
setDeclaration(Praspel\Model\Declaration $declaration)
Definition: Constant.php:199

Here is the call graph for this function:

Member Function Documentation

Hoa\Realdom\Crate\Constant::accept ( Visitor\Visit  $visitor,
$handle = null,
  $eldnah = null 
)

Accept a visitor.

Parameters
\Hoa\Visitor\Visit$visitorVisitor.
mixed&$handleHandle (reference).
mixed$eldnahHandle (no reference).
Returns
mixed

Definition at line 235 of file Constant.php.

239  {
240  return $visitor->visit($this, $handle, $eldnah);
241  }
Hoa\Realdom\Crate\Constant::getConstantRepresentation ( )

Get representation of the realistic domain.

Returns
string

Implements Hoa\Realdom\IRealdom\Constant.

Definition at line 222 of file Constant.php.

223  {
224  return '';
225  }
Hoa\Realdom\Crate\Constant::getConstantValue ( )

Get constant value.

Returns
mixed

Implements Hoa\Realdom\IRealdom\Constant.

Definition at line 164 of file Constant.php.

165  {
166  return $this->getHolder()->getValue();
167  }

Here is the call graph for this function:

Hoa\Realdom\Crate\Constant::getDeclaration ( )

Get original declaration object.

Returns

Definition at line 212 of file Constant.php.

213  {
214  return $this->_declaration;
215  }
Hoa\Realdom\Crate\Constant::getHolder ( )

Get holder.

Returns

Definition at line 120 of file Constant.php.

121  {
122  return $this->_holder;
123  }

Here is the caller graph for this function:

Hoa\Realdom\Crate\Constant::getPraspelRepresentation ( )

Get Praspel representation.

Returns

Definition at line 188 of file Constant.php.

189  {
191  }
Hoa\Realdom\Crate\Constant::getTypes ( )

Get crate types.

Returns
array
Exceptions

Implements Hoa\Realdom\IRealdom\Crate.

Definition at line 131 of file Constant.php.

132  {
133  $held = $this->getHolder()->getHeld();
134  $out = [];
135  $prefix = 'Hoa\Realdom\\';
136 
137  foreach ($held as $realdom) {
138  if ($realdom instanceof Realdom\RealdomArray) {
139  $out[] = $prefix . 'Constarray';
140  } elseif ($realdom instanceof Realdom\Boolean) {
141  $out[] = $prefix . 'Constboolean';
142  } elseif ($realdom instanceof Realdom\RealdomFloat) {
143  $out[] = $prefix . 'Constfloat';
144  } elseif ($realdom instanceof Realdom\Integer) {
145  $out[] = $prefix . 'Constinteger';
146  } elseif ($realdom instanceof Realdom\RealdomString) {
147  $out[] = $prefix . 'Conststring';
148  } else {
149  throw new Realdom\Exception(
150  'Cannot determine the type.',
151  0
152  );
153  }
154  }
155 
156  return $out;
157  }

Here is the call graph for this function:

Hoa\Realdom\Crate\Constant::setDeclaration ( Praspel\Model\Declaration  $declaration)

Set original declaration object.

Parameters
\Hoa\Praspel\Model\Declaration$declarationDeclaration.
Returns

Definition at line 199 of file Constant.php.

200  {
201  $old = $this->_declaration;
202  $this->_declaration = $declaration;
203 
204  return $old;
205  }

Here is the caller graph for this function:

Hoa\Realdom\Crate\Constant::setHolder ( Realdom\IRealdom\Holder  $holder)
protected

Set holder.

Parameters
\Hoa\Realdom\IRealdom\Holder$holderHolder.
Returns

Definition at line 107 of file Constant.php.

108  {
109  $old = $this->_holder;
110  $this->_holder = $holder;
111 
112  return $old;
113  }

Here is the caller graph for this function:

Hoa\Realdom\Crate\Constant::setPraspelRepresentation ( \Closure  $praspel)
protected

Set Praspel representation.

Parameters
\Closure$praspelPraspel representation.
Returns

Definition at line 175 of file Constant.php.

176  {
178  $this->_praspelRepresentation = $praspel;
179 
180  return $old;
181  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\Realdom\Crate\Constant::$_declaration = null
protected

Definition at line 74 of file Constant.php.

Hoa\Realdom\Crate\Constant::$_holder = null
protected

Definition at line 60 of file Constant.php.

Hoa\Realdom\Crate\Constant::$_praspelRepresentation = null
protected

Definition at line 67 of file Constant.php.


The documentation for this class was generated from the following file: