PHP Class Fenos\Notifynder\Parsers\NotifynderParser

Show file Open project: fenos/notifynder Class Usage Examples

Protected Properties

Property Type Description
$strictMode boolean By default it's false.

Public Methods

Method Description
parse ( $item ) : string Parse the body of a notification with your extras values or relation values.
setStrictExtra ( boolean | true $set = true ) Set strict mode.

Protected Methods

Method Description
extraToArray ( $extra ) : array | mixed Trying to transform extra in from few data types to array type.
getValues ( $body ) : mixed Get the values between {} and return an array of it.
isJson ( $value ) : boolean Check if is a json string.
mixedGet ( array | object $object, string $key, null $default = null ) : mixed Get a value by dot-key of an array, object or mix of both.
replaceBody ( $body, $valueMatch, $replacer ) : mixed Replace body of the category.

Method Details

extraToArray() protected method

Trying to transform extra in from few data types to array type.
protected extraToArray ( $extra ) : array | mixed
$extra
return array | mixed

getValues() protected method

Get the values between {} and return an array of it.
protected getValues ( $body ) : mixed
$body
return mixed

isJson() protected method

Check if is a json string.
protected isJson ( $value ) : boolean
$value
return boolean

mixedGet() protected method

Get a value by dot-key of an array, object or mix of both.
protected mixedGet ( array | object $object, string $key, null $default = null ) : mixed
$object array | object
$key string
$default null
return mixed

parse() public method

Parse the body of a notification with your extras values or relation values.
public parse ( $item ) : string
$item
return string

replaceBody() protected method

Replace body of the category.
protected replaceBody ( $body, $valueMatch, $replacer ) : mixed
$body
$valueMatch
$replacer
return mixed

setStrictExtra() public static method

if it's enabled then will throws exceptions when extra params will not be parsed correctly will be handy in development.
public static setStrictExtra ( boolean | true $set = true )
$set boolean | true

Property Details

$strictMode protected static property

By default it's false.
protected static bool $strictMode
return boolean