Permalink
Browse files

Optimize helper event listeners.

Most of the core helpers don't use event listeners. Stubbing out the
methods saves 6 calls to method_exists() per helper.
  • Loading branch information...
1 parent 01704a4 commit 8cbdfac10d10a8f2f0cd1f22ec253a7bb921c26d @markstory markstory committed Mar 5, 2014
@@ -2171,4 +2171,13 @@ public function widget($name, array $data = []) {
return $this->_registry->get($name)->render($data);
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}
@@ -1237,4 +1237,13 @@ public function loadConfig($configFile, $path = null) {
return $configs;
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}
@@ -218,4 +218,13 @@ public function defaultCurrency($currency) {
return $this->_engine->defaultCurrency($currency);
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}
@@ -808,4 +808,13 @@ public function last($last = 'last >>', $options = array()) {
return $out;
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return ['View.beforeRender' => 'beforeRender'];
+ }
+
}
@@ -351,4 +351,13 @@ public function elem($name, $attrib = array(), $content = null, $endTag = true)
return $xml;
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}
@@ -158,4 +158,13 @@ public function valid() {
return Session::valid();
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}
@@ -325,4 +325,13 @@ public function toList($list, $and = 'and', $separator = ', ') {
return $this->_engine->toList($list, $and, $separator);
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}
@@ -446,4 +446,13 @@ public function i18nFormat($date, $format = null, $invalid = false, $timezone =
return $this->_engine->i18nFormat($date, $format, $invalid, $timezone);
}
+/**
+ * Event listeners.
+ *
+ * @return array
+ */
+ public function implementedEvents() {
+ return [];
+ }
+
}

0 comments on commit 8cbdfac

Please sign in to comment.