1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-16 15:01:08 +03:00

Fix the new migration template

- The Kohana PHP security line now properly has a newline at the end of
   it
 - The new migration template view now also contains a newline at the
   begining so that classes and the PHP opening line aren't all smushed
   together
 - Added the parameter name to the @param tag so phpcs stops complaining
This commit is contained in:
Evan Purkhiser 2012-05-25 21:57:11 -04:00
parent 916268f2cb
commit 5e2d050247
2 changed files with 5 additions and 3 deletions

3
classes/minion/task/migrations/new.php Normal file → Executable file
View file

@ -87,7 +87,8 @@ class Minion_Task_Migrations_New extends Minion_Task
$file = $this->_generate_filename($location, $group, $time, $description);
$data = Kohana::FILE_SECURITY.View::factory('minion/task/migrations/new/template')
$data = Kohana::FILE_SECURITY.PHP_EOL.
View::factory('minion/task/migrations/new/template')
->set('class', $class)
->set('description', $description)
->set('up', $up)

5
views/minion/task/migrations/new/template.php Normal file → Executable file
View file

@ -1,3 +1,4 @@
<?php if(!empty($description)): ?>
/**
* <?php echo $description.PHP_EOL; ?>
@ -8,7 +9,7 @@ class <?php echo $class; ?> extends Minion_Migration_Base {
/**
* Run queries needed to apply this migration
*
* @param Kohana_Database Database connection
* @param Kohana_Database $db Database connection
*/
public function up(Kohana_Database $db)
{
@ -23,7 +24,7 @@ class <?php echo $class; ?> extends Minion_Migration_Base {
/**
* Run queries needed to remove this migration
*
* @param Kohana_Database Database connection
* @param Kohana_Database $db Database connection
*/
public function down(Kohana_Database $db)
{