<commit_before><?php

namespace Nova\Foundation\Console;

use Nova\Console\Command;
use Nova\Filesystem\Filesystem;
use Nova\Support\ServiceProvider;

use Symfony\Component\Console\Input\InputArgument;


class VendorPublishCommand extends Command
{
	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'vendor:publish';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = "Publish any publishable assets from vendor packages";

	/**
	 * The asset publisher instance.
	 *
	 * @var \Nova\Filesystem\Filesystem
	 */
	protected $files;


	/**
	 * Create a new vendor publish command instance.
	 *
	 * @param  \Nova\Foundation\VendorPublisher  $publisher
	 * @return void
	 */
	public function __construct(Filesystem $files)
	{
		parent::__construct();

		$this->files = $files;
	}

	/**
	 * Execute the console command.
	 *
	 * @return void
	 */
	public function fire()
	{
		$group = $this->input->getArgument('group');

		$this->publishGroup($group);
	}

	/**
	 * Publish the assets for a given package name.
	 *
	 * @param  string  $package
	 * @return void
	 */
	protected function publishGroup($group)
	{
		$paths = ServiceProvider::pathsToPublish($group);

		if (empty($paths)) {
			if (is_null($group)) {
				return $this->comment("Nothing to publish.");
			}

			return $this->comment("Nothing to publish for group [{$group}].");
		}

		foreach ($paths as $from => $to) {
			if ($this->files->isFile($from)) {
				$this->publishFile($from, $to);
			} else if ($this->files->isDirectory($from)) {
				$this->publishDirectory($from, $to);<commit_msg>Improve the Foundation<commit_after><?php

namespace Nova\Foundation\Console;

use Nova\Console\Command;
use Nova\Filesystem\Filesystem;
use Nova\Support\ServiceProvider;

use Symfony\Component\Console\Input\InputArgument;


class VendorPublishCommand extends Command
{
	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'vendor:publish';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = "Publish any publishable assets from vendor packages";

	/**
	 * The asset publisher instance.
	 *
	 * @var \Nova\Filesystem\Filesystem
	 */
	protected $files;


	/**
	 * Create a new vendor publish command instance.
	 *
	 * @param  \Nova\Foundation\VendorPublisher  $publisher
	 * @return void
	 */
	public function __construct(Filesystem $files)
	{
		parent::__construct();

		$this->files = $files;
	}

	/**
	 * Execute the console command.
	 *
	 * @return void
	 */
	public function fire()
	{
		$group = $this->input->getArgument('group');

		if (is_null($group)) {
			return $this->publish();
		}

		$groups = explode(',', $group);

		foreach($groups as $group) {
			$this->publish($group);
		}
	}

	/**
	 * Publish the assets for a given group name.
	 *
	 * @param  string|null  $group
	 * @return void
	 */
	protected function publish($group = null)
	{
		$paths = ServiceProvider::pathsToPublish($group);

		if (empty($paths)) {
			if (is_null($group)) {
				return $this->comment("Nothing to publish.");
			}

			return $this->comment("Nothing to publish for group [{$group}].");
		}

		foreach ($paths as $from => $to) {
			if ($this->files->isFile($from)) {
				$this->publishFile($from, $to);
			} else if ($this->files->isDirectory($from)) {
				$this->publishDirectory($from, $to);
{'fraction_non_alphanumeric': 0.15441612329579135, 'fraction_numerical': 0.0, 'mean_word_length': 3.4820717131474104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4547432', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1032, 'n_words': 262}