Browse Source

Shorten behavior methods.

Use 5.4 features to make methods shorter. Stop accessing _config
directly and instead use the getter method. If anyone modifies the
behavior of config() we should respect those changes.
mark_story 11 years ago
parent
commit
0fa5a8428b
1 changed files with 8 additions and 8 deletions
  1. 8 8
      src/ORM/Behavior.php

+ 8 - 8
src/ORM/Behavior.php

@@ -212,12 +212,12 @@ class Behavior implements EventListener {
  * @return array
  */
 	public function implementedFinders() {
-		if (isset($this->_config['implementedFinders'])) {
-			return $this->_config['implementedFinders'];
+		$methods = $this->config('implementedFinders');
+		if (isset($methods)) {
+			return $methods;
 		}
 
-		$reflectionMethods = $this->_reflectionCache();
-		return $reflectionMethods['finders'];
+		return $this->_reflectionCache()['finders'];
 	}
 
 /**
@@ -242,12 +242,12 @@ class Behavior implements EventListener {
  * @return array
  */
 	public function implementedMethods() {
-		if (isset($this->_config['implementedMethods'])) {
-			return $this->_config['implementedMethods'];
+		$methods = $this->config('implementedMethods');
+		if (isset($methods)) {
+			return $methods;
 		}
 
-		$reflectionMethods = $this->_reflectionCache();
-		return $reflectionMethods['methods'];
+		return $this->_reflectionCache()['methods'];
 	}
 
 /**