From c381883a180dae4d4aa02126083a948d62b4ab3a Mon Sep 17 00:00:00 2001 From: Jack Sleight Date: Thu, 2 Jul 2015 13:22:45 +0100 Subject: [PATCH] Tweak APIs. --- lib/App.php | 16 ++++++++-------- lib/View.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/App.php b/lib/App.php index ae04042..30738e5 100644 --- a/lib/App.php +++ b/lib/App.php @@ -30,10 +30,10 @@ class App implements Executable protected $_baseDir; /** - * Subapp. + * Is subapp. * @var boolean */ - protected $_subapp = false; + protected $_isSubapp = false; /** * Environment variables. @@ -96,16 +96,16 @@ public function baseDir($baseDir = null) } /** - * Get/set subapp. + * Get/set is subapp. * @return boolean */ - public function subapp($subapp = null) + public function isSubapp($isSubapp = null) { if (func_num_args() > 0) { - $this->_subapp = $subapp; + $this->_isSubapp = $isSubapp; return $this; } - return $this->_subapp; + return $this->_isSubapp; } /** @@ -257,7 +257,7 @@ public function executable($executable, $subpath = null) if (isset($subpath)) { $executable = new App\Subpath($executable, $subpath); } else if ($executable instanceof App) { - $executable->subapp(true); + $executable->isSubapp(true); } array_push($this->_executables, $executable instanceof \Closure ? $executable->bindTo($this) @@ -294,7 +294,7 @@ public function execute(Request $req = null, Response $res = null) break; } } - if ($result === false || (!isset($result) && !$this->_subapp)) { + if ($result === false || (!isset($result) && !$this->_isSubapp)) { if (isset($this->_notFoundHandler)) { $result = call_user_func($this->_notFoundHandler, $req, $res); } else { diff --git a/lib/View.php b/lib/View.php index ba506f4..0715278 100644 --- a/lib/View.php +++ b/lib/View.php @@ -59,7 +59,7 @@ public function extName($extName = null) return $this->_extName; } - public function valid($name, $set = null) + public function isValid($name, $set = null) { if (!isset($set)) { reset($this->_dirs); @@ -241,7 +241,7 @@ public function execute(\Coast\Request $req, \Coast\Response $res) { $path = $req->path(); $path = '/' . (strlen($path) ? $path : 'index'); - if (!$this->valid($path)) { + if (!$this->isValid($path)) { return false; } return $res->html($this->render($path, [