<commit_before><?php namespace Orchestra\Extension\Publisher;

use Exception;
use Illuminate\Foundation\AssetPublisher;
use Orchestra\Extension\FilePermissionException;

class AssetManager {

	/**
	 * Application instance.
	 *
	 * @var \Illuminate\Foundation\Application
	 */
	protected $app = null;

	/**
	 * Migrator instance.
	 *
	 * @var \Illuminate\Foundation\AssetPublisher
	 */
	protected $publisher = null;

	/**
	 * Construct a new instance.
	 *
	 * @access public
	 * @param  \Illuminate\Foundation\Application       $app
	 * @param  \Illuminate\Foundation\AssetPublisher    $publisher
	 * @return void
	 */
	public function __construct($app, AssetPublisher $publisher)
	{
		$this->app       = $app;
		$this->publisher = $publisher;
	}

	/**
	 * Run migration for an extension or application.
	 *
	 * @access public
	 * @param  string   $name
	 * @param  string   $destinationPath
	 * @return mixed
	 */
	public function publish($name, $destinationPath)
	{
		return $this->publisher->publish($name, $destinationPath);
	}

	/**
	 * Migrate extension.
	 *
	 * @access public
	 * @param  string   $name
	 * @return mixed
	 * @throws \Orchestra\Extension\FilePermissionException
	 */
	public function extension($name)
	{
		$path = rtrim($this->app['orchestra.extension']->option($name, 'path'), '/').'/public';
		
		if ( ! $this->app['files']->isDirectory($path)) return false;

		try 
		{
			return $this->publish($name, $path);
		}
		catch (Exception $e)
		{
			throw new FilePermissionException("Unable to publish [{$path}].");
			return false;
		}
	}

	/**
	 * Migrate Orchestra Platform.
	 *
	 * @access public
	 * @return mixed
	 * @throws \Orchestra\Extension\FilePermissionException
	 */
	public function foundation()
	{
		$path = rtrim($this->app['path.base'], '/').'/vendor/orchestra/foundation/src/public';

		if ( ! $this->app['files']->isDirectory($path)) return false;

		try 
		{
			return $this->publish('orchestra/foundation', $path);
		}
		catch (Exception $e)
		{
			throw new FilePermissionException("Unable to publish [{$path}].");
			return false;
		}
	}
}<commit_msg>No point returning false when exception is already thrown.<commit_after><?php namespace Orchestra\Extension\Publisher;

use Exception;
use Illuminate\Foundation\AssetPublisher;
use Orchestra\Extension\FilePermissionException;

class AssetManager {

	/**
	 * Application instance.
	 *
	 * @var \Illuminate\Foundation\Application
	 */
	protected $app = null;

	/**
	 * Migrator instance.
	 *
	 * @var \Illuminate\Foundation\AssetPublisher
	 */
	protected $publisher = null;

	/**
	 * Construct a new instance.
	 *
	 * @access public
	 * @param  \Illuminate\Foundation\Application       $app
	 * @param  \Illuminate\Foundation\AssetPublisher    $publisher
	 * @return void
	 */
	public function __construct($app, AssetPublisher $publisher)
	{
		$this->app       = $app;
		$this->publisher = $publisher;
	}

	/**
	 * Run migration for an extension or application.
	 *
	 * @access public
	 * @param  string   $name
	 * @param  string   $destinationPath
	 * @return mixed
	 */
	public function publish($name, $destinationPath)
	{
		return $this->publisher->publish($name, $destinationPath);
	}

	/**
	 * Migrate extension.
	 *
	 * @access public
	 * @param  string   $name
	 * @return mixed
	 * @throws \Orchestra\Extension\FilePermissionException
	 */
	public function extension($name)
	{
		$path = rtrim($this->app['orchestra.extension']->option($name, 'path'), '/').'/public';
		
		if ( ! $this->app['files']->isDirectory($path)) return false;

		try 
		{
			return $this->publish($name, $path);
		}
		catch (Exception $e)
		{
			throw new FilePermissionException("Unable to publish [{$path}].");
			return false;
		}
	}

	/**
	 * Migrate Orchestra Platform.
	 *
	 * @access public
	 * @return mixed
	 * @throws \Orchestra\Extension\FilePermissionException
	 */
	public function foundation()
	{
		$path = rtrim($this->app['path.base'], '/').'/vendor/orchestra/foundation/src/public';

		if ( ! $this->app['files']->isDirectory($path)) return false;

		try 
		{
			return $this->publish('orchestra/foundation', $path);
		}
		catch (Exception $e)
		{
			throw new FilePermissionException("Unable to publish [{$path}].");
		}
	}
}
{'fraction_non_alphanumeric': 0.15071090047393365, 'fraction_numerical': 0.0, 'mean_word_length': 3.476139978791092, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '6981083', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1274, 'n_words': 292}