Skip to content

Commit

Permalink
Clean up a couple things
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Feb 26, 2015
1 parent a2691cf commit 81a26e0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Commands/PivotMigrationMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ protected function getStub()
*/
protected function getPath($name = null)
{
return './database/migrations/' . date('Y_m_d_His') . '_create_' . $this->getPivotTableName() . '_pivot_table.php';
return './database/migrations/' . date('Y_m_d_His') .
'_create_' . $this->getPivotTableName() . '_pivot_table.php';
}

/**
Expand All @@ -83,8 +84,8 @@ protected function buildClass($name = null)
$stub = $this->files->get($this->getStub());

return $this->replacePivotTableName($stub)
->replaceSchema($stub)
->replaceClass($stub, $name);
->replaceSchema($stub)
->replaceClass($stub, $name);
}

/**
Expand All @@ -93,7 +94,7 @@ protected function buildClass($name = null)
* @param string $stub
* @return $this
*/
public function replacePivotTableName(&$stub)
protected function replacePivotTableName(&$stub)
{
$stub = str_replace('{{pivotTableName}}', $this->getPivotTableName(), $stub);

Expand All @@ -106,7 +107,7 @@ public function replacePivotTableName(&$stub)
* @param string $stub
* @return $this
*/
public function replaceSchema(&$stub)
protected function replaceSchema(&$stub)
{
$tables = $this->getSortedTableNames();

Expand All @@ -124,7 +125,7 @@ public function replaceSchema(&$stub)
*
* @return string
*/
public function getPivotTableName()
protected function getPivotTableName()
{
return implode('_', array_map('str_singular', $this->getSortedTableNames()));
}
Expand All @@ -134,7 +135,7 @@ public function getPivotTableName()
*
* @return array
*/
private function getSortedTableNames()
protected function getSortedTableNames()
{
$tables = [
strtolower($this->argument('tableOne')),
Expand Down

0 comments on commit 81a26e0

Please sign in to comment.