/*
* This file is part of Psy Shell.
*
- * (c) 2012-2017 Justin Hileman
+ * (c) 2012-2018 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
/**
* Language construct parameter definitions.
*/
- private static $languageConstructs = array(
- 'isset' => array(
- 'var' => array(),
- '...' => array(
+ private static $languageConstructs = [
+ 'isset' => [
+ 'var' => [],
+ '...' => [
'isOptional' => true,
'defaultValue' => null,
- ),
- ),
+ ],
+ ],
- 'unset' => array(
- 'var' => array(),
- '...' => array(
+ 'unset' => [
+ 'var' => [],
+ '...' => [
'isOptional' => true,
'defaultValue' => null,
- ),
- ),
+ ],
+ ],
- 'empty' => array(
- 'var' => array(),
- ),
+ 'empty' => [
+ 'var' => [],
+ ],
- 'echo' => array(
- 'arg1' => array(),
- '...' => array(
+ 'echo' => [
+ 'arg1' => [],
+ '...' => [
'isOptional' => true,
'defaultValue' => null,
- ),
- ),
+ ],
+ ],
- 'print' => array(
- 'arg' => array(),
- ),
+ 'print' => [
+ 'arg' => [],
+ ],
- 'die' => array(
- 'status' => array(
+ 'die' => [
+ 'status' => [
'isOptional' => true,
'defaultValue' => 0,
- ),
- ),
+ ],
+ ],
- 'exit' => array(
- 'status' => array(
+ 'exit' => [
+ 'status' => [
'isOptional' => true,
'defaultValue' => 0,
- ),
- ),
- );
+ ],
+ ],
+ ];
/**
* Construct a ReflectionLanguageConstruct object.
*
- * @param string $name
+ * @param string $keyword
*/
public function __construct($keyword)
{
/**
* Get language construct params.
*
- * @return
+ * @return array
*/
public function getParameters()
{
- $params = array();
+ $params = [];
foreach (self::$languageConstructs[$this->keyword] as $parameter => $opts) {
array_push($params, new ReflectionLanguageConstructParameter($this->keyword, $parameter, $opts));
}
/**
* Check whether keyword is a (known) language construct.
*
- * @param $keyword
+ * @param string $keyword
*
* @return bool
*/