File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,22 @@ abstract class CodegenFunctionish implements ICodeBuilderRenderer {
8585 return $this ;
8686 }
8787
88+ /* * Set or remove the contexts.
89+ *
90+ * - if passed `null`, the function or method will not contain a contexts
91+ * declaration, e.g. `function foo(): void {}`; this is equivalent to
92+ * `function foo()[defaults]: void {}`
93+ * - if passed the empty set (e.g. `keyset[]`), the function will have an
94+ * empty contexts declaration, e.g. `function foo()[]: void {}`. This is
95+ * considered to be an approximation of declaration pure functions.
96+ */
97+ public function setContexts (
98+ ?Container <string > $contexts ,
99+ ): this {
100+ $this -> contexts = ($contexts is null ) ? null : keyset ($contexts );
101+ return $this ;
102+ }
103+
88104 public function setReturnType (string $type ): this {
89105 return $this -> setReturnTypef(' %s' , $type );
90106 }
You can’t perform that action at this time.
0 commit comments