-
-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More flexible --dev / --no-dev logic (#1520)
- Loading branch information
1 parent
30fc39f
commit 31e835c
Showing
6 changed files
with
119 additions
and
31 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,32 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Zephir. | ||
* | ||
* (c) Zephir Team <team@zephir-lang.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Zephir\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
interface DevelopmentModeAwareInterface | ||
{ | ||
/** | ||
* Returns the development mode for the command. | ||
* | ||
* @return string | ||
*/ | ||
public function getDevelopmentModeHelp(); | ||
|
||
/** | ||
* Checks if the development mode is enabled. | ||
* | ||
* @param InputInterface $input | ||
* @return bool | ||
*/ | ||
public function isDevelopmentModeEnabled(InputInterface $input); | ||
} |
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,37 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the Zephir. | ||
* | ||
* (c) Zephir Team <team@zephir-lang.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Zephir\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
/** | ||
* Zephir\Command\DevelopmentModeAwareTrait | ||
* | ||
* @package Zephir\Command | ||
*/ | ||
trait DevelopmentModeAwareTrait | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
* | ||
* @param InputInterface $input | ||
* @return bool | ||
*/ | ||
public function isDevelopmentModeEnabled(InputInterface $input) | ||
{ | ||
if ($input->getOption('no-dev') == false) { | ||
return $input->getOption('dev') || PHP_DEBUG; | ||
} | ||
|
||
return false; | ||
} | ||
} |
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