Skip to content
Permalink
Browse files

formatting

  • Loading branch information...
taylorotwell committed Oct 24, 2019
1 parent 2808ed9 commit 65d040d44f1cef3830748ec59c0056bc2418dca6
Showing with 6 additions and 32 deletions.
  1. +6 −32 src/Illuminate/Foundation/Console/VendorPublishCommand.php
@@ -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.
*
@@ -69,8 +61,6 @@ public function __construct(Filesystem $files)
parent::__construct();
$this->files = $files;
$this->published = false;
}
/**
@@ -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.');
}
}
@@ -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');
}
}
@@ -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.
You can’t perform that action at this time.