Skip to content

Commit f6533e4

Browse files
committed
fix: remarks from reviewer
1 parent c6caf86 commit f6533e4

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/Exceptions/ResourceNotExistsException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
class ResourceNotExistsException extends AbstractResourceException
66
{
77
public function __construct(
8-
string $entity,
9-
string $filePath,
8+
string $createableResource,
9+
string $requiredFilePath,
1010
) {
11-
$resource = $this->getEntity($filePath);
11+
$resource = $this->getEntity($requiredFilePath);
1212

13-
parent::__construct("Cannot create {$entity} cause {$resource} does not exist. Create {$filePath} and run command again.");
13+
parent::__construct("Cannot create {$createableResource} cause {$resource} does not exist. Create {$requiredFilePath} and run command again.");
1414
}
1515
}

src/Generators/EntityGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ protected function checkResourceExists(string $path, string $resourceName, ?stri
330330
}
331331
}
332332

333-
protected function checkResourceNotExists(string $path, string $entity, string $resourceName, ?string $subFolder = null): void
333+
protected function checkResourceNotExists(string $path, string $createableResource, string $requiredResource, ?string $subFolder = null): void
334334
{
335-
if (!$this->classExists($path, $resourceName, $subFolder)) {
336-
$filePath = $this->getClassPath($path, $resourceName, $subFolder);
335+
if (!$this->classExists($path, $requiredResource, $subFolder)) {
336+
$filePath = $this->getClassPath($path, $requiredResource, $subFolder);
337337

338-
throw new ResourceNotExistsException($entity, $filePath);
338+
throw new ResourceNotExistsException($createableResource, $filePath);
339339
}
340340
}
341341

src/Generators/NovaResourceGenerator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
use Illuminate\Support\Facades\DB;
88
use Laravel\Nova\NovaServiceProvider;
99
use RonasIT\Support\Events\SuccessCreateMessage;
10-
use RonasIT\Support\Exceptions\ClassNotExistsException;
11-
use RonasIT\Support\Exceptions\ResourceAlreadyExistsException;
1210
use RonasIT\Support\Support\CommandLineNovaField;
1311
use RonasIT\Support\Support\DatabaseNovaField;
1412

0 commit comments

Comments
 (0)