Skip to content

Commit

Permalink
composer fix-style
Browse files Browse the repository at this point in the history
  • Loading branch information
mfn committed Jun 12, 2024
1 parent 6338abb commit f0c315e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public function getPropertiesFromMethods($model)
get_class($model->newModelQuery())
);
$modelName = $this->getClassNameInDestinationFile(
new \ReflectionClass($model),
new ReflectionClass($model),
get_class($model)
);
$this->setMethod($name, $builder . '|' . $modelName, $args, $comment);
Expand Down Expand Up @@ -712,10 +712,10 @@ public function getPropertiesFromMethods($model)
) {
if ($relationObj instanceof BelongsToMany) {
$pivot = get_class($relationObj->newPivot());
if (!in_array($pivot,[ Pivot::class, MorphPivot::class])) {
if (!in_array($pivot, [Pivot::class, MorphPivot::class])) {
$this->setProperty(
$relationObj->getPivotAccessor(),
$this->getClassNameInDestinationFile($model,$pivot),
$this->getClassNameInDestinationFile($model, $pivot),
true,
false
);
Expand Down
2 changes: 2 additions & 0 deletions tests/Console/ModelsCommand/Pivot/Models/ModelWithPivot.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models;

use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots\CustomPivot;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots;

use Illuminate\Database\Eloquent\Relations\Pivot;

class CustomPivot extends Pivot
{

}
2 changes: 2 additions & 0 deletions tests/Console/ModelsCommand/Pivot/Test.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot;

use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models;

use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots\CustomPivot;
Expand Down Expand Up @@ -27,6 +29,8 @@ public function relationWithCustomPivot()
}
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots;

use Illuminate\Database\Eloquent\Relations\Pivot;
Expand All @@ -41,5 +45,4 @@ public function relationWithCustomPivot()
*/
class CustomPivot extends Pivot
{

}

0 comments on commit f0c315e

Please sign in to comment.