File: docs/ReturnClauseMgr.md

Recommend this page to a friend!
  Classes of Kjell-Inge Gustafsson  >  PcGen  >  docs/ReturnClauseMgr.md  >  Download  
File: docs/ReturnClauseMgr.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PcGen
Generate PHP code from parameters
Author: By
Last change: 1.1.25
1.1.14
1.1.11
1.1.7
1.1
Date: 1 month ago
Size: 5,315 bytes
 

Contents

Class file image Download

[comment]: # (This file is part of PcGen, PHP Code Generation support package. Copyright 2020 Kjell-Inge Gustafsson, kigkonsult, All rights reserved, licence GPL 3.0)

ReturnClauseMgr

The `ReturnClauseMgr` manages return code of * source class property or variable (value), opt (int/variable) index * (scalar) fixedSourceValue * PHP expression * single function/method or chained invokes * ex `return $this->property[32];`

Note, return (result from) function/method invoke is managed by [VariableMgr]::setBody() (or [PropertyMgr]) and use of [FcnInvokeMgr]

ReturnClauseMgr Methods

Inherited [Common methods]

* ```class``` _string_ if string, one of null, self, $this, 'otherClass', '$class'
  * convenient constants found in PcGenInterface 
* ```variable``` _string_ variable/property name
  * uppercase is autodetected as CONSTANT
  * variable $-prefixed
* ```index```  _int_|_string_ opt array index, if _string_, index will be $-prefixed 
* For eol and indents, defaults are used
* Return static
* Throws InvalidException

  • `entity` [EntityMgr] * note `EntityMgr` below
  • Return static
  • Throws InvalidException ---
* Return _array_, result code rows (null-bytes removed) no trailing eol
* Throws RuntimeException

  • Return _string_ with code rows (extends toArray), each code row with trailing eol
  • Throws RuntimeException ---
* Return _bool_|_int_|_float_|_string_, scalar

  • Return _bool_ true if not null
* ```fixedSourceValue``` _bool_|_int_|_float_|_string_, scalar
* Return _static_
* Throws InvalidException
---

  • Set a PHP expression
  • `expression` _string_
  • Return _static_
  • Throws InvalidException ---
* Return [EntityMgr]

  • Return _bool_ true if not null
* ```class``` _string_ one of null, self, $this, 'otherClass', '$class'
  * convenient constants found in PcGenInterface 
* ```variable``` _string_ class/variable/property name
  * uppercase is autodetected as CONSTANT
  * variable $-prefixed
* ```index```  _int_|_string_ opt array index, if _string_, index will be $-prefixed 
* Return static
* Throws InvalidArgumentException

  • `entity` [EntityMgr] * note `EntityMgr` below
  • Return static
  • Throws InvalidArgumentException
* convenient shortcut for ```ReturnClauseMgr::setSource()```
* Give source result ```$this->property```
* ```property``` _string_
* ```index```  _int_|_string_ opt array index
* Return static
* Throws InvalidArgumentException

  • convenient shortcut for `ReturnClauseMgr::setSource()`
  • Give source result `$variable`
  • `variable` _string_
  • `index` _int_|_string_ opt array index
  • Return static
  • Throws InvalidArgumentException
 * Results in uppercase constant
* ```isConst``` _bool_
  * true : force ```$class::CONSTANT```
  * false : NOT, (default) ```$class->$constant``` 
* Return _static_


* Results in uppercase constant * `isConst` _bool_ * true : force `$class::variable` * false : NOT, default, `$class->$variable` * Return _static_

* Return ChainInvokeMgr

  • Return _bool_ true if not null
* ```fcnInvoke``` [FcnInvokeMgr]
* Return static
* Throws InvalidArgumentException

  • `fcnInvoke` [FcnInvokeMgr]\[]
  • Return static
  • Throws InvalidArgumentException

Note on chained invokes * The first must have a "class" : parent, self, $this, 'otherClass', '$class' when next is set * All but first must have $this, 'otherClass', '$class'

Ex on _ReturnClauseMgr::setFcnInvoke_ input

[
    FcnInvokeMgr::factory( 'aClass', 'factory', [ 'arg1', 'arg2' ] ),
    FcnInvokeMgr::factory( 'aClass', 'someMethod', [ 'arg3', 'arg4' ] )
]

results in

aClass::factory( $arg1, arg2 )
    ->someMethod( $arg3, arg4 );

Misc

_EntityMgr_ instance creation ([EntityMgr])<br><br>

* ```class```, _string_, one of ```null```, ```self```, ```this```, ```otherClass``` (fqcn), ```$class```
  * convenient constants found in PcGenInterface
* ```fcnName``` _string_, the name
---


<small>Return to PcGen [README], [Summary]</small> 

[ChainInvokeMgr]:ChainInvokeMgr.md
[Common methods]:CommonMethods.md
[EntityMgr]:EntityMgr.md
[FcnInvokeMgr]:FcnInvokeMgr.md
[PropertyMgr]:PropertyMgr.md
[README]:../README.md
[Summary]:Summary.md
[VariableMgr]:VariableMgr.md

For more information send a message to info at phpclasses dot org.