Skip to content

Commit

Permalink
Require php 7.2 and laravel 6 because of phpunit 8
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfensdrfer committed Oct 20, 2019
1 parent f42cd4f commit 38a822f
Show file tree
Hide file tree
Showing 39 changed files with 6,592 additions and 6,050 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor
composer.lock
.vscode
.phpunit.result.cache
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
}
],
"require": {
"php": ">=7.0.0",
"illuminate/database": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|~5.9.0|~6.0.0",
"illuminate/events": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|~5.9.0|~6.0.0",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|~5.9.0|~6.0.0"
"php": ">=7.2.0",
"illuminate/database": "^6.0",
"illuminate/events": "^6.0",
"illuminate/support": "^6.0"
},
"require-dev": {
"d11wtq/boris": "~1.0.10",
"d11wtq/boris": "^1.0",
"doctrine/dbal": "*",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.0",
"phpunit/phpunit": "^8.0",
"squizlabs/php_codesniffer": "^3.4"
},
"autoload": {
Expand Down
49 changes: 26 additions & 23 deletions src/Console/BaumCommand.php
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>');
}

}
235 changes: 122 additions & 113 deletions src/Console/InstallCommand.php
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'];
}

}
Loading

0 comments on commit 38a822f

Please sign in to comment.