Skip to content

Commit

Permalink
Convert indentation to spaces.
Browse files Browse the repository at this point in the history
Converted indentation to spaces on all files.
  • Loading branch information
tabennett committed Feb 4, 2015
1 parent 037dbb6 commit 85f8a95
Show file tree
Hide file tree
Showing 9 changed files with 632 additions and 632 deletions.
196 changes: 98 additions & 98 deletions src/Commands/FastenCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,103 +9,103 @@

class FastenCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'stapler:fasten';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate a migration for adding stapler file fields to a database table';

/**
* An instance of Laravel's view factory.
*
* @var View
*/
protected $view;

/**
* An instance of Laravel's filesystem.
*
* @var File
*/
protected $file;

/**
* Create a new command instance.
*
* @return void
*/
public function __construct(View $view, File $file)
{
parent::__construct();

$this->view = $view;
$this->file = $file;
}

/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->createMigration();
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['table', InputArgument::REQUIRED, 'The name of the database table the file fields will be added to.'],
['attachment', InputArgument::REQUIRED, 'The name of the corresponding stapler attachment.'],
];
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array();
}

/**
* Create a new migration.
*
* @return void
*/
protected function createMigration()
{
$data = ['table' => $this->argument('table'), 'attachment' => $this->argument('attachment')];
$prefix = date('Y_m_d_His');
$path = app_path() . '/database/migrations';

if (!is_dir($path)) mkdir($path);

$fileName = $path . '/' . $prefix . '_add_' . $data['attachment'] . '_fields_to_' . $data['table'] . '_table.php';
$data['className'] = 'Add' . ucfirst(Str::camel($data['attachment'])) . 'FieldsTo' . ucfirst(Str::camel($data['table'])) . 'Table';

// Save the new migration to disk using the stapler migration view.
$migration = $this->view->make('laravel-stapler::migration', $data)->render();
$this->file->put($fileName, $migration);

// Dump the autoloader and print a created migration message to the console.
$this->call('dump-autoload');
$this->info("Created migration: $fileName");
}
/**
* The console command name.
*
* @var string
*/
protected $name = 'stapler:fasten';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate a migration for adding stapler file fields to a database table';

/**
* An instance of Laravel's view factory.
*
* @var View
*/
protected $view;

/**
* An instance of Laravel's filesystem.
*
* @var File
*/
protected $file;

/**
* Create a new command instance.
*
* @return void
*/
public function __construct(View $view, File $file)
{
parent::__construct();

$this->view = $view;
$this->file = $file;
}

/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->createMigration();
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['table', InputArgument::REQUIRED, 'The name of the database table the file fields will be added to.'],
['attachment', InputArgument::REQUIRED, 'The name of the corresponding stapler attachment.'],
];
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array();
}

/**
* Create a new migration.
*
* @return void
*/
protected function createMigration()
{
$data = ['table' => $this->argument('table'), 'attachment' => $this->argument('attachment')];
$prefix = date('Y_m_d_His');
$path = app_path() . '/database/migrations';

if (!is_dir($path)) mkdir($path);

$fileName = $path . '/' . $prefix . '_add_' . $data['attachment'] . '_fields_to_' . $data['table'] . '_table.php';
$data['className'] = 'Add' . ucfirst(Str::camel($data['attachment'])) . 'FieldsTo' . ucfirst(Str::camel($data['table'])) . 'Table';

// Save the new migration to disk using the stapler migration view.
$migration = $this->view->make('laravel-stapler::migration', $data)->render();
$this->file->put($fileName, $migration);

// Dump the autoloader and print a created migration message to the console.
$this->call('dump-autoload');
$this->info("Created migration: $fileName");
}

}
132 changes: 66 additions & 66 deletions src/Commands/RefreshCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,79 +7,79 @@

class RefreshCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'stapler:refresh';
/**
* The console command name.
*
* @var string
*/
protected $name = 'stapler:refresh';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Regenerate images for a given model (and optional attachment and styles)';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Regenerate images for a given model (and optional attachment and styles)';

/**
* The image refresh service that will be used to
* rebuild images.
*
* @var ImageRefreshService
*/
protected $imageRefreshService;
/**
* The image refresh service that will be used to
* rebuild images.
*
* @var ImageRefreshService
*/
protected $imageRefreshService;

/**
* Create a new command instance.
*
* @param ImageRefreshService $imageRefreshService
* @return void
*/
public function __construct(ImageRefreshService $imageRefreshService)
{
parent::__construct();
/**
* Create a new command instance.
*
* @param ImageRefreshService $imageRefreshService
* @return void
*/
public function __construct(ImageRefreshService $imageRefreshService)
{
parent::__construct();

$this->imageRefreshService = $imageRefreshService;
}
$this->imageRefreshService = $imageRefreshService;
}

/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->imageRefreshService->setOutput($this->output);
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$this->imageRefreshService->setOutput($this->output);

$class = $this->argument('class');
$attachments = $this->option('attachments') ?: [];
$class = $this->argument('class');
$attachments = $this->option('attachments') ?: [];

$this->info('Refreshing uploaded images...');
$this->imageRefreshService->refresh($class, $attachments);
$this->info('Done!');
}
$this->info('Refreshing uploaded images...');
$this->imageRefreshService->refresh($class, $attachments);
$this->info('Done!');
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['class', InputArgument::REQUIRED, 'The name of a class (model) to refresh images on'],
];
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['class', InputArgument::REQUIRED, 'The name of a class (model) to refresh images on'],
];
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['attachments', null, InputOption::VALUE_OPTIONAL, 'A list of specific attachments to refresh images on.'],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['attachments', null, InputOption::VALUE_OPTIONAL, 'A list of specific attachments to refresh images on.'],
];
}
}
Loading

0 comments on commit 85f8a95

Please sign in to comment.