for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CleaniqueCoders\Console\Traits;
use CleaniqueCoders\Console\Exceptions\LaravelProjectException;
use CleaniqueCoders\Console\Exceptions\PackageException;
trait ProjectTrait
{
/**
* Verify Package and Project Existence.
*
* @param string $package Path to Package
* @param string $project Path to Project
*/
public function verifyPackageAndProjectDoesExist($package, $project)
$this->verifyProjectDoesExist($project);
$this->verifyPackageDoesExist($package);
}
* Verify that the Laravel Project exist.
* @param string $directory
protected function verifyProjectDoesExist($directory)
if (! is_dir($directory)) {
throw new LaravelProjectException('Laravel Project does not exists!');
* Verify that the package does not already exist.
protected function verifyPackageDoesExist($directory)
throw new LaravelProjectException('Package does not exists!');
protected function verifyPackageDoesntExist($directory)
if ((is_dir($directory) || is_file($directory)) && $directory != getcwd()) {
throw new PackageException('Package already exists!');