forked from fprochazka/phpstorm-livetemplates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nette.icls
64 lines (63 loc) · 7.5 KB
/
Nette.icls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Nette">
<template name="com" value="/** * @return $CLASS$ */ protected function createComponent$NAME$() { return new $CLASS$($ARGS$);$END$ }" description="component factory" toReformat="true" toShortenFQNames="true">
<variable name="CLASS" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
<variable name="ARGS" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="sig" value="/***/ public function handle$NAME$($PARAMS$) { $END$ }" description="signal factory" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="att" value="/** * @param \Nette\ComponentModel\Container $obj */ protected function attached($obj) { 	parent::attached($obj); 	if (!$obj instanceof \Nette\Application\UI\Presenter) { 		return; 	} 	$END$ }" description="component attached event" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="obj" value="	/*************************** Nette\Object ***************************/ 	/** 	 * Access to reflection. 	 * @return \Nette\Reflection\ClassType 	 */ 	public static function getReflection() 	{ 		return new Nette\Reflection\ClassType(get_called_class()); 	} 	/** 	 * Call to undefined method. 	 * 	 * @param string $name 	 * @param array $args 	 * 	 * @throws \Nette\MemberAccessException 	 * @return mixed 	 */ 	public function __call($name, $args) 	{ 		return Nette\ObjectMixin::call($this, $name, $args); 	} 	/** 	 * Call to undefined static method. 	 * 	 * @param string $name 	 * @param array $args 	 * 	 * @throws \Nette\MemberAccessException 	 * @return mixed 	 */ 	public static function __callStatic($name, $args) 	{ 		return Nette\ObjectMixin::callStatic(get_called_class(), $name, $args); 	} 	/** 	 * Adding method to class. 	 * 	 * @param $name 	 * @param null $callback 	 * 	 * @throws \Nette\MemberAccessException 	 * @return callable|null 	 */ 	public static function extensionMethod($name, $callback = NULL) 	{ 		if (strpos($name, '::') === FALSE) { 			$class = get_called_class(); 		} else { 			list($class, $name) = explode('::', $name); 		} 		if ($callback === NULL) { 			return Nette\ObjectMixin::getExtensionMethod($class, $name); 		} else { 			Nette\ObjectMixin::setExtensionMethod($class, $name, $callback); 		} 	} 	/** 	 * Returns property value. Do not call directly. 	 * 	 * @param string $name 	 * 	 * @throws \Nette\MemberAccessException 	 * @return mixed 	 */ 	public function &__get($name) 	{ 		return Nette\ObjectMixin::get($this, $name); 	} 	/** 	 * Sets value of a property. Do not call directly. 	 * 	 * @param string $name 	 * @param mixed $value 	 * 	 * @throws \Nette\MemberAccessException 	 * @return void 	 */ 	public function __set($name, $value) 	{ 		Nette\ObjectMixin::set($this, $name, $value); 	} 	/** 	 * Is property defined? 	 * 	 * @param string $name 	 * 	 * @return bool 	 */ 	public function __isset($name) 	{ 		return Nette\ObjectMixin::has($this, $name); 	} 	/** 	 * Access to undeclared property. 	 * 	 * @param string $name 	 * 	 * @throws \Nette\MemberAccessException 	 * @return void 	 */ 	public function __unset($name) 	{ 		Nette\ObjectMixin::remove($this, $name); 	}" description="Nette\Object mixin" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="inj" value="/** * @param $HINT$ $$$SERVICE$ */ public function inject$SERVICE_UPER$($HINT$ $$$SERVICE$) { $this->$SERVICE$ = $$$SERVICE$;$END$ }" description="inject function" toReformat="true" toShortenFQNames="true">
<variable name="SERVICE" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HINT" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
<variable name="SERVICE_UPER" expression="capitalize(SERVICE)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="sup" value="protected function startup() { parent::startup(); $END$ }" description="startup method" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="form" value="/** * @return $FORM_CLASS$ */ protected function createComponent$NAME$() { 	$$form = new $FORM_CLASS$(); 	$END$ $$form->addSubmit("send", "Odeslat"); 	$$form->onSuccess[] = $this->$HANDLER$Succeeded; 	return $$form; } /** * @param $FORM_CLASS$ $$form */ public function $HANDLER$Succeeded($FORM_CLASS$ $$form) { 	throw new Nette\NotImplementedException; }" description="Form component factory + handler" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="FORM_CLASS" expression="enum("Form", "UI\\Form", "Nette\\Application\\UI\\Form")" defaultValue="Form" alwaysStopAt="true" />
<variable name="HANDLER" expression="decapitalize(NAME)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="ren" value="public function render$VIEW$($PARAMS$) { 	$END$ }" description="Render method" toReformat="false" toShortenFQNames="true">
<variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="act" value="public function action$ACTION$($PARAMS$) { 	$END$ }" description="Action method" toReformat="false" toShortenFQNames="true">
<variable name="ACTION" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
</templateSet>