Skip to content

Commit

Permalink
Tweak APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksleight committed Jul 2, 2015
1 parent e1d8165 commit c381883
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions lib/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class App implements Executable
protected $_baseDir;

/**
* Subapp.
* Is subapp.
* @var boolean
*/
protected $_subapp = false;
protected $_isSubapp = false;

/**
* Environment variables.
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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, [
Expand Down

0 comments on commit c381883

Please sign in to comment.