Skip to content

Commit

Permalink
redone goals name -> goalName
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jun 27, 2015
1 parent e731acd commit 233d4be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions goals/ConfigGoal.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public function getItemClass($name = null, array $config = [])
public function getItemConfig($name = null, array $config = [])
{
return array_merge([
'class' => $this->getItemClass($name, $config),
'name' => $name,
'class' => $this->getItemClass($name, $config),
'goalName' => $name,
], $config);
}

Expand Down
15 changes: 5 additions & 10 deletions goals/DefaultGoal.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DefaultGoal extends BaseGoal
{
protected $_itemClass = 'hiqdev\collection\Manager';

public $goal;
public $goalName;

public $done = false;

Expand All @@ -37,11 +37,6 @@ public function setFileType($type)
$this->_fileType = $type;
}

public function getName()
{
return (string) $this->rawItem('name');
}

public function setDeps($deps)
{
$res = $this->getDeps();
Expand All @@ -68,24 +63,24 @@ public function actionDeps()
public function actionPerform()
{
if ($this->done) {
Yii::trace("Already done: $this->name");
Yii::trace("Already done: $this->goalName");

return;
}
Yii::trace("Started: $this->name");
Yii::trace("Started: $this->goalName");
$this->actionDeps();
$this->actionMake();
$this->done = true;
}

public function actionLoad()
{
Yii::trace("Loading nothing for '$this->name'");
Yii::trace("Loading nothing for '$this->goalName'");
}

public function actionSave()
{
Yii::trace("Saving nothing for '$this->name'");
Yii::trace("Saving nothing for '$this->goalName'");
}

public function actionMake()
Expand Down
4 changes: 2 additions & 2 deletions goals/FileGoal.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function setTemplate($template)

public function getTemplate()
{
return Helper::file2template($this->_template ?: $this->name);
return Helper::file2template($this->_template ?: $this->goalName);
}

/**
Expand All @@ -49,7 +49,7 @@ public function getFile()
if (!is_object($this->_file)) {
if (!is_array($this->_file)) {
$this->_file = [
'path' => $this->_file ?: $this->name,
'path' => $this->_file ?: $this->goalName,
];
}
$this->_file = Yii::createObject(array_merge([
Expand Down

0 comments on commit 233d4be

Please sign in to comment.