forked from etrepat/baum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require php 7.2 and laravel 6 because of phpunit 8
- Loading branch information
1 parent
f42cd4f
commit 38a822f
Showing
39 changed files
with
6,592 additions
and
6,050 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor | ||
composer.lock | ||
.vscode | ||
.phpunit.result.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
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 |
---|---|---|
@@ -1,34 +1,37 @@ | ||
<?php | ||
|
||
namespace Baum\Console; | ||
|
||
use Illuminate\Console\Command; | ||
use Baum\Providers\BaumServiceProvider as Baum; | ||
|
||
class BaumCommand extends Command { | ||
class BaumCommand extends Command | ||
{ | ||
|
||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'baum'; | ||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'baum'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Get Baum version notice.'; | ||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Get Baum version notice.'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function fire() { | ||
$this->line('<info>Baum</info> version <comment>' . Baum::VERSION . '</comment>'); | ||
$this->line('A Nested Set pattern implementation for the Eloquent ORM.'); | ||
$this->line('<comment>Copyright (c) 2013 Estanislau Trepat</comment>'); | ||
} | ||
/** | ||
* Execute the console command. | ||
* | ||
* @return void | ||
*/ | ||
public function fire() | ||
{ | ||
$this->line('<info>Baum</info> version <comment>' . Baum::VERSION . '</comment>'); | ||
$this->line('A Nested Set pattern implementation for the Eloquent ORM.'); | ||
$this->line('<comment>Copyright (c) 2013 Estanislau Trepat</comment>'); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,123 +1,132 @@ | ||
<?php | ||
|
||
namespace Baum\Console; | ||
|
||
use Baum\Generators\MigrationGenerator; | ||
use Baum\Generators\ModelGenerator; | ||
use Illuminate\Console\Command; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class InstallCommand extends Command { | ||
|
||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'baum:install'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Scaffolds a new migration and model suitable for Baum.'; | ||
|
||
/** | ||
* Migration generator instance | ||
* | ||
* @var Baum\Generators\MigrationGenerator | ||
*/ | ||
protected $migrator; | ||
|
||
/** | ||
* Model generator instance | ||
* | ||
* @var Baum\Generators\ModelGenerator | ||
*/ | ||
protected $modeler; | ||
|
||
/** | ||
* Create a new command instance | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(MigrationGenerator $migrator, ModelGenerator $modeler) { | ||
parent::__construct(); | ||
|
||
$this->migrator = $migrator; | ||
$this->modeler = $modeler; | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* Basically, we'll write the migration and model stubs out to disk inflected | ||
* with the name provided. Once its done, we'll `dump-autoload` for the entire | ||
* framework to make sure that the new classes are registered by the class | ||
* loaders. | ||
* | ||
* @return void | ||
*/ | ||
public function fire() { | ||
$name = $this->input->getArgument('name'); | ||
|
||
$this->writeMigration($name); | ||
|
||
$this->writeModel($name); | ||
|
||
} | ||
|
||
/** | ||
* Get the command arguments | ||
* | ||
* @return array | ||
*/ | ||
protected function getArguments() { | ||
return array( | ||
array('name', InputArgument::REQUIRED, 'Name to use for the scaffolding of the migration and model.') | ||
); | ||
} | ||
|
||
/** | ||
* Write the migration file to disk. | ||
* | ||
* @param string $name | ||
* @return string | ||
*/ | ||
protected function writeMigration($name) { | ||
$output = pathinfo($this->migrator->create($name, $this->getMigrationsPath()), PATHINFO_FILENAME); | ||
|
||
$this->line(" <fg=green;options=bold>create</fg=green;options=bold> $output"); | ||
} | ||
|
||
/** | ||
* Write the model file to disk. | ||
* | ||
* @param string $name | ||
* @return string | ||
*/ | ||
protected function writeModel($name) { | ||
$output = pathinfo($this->modeler->create($name, $this->getModelsPath()), PATHINFO_FILENAME); | ||
|
||
$this->line(" <fg=green;options=bold>create</fg=green;options=bold> $output"); | ||
} | ||
|
||
/** | ||
* Get the path to the migrations directory. | ||
* | ||
* @return string | ||
*/ | ||
protected function getMigrationsPath() { | ||
return $this->laravel['path.database'].'/migrations'; | ||
} | ||
|
||
/** | ||
* Get the path to the models directory. | ||
* | ||
* @return string | ||
*/ | ||
protected function getModelsPath() { | ||
return $this->laravel['path.base']; | ||
} | ||
class InstallCommand extends Command | ||
{ | ||
|
||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'baum:install'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Scaffolds a new migration and model suitable for Baum.'; | ||
|
||
/** | ||
* Migration generator instance | ||
* | ||
* @var Baum\Generators\MigrationGenerator | ||
*/ | ||
protected $migrator; | ||
|
||
/** | ||
* Model generator instance | ||
* | ||
* @var Baum\Generators\ModelGenerator | ||
*/ | ||
protected $modeler; | ||
|
||
/** | ||
* Create a new command instance | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(MigrationGenerator $migrator, ModelGenerator $modeler) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->migrator = $migrator; | ||
$this->modeler = $modeler; | ||
} | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* Basically, we'll write the migration and model stubs out to disk inflected | ||
* with the name provided. Once its done, we'll `dump-autoload` for the entire | ||
* framework to make sure that the new classes are registered by the class | ||
* loaders. | ||
* | ||
* @return void | ||
*/ | ||
public function fire() | ||
{ | ||
$name = $this->input->getArgument('name'); | ||
|
||
$this->writeMigration($name); | ||
|
||
$this->writeModel($name); | ||
|
||
} | ||
|
||
/** | ||
* Get the command arguments | ||
* | ||
* @return array | ||
*/ | ||
protected function getArguments() | ||
{ | ||
return array( | ||
array('name', InputArgument::REQUIRED, 'Name to use for the scaffolding of the migration and model.') | ||
); | ||
} | ||
|
||
/** | ||
* Write the migration file to disk. | ||
* | ||
* @param string $name | ||
* @return string | ||
*/ | ||
protected function writeMigration($name) | ||
{ | ||
$output = pathinfo($this->migrator->create($name, $this->getMigrationsPath()), PATHINFO_FILENAME); | ||
|
||
$this->line(" <fg=green;options=bold>create</fg=green;options=bold> $output"); | ||
} | ||
|
||
/** | ||
* Write the model file to disk. | ||
* | ||
* @param string $name | ||
* @return string | ||
*/ | ||
protected function writeModel($name) | ||
{ | ||
$output = pathinfo($this->modeler->create($name, $this->getModelsPath()), PATHINFO_FILENAME); | ||
|
||
$this->line(" <fg=green;options=bold>create</fg=green;options=bold> $output"); | ||
} | ||
|
||
/** | ||
* Get the path to the migrations directory. | ||
* | ||
* @return string | ||
*/ | ||
protected function getMigrationsPath() | ||
{ | ||
return $this->laravel['path.database'] . '/migrations'; | ||
} | ||
|
||
/** | ||
* Get the path to the models directory. | ||
* | ||
* @return string | ||
*/ | ||
protected function getModelsPath() | ||
{ | ||
return $this->laravel['path.base']; | ||
} | ||
|
||
} |
Oops, something went wrong.