Skip to content

Commit

Permalink
remove unsupported form (static method as string)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Dec 22, 2024
1 parent 7ea9a92 commit 554881e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Database/Concerns/HasRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Winter\Storm\Database\Concerns;

use Closure;
use InvalidArgumentException;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
Expand Down
6 changes: 2 additions & 4 deletions tests/Database/Concerns/HasRelationshipsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ public function testDynamicRelationMethods()

$author->addDynamicMethod('dynamicMethodAsClosure', function () {
});
$author->addDynamicMethod('dynamicStaticClassMethod', 'Author::hasDatabaseTable');
$author->addDynamicMethod('dynamicClassMethodFromArray', [$author, 'isDatabaseReady']);
$author->addDynamicMethod('dynamicStaticClassMethodFromArray', [Author::class, 'hasDatabaseTable']);
$author->addDynamicMethod('dynamicClassMethodFromArray', [$author, 'isDatabaseReady']);

$this->assertFalse($author->hasRelation('dynamicMethodAsClosure'));
$this->assertFalse($author->hasRelation('dynamicStaticClassMethod'));
$this->assertFalse($author->hasRelation('dynamicClassMethodFromArray'));
$this->assertFalse($author->hasRelation('dynamicStaticClassMethodFromArray'));
$this->assertFalse($author->hasRelation('dynamicClassMethodFromArray'));
}

public function testGetRelationType()
Expand Down

0 comments on commit 554881e

Please sign in to comment.