Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
johntrickett86 authored and github-actions[bot] committed Oct 10, 2024
1 parent 0d886ff commit 9889ce9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Commands/LaravelSimproApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class LaravelSimproApiCommand extends Command
{
protected $signature = 'simpro:list-requests';

protected $description = 'List all available requests in the Simpro package';

public function handle(): int
Expand All @@ -19,13 +20,14 @@ public function handle(): int
$requestPath = base_path('vendor/stitchdigital/laravel-simpro-api/src/Requests');

// Check if the directory exists
if (!is_dir($requestPath)) {
if (! is_dir($requestPath)) {
$this->error('Requests directory not found.');

return self::FAILURE;
}

// Create a Filesystem instance to work with files
$filesystem = new Filesystem();
$filesystem = new Filesystem;

// Get all PHP files in the Requests directory recursively
$files = $filesystem->allFiles($requestPath);
Expand All @@ -36,7 +38,7 @@ public function handle(): int
// Loop through the files and format the output
foreach ($files as $file) {
// Get the relative path from the Requests folder and format it
$relativePath = str_replace([$requestPath . DIRECTORY_SEPARATOR, '.php'], '', $file->getPathname());
$relativePath = str_replace([$requestPath.DIRECTORY_SEPARATOR, '.php'], '', $file->getPathname());

// Split the path into parts
$pathParts = explode(DIRECTORY_SEPARATOR, $relativePath);
Expand All @@ -56,6 +58,7 @@ public function handle(): int
);

$this->info('Request listing complete.');

return self::SUCCESS;
}
}

0 comments on commit 9889ce9

Please sign in to comment.