Skip to content

Commit

Permalink
Added missing docblock comments, enforce boolean types
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Mar 18, 2012
1 parent 14cbf60 commit 6884c9d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/staticbuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,36 @@ class StaticBuilder extends AutoloadBuilder {
protected $phar;
protected $require = 'require';

/**
* Setter for Dependency Array
* @param array $dep Dependency Array from classfinder
*/
public function setDependencies(Array $dep) {
$this->dependencies = $dep;
}

/**
* Toggle phar outut mode
*
* @param boolean $phar
*/
public function setPharMode($phar) {
$this->phar = $phar;
$this->phar = (boolean)$phar;
}

/**
* Toggle wether or not to use require_once over require
*
* @param boolean $mode
*/
public function setRequireOnce($mode) {
$this->require = $mode=='once' ? 'require_once' : 'require';
$this->require = (boolean)$mode ? 'require_once' : 'require';
}

/**
* (non-PHPdoc)
* @see TheSeer\Autoload.AutoloadBuilder::render()
*/
public function render() {
$baseDir = '';
if ($this->phar) {
Expand All @@ -84,6 +99,11 @@ public function render() {
return str_replace(array_keys($replace), array_values($replace), $this->template);
}

/**
* Helper to sort classes/interfaces and traits based on their depdendency info
*
* @return array
*/
protected function sortByDependency() {
$sorter = new ClassDependencySorter($this->classes, $this->dependencies);
$list = $sorter->process();
Expand Down

0 comments on commit 6884c9d

Please sign in to comment.