testphase
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Phramework
    • Exceptions
    • Testphase
      • Exceptions
    • Validate

Classes

  • Binary
  • Expression
  • Globals
  • Server
  • TestParser
  • Testphase
  • Util

Class Expression

Expression methods and constants

Namespace: Phramework\Testphase
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Version: 1.0.0
Since: 1.0.0
Located at Expression.php

Methods summary

public static string[4]
# getPrefixSuffix( string $expressionType = Expression::EXPRESSION_TYPE_PLAIN )

Get prefix and suffix

Get prefix and suffix

Parameters

$expressionType

Returns

string[4]
Returns the expression type prefix, suffix, pattern prefix and suffix.

Example

list(
    $prefix,
    $suffix,
    $patternPrefix,
    $patternSuffix
) = Expression::getPrefixSuffix(Expression::EXPRESSION_TYPE_INLINE_REPLACE);

public static string
# getExpression( string $expressionType = Expression::EXPRESSION_TYPE_PLAIN )

Parameters

$expressionType

Returns

string
Returns regular expession
public static null|object
# parse( $value )

Parameters

$value

Returns

null|object

Example

$parsed = Expression::parse('myFunction(10)');

print_r($parsed);

//Will output
//stdClass Object
//(
//    [key] => myFunction
//    [mode] => function
//    [parameters] => [6]
//)

Constants summary

string EXPRESSION_TYPE_PLAIN

Expression of plain type

Expression of plain type

# 'plain'
string EXPRESSION_TYPE_REPLACE

Expression of type "replace", used to replace the whole key with expression value.

Expression of type "replace", used to replace the whole key with expression value.

# 'replace'
string EXPRESSION_TYPE_INLINE_REPLACE

Expression of type "inline_replace", used to inline replace the key with the expression value.

Expression of type "inline_replace", used to inline replace the key with the expression value.

# 'inline_replace'
string PATTERN_KEY

Regular expression pattern of keys

Regular expression pattern of keys

# '[a-zA-Z][a-zA-Z0-9\-_]{1,}'
string PATTERN_FUNCTION_PARAMETER

Regular expression pattern of function parameters

Regular expression pattern of function parameters

# '[a-zA-Z][a-zA-Z0-9\-_]{1,}|([\'\"]?)[a-zA-Z0-9\-_]{1,}\5'
string PATTERN_ARRAY_INDEX

Regular expression pattern of array indices

Regular expression pattern of array indices

# '[a-zA-Z][a-zA-Z0-9\-_]{1,}|[1-9]*[0-9]'
testphase API documentation generated by ApiGen