PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 3.8.9
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v3.8.9
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
betterdocs / includes / Dependencies / PhpParser / Node / Expr / Closure.php

Closure.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 3.8.9, at includes/Dependencies/PhpParser/Node/Expr/Closure.php

66 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPDeveloper\BetterDocs\Dependencies\PhpParser\Node\Expr;
4
5 use WPDeveloper\BetterDocs\Dependencies\PhpParser\Node;
6 use WPDeveloper\BetterDocs\Dependencies\PhpParser\Node\Expr;
7 use WPDeveloper\BetterDocs\Dependencies\PhpParser\Node\FunctionLike;
8
9 class Closure extends Expr implements FunctionLike
10 {
11 /** @var bool Whether the closure is static */
12 public $static;
13 /** @var bool Whether to return by reference */
14 public $byRef;
15 /** @var Node\Param[] Parameters */
16 public $params;
17 /** @var ClosureUse[] use()s */
18 public $uses;
19 /** @var null|string|Node\Name|Node\NullableType Return type */
20 public $returnType;
21 /** @var Node[] Statements */
22 public $stmts;
23
24 /**
25 * Constructs a lambda function node.
26 *
27 * @param array $subNodes Array of the following optional subnodes:
28 * 'static' => false : Whether the closure is static
29 * 'byRef' => false : Whether to return by reference
30 * 'params' => array(): Parameters
31 * 'uses' => array(): use()s
32 * 'returnType' => null : Return type
33 * 'stmts' => array(): Statements
34 * @param array $attributes Additional attributes
35 */
36 public function __construct(array $subNodes = array(), array $attributes = array()) {
37 parent::__construct($attributes);
38 $this->static = isset($subNodes['static']) ? $subNodes['static'] : false;
39 $this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
40 $this->params = isset($subNodes['params']) ? $subNodes['params'] : array();
41 $this->uses = isset($subNodes['uses']) ? $subNodes['uses'] : array();
42 $this->returnType = isset($subNodes['returnType']) ? $subNodes['returnType'] : null;
43 $this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
44 }
45
46 public function getSubNodeNames() {
47 return array('static', 'byRef', 'params', 'uses', 'returnType', 'stmts');
48 }
49
50 public function returnsByRef() {
51 return $this->byRef;
52 }
53
54 public function getParams() {
55 return $this->params;
56 }
57
58 public function getReturnType() {
59 return $this->returnType;
60 }
61
62 public function getStmts() {
63 return $this->stmts;
64 }
65 }
66