Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Console] implemented helpers and moved formatter and ask* methods to…
… their own helpers
- Loading branch information
Showing
8 changed files
with
389 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Symfony\Components\Console\Helper; | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* Helper is the base class for all helper classes. | ||
* | ||
* @package symfony | ||
* @subpackage templating | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
*/ | ||
abstract class Helper implements HelperInterface | ||
{ | ||
protected | ||
$helperSet = null; | ||
|
||
/** | ||
* Sets the helper set associated with this helper. | ||
* | ||
* @param HelperSet $helperSet A HelperSet instance | ||
*/ | ||
public function setHelperSet(HelperSet $helperSet = null) | ||
{ | ||
$this->helperSet = $helperSet; | ||
} | ||
|
||
/** | ||
* Gets the helper set associated with this helper. | ||
* | ||
* @return HelperSet A HelperSet instance | ||
*/ | ||
public function getHelperSet() | ||
{ | ||
return $this->helperSet; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Symfony\Components\Console\Helper; | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* HelperInterface is the interface all helpers must implement. | ||
* | ||
* @package symfony | ||
* @subpackage templating | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
*/ | ||
interface HelperInterface | ||
{ | ||
/** | ||
* Returns the canonical name of this helper. | ||
* | ||
* @return string The canonical name | ||
*/ | ||
function getName(); | ||
|
||
/** | ||
* Sets the helper set associated with this helper. | ||
* | ||
* @param HelperSet $helperSet A HelperSet instance | ||
*/ | ||
function setHelperSet(HelperSet $helperSet = null); | ||
|
||
/** | ||
* Gets the helper set associated with this helper. | ||
* | ||
* @return HelperSet A HelperSet instance | ||
*/ | ||
function getHelperSet(); | ||
} |
Oops, something went wrong.