Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 24, 2019
1 parent 2808ed9 commit 65d040d
Showing 1 changed file with 6 additions and 32 deletions.
38 changes: 6 additions & 32 deletions src/Illuminate/Foundation/Console/VendorPublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ class VendorPublishCommand extends Command
*/
protected $tags = [];

/**
* Boolean describing the status of files. Initially set to false, it changes
* to true if any file is successfully published.
*
* @var bool
*/
protected $published;

/**
* The console command signature.
*
Expand Down Expand Up @@ -69,8 +61,6 @@ public function __construct(Filesystem $files)
parent::__construct();

$this->files = $files;

$this->published = false;
}

/**
Expand Down Expand Up @@ -167,15 +157,18 @@ protected function parseChoice($choice)
*/
protected function publishTag($tag)
{
$published = false;

foreach ($this->pathsToPublish($tag) as $from => $to) {
$this->publishItem($from, $to);

$this->published = true;
$published = true;
}
if ($this->published) {

if ($published) {
$this->info('Publishing complete.');
} else {
$this->error('Nothing to publish.');
$this->error('Unable to locate publishable resources.');
}
}

Expand Down Expand Up @@ -225,8 +218,6 @@ protected function publishFile($from, $to)
$this->files->copy($from, $to);

$this->status($from, $to, 'File');
} else {
$this->didntCopyStatus($from, $to, 'File');
}
}

Expand Down Expand Up @@ -291,21 +282,4 @@ protected function status($from, $to, $type)

$this->line('<info>Copied '.$type.'</info> <comment>['.$from.']</comment> <info>To</info> <comment>['.$to.']</comment>');
}

/**
* Write a 'didn't copy' status message to the console.
*
* @param string $from
* @param string $to
* @param string $type
* @return void
*/
protected function didntCopyStatus($from, $to, $type)
{
$from = str_replace(base_path(), '', realpath($from));

$to = str_replace(base_path(), '', realpath($to));

$this->warn('Did not copy '.strtolower($type).' ['.$from.'] to ['.$to.'] as file already exists and "--force" was not specified.');
}
}

0 comments on commit 65d040d

Please sign in to comment.