Skip to content

Commit

Permalink
Moving the traits files
Browse files Browse the repository at this point in the history
It made no sense to put them where they were, so Ive moved them and
updated all the tests, On a close inspection they seem to be a
hinderance in traits more than anything, So I am going to be making them
As Classes and introducing a helper system to the application. This will
allow all helpers to be contained properly, used without `use`
statements and be highly extendable/configurable by the user with little
ease.
  • Loading branch information
Danzabar committed Jan 24, 2015
1 parent bd2cc78 commit d22faa8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function __construct($DI = NULL, $dispatcher = NULL, $library = NULL)
// Add the output and input streams to the DI
$this->di->setShared('output', new Output);
$this->di->setShared('input', new Input);
$this->di->setShared('console', $this);

$this->prepper = new TaskPrepper($this->di);
}
Expand Down Expand Up @@ -129,8 +130,8 @@ public function start($args = Array())
public function add($command)
{
$tasks = $this->prepper
->load(get_class($command))
->describe();
->load(get_class($command))
->describe();

$this->library->add(['task' => $tasks, 'class' => $command]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace Danzabar\CLI\Traits;
<?php namespace Danzabar\CLI\Tasks\Traits;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Question.php → src/Tasks/Traits/Question.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace Danzabar\CLI\Traits;
<?php namespace Danzabar\CLI\Tasks\Traits;

/**
* The question trait allows you to ask a selection of questions.
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Table.php → src/Tasks/Traits/Table.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace Danzabar\CLI\Traits;
<?php namespace Danzabar\CLI\Tasks\Traits;

/**
* The table trait lets to create tables by passing arrays
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/FakeTask.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Danzabar\CLI\Tasks\Task,
Danzabar\CLI\Traits,
Danzabar\CLI\Tasks\Traits,
Danzabar\CLI\Input\InputArgument,
Danzabar\CLI\Input\InputOption;

Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/InputTask.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Danzabar\CLI\Tasks\Task,
Danzabar\CLI\Traits,
Danzabar\CLI\Tasks\Traits,
Danzabar\CLI\Input\InputArgument,
Danzabar\CLI\Input\InputOption;

Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/UtilityTask.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Danzabar\CLI\Tasks\Task,
Danzabar\CLI\Traits;
Danzabar\CLI\Tasks\Traits;

/**
* The utility task
Expand Down
2 changes: 1 addition & 1 deletion tests/Tasks/Traits/TableTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Danzabar\CLI\CommandTester,
Danzabar\CLI\Traits\Table;
Danzabar\CLI\Tasks\Traits\Table;

/**
* Test case for the table trait
Expand Down

0 comments on commit d22faa8

Please sign in to comment.