-
-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #97 New make:migration command (weaverryan)
This PR was squashed before being merged into the 1.0-dev branch (closes #97). Discussion ---------- New make:migration command This replaces #10. There are 2 cases: (A) When there ARE schema changes: <img width="1053" alt="screen shot 2017-12-29 at 11 07 47 pm" src="https://user-images.githubusercontent.com/121003/34451290-9b0c9bb0-ecef-11e7-9a1d-41ba78c84638.png"> (B) When there are NOT schema changes: <img width="1269" alt="screen shot 2017-12-29 at 11 07 14 pm" src="https://user-images.githubusercontent.com/121003/34451291-a617113e-ecef-11e7-979f-c30f2cc3e91e.png"> This includes a BC break on `MakerInterface`, but it will only affect people who have created custom makers (and they'll get a clear error). Commits ------- f2e25e9 tweaking message 95af9fa Adding make:migration, which includes reworking MakerInterface
- Loading branch information
Showing
30 changed files
with
524 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ composer.lock | |
phpunit.xml | ||
vendor/ | ||
tests/tmp/* | ||
.php_cs.cache |
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,8 @@ | ||
1.1 | ||
=== | ||
|
||
* [BC BREAK] The MakerInterface changed: `writeNextStepsMessage` | ||
was renamed to `writeSuccessMessage`. You should now extend | ||
`AbstractMaker` instead of implementing the interface directly, | ||
and use `parent::writeSuccessMessage()` to get the normal success | ||
message after the command. |
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,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\MakerBundle; | ||
|
||
use Symfony\Component\Console\Application; | ||
|
||
/** | ||
* Implement this interface if your Maker needs access to the Application. | ||
* | ||
* @author Ryan Weaver <ryan@knpuniversity.com> | ||
*/ | ||
interface ApplicationAwareMakerInterface | ||
{ | ||
/** | ||
* @param Application $application | ||
*/ | ||
public function setApplication(Application $application); | ||
} |
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,25 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\MakerBundle; | ||
|
||
/** | ||
* Interface to do extra code generation in a maker. | ||
* | ||
* @author Ryan Weaver <ryan@knpuniversity.com> | ||
*/ | ||
interface ExtraGenerationMakerInterface | ||
{ | ||
/** | ||
* Called after normal code generation. | ||
*/ | ||
public function afterGenerate(ConsoleStyle $io, array $params); | ||
} |
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,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\MakerBundle\Maker; | ||
|
||
use Symfony\Bundle\MakerBundle\ConsoleStyle; | ||
use Symfony\Bundle\MakerBundle\MakerInterface; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
/** | ||
* Convenient abstract class for makers. | ||
*/ | ||
abstract class AbstractMaker implements MakerInterface | ||
{ | ||
public function interact(InputInterface $input, ConsoleStyle $io, Command $command) | ||
{ | ||
} | ||
|
||
public function writeSuccessMessage(array $params, ConsoleStyle $io) | ||
{ | ||
$io->newLine(); | ||
$io->writeln(' <bg=green;fg=white> </>'); | ||
$io->writeln(' <bg=green;fg=white> Success! </>'); | ||
$io->writeln(' <bg=green;fg=white> </>'); | ||
$io->newLine(); | ||
} | ||
} |
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
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
Oops, something went wrong.