mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2026-10-30 09:12:09 +00:00
Optimized constructor of right
This commit is contained in:
1 parent
f634555ed5
commit
9e4b00e2ae
2 files changed
+2
-2
No files matched your search
@@ -77,6 +77,7 @@ final class Right extends AbstractMeta implements RightInterface
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->grant = true;
|
$this->grant = true;
|
||||||
$this->reciever = new Reciever();
|
$this->reciever = new Reciever();
|
||||||
|
$this->reciever->setRight($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isGranted(SourceInterface $source, string $layer, string $right): bool
|
public function isGranted(SourceInterface $source, string $layer, string $right): bool
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ use App\DBAL\Types\RightType;
|
|||||||
use App\Entity\Meta\RightInterface;
|
use App\Entity\Meta\RightInterface;
|
||||||
use App\Entity\Meta\Right;
|
use App\Entity\Meta\Right;
|
||||||
use App\Entity\Meta\Law;
|
use App\Entity\Meta\Law;
|
||||||
use App\Entity\Meta\RecieverInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Implement reciever test
|
* @todo Implement reciever test
|
||||||
@@ -28,7 +27,7 @@ class RightTest extends TestCase
|
|||||||
|
|
||||||
public function testConstructor(): void
|
public function testConstructor(): void
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf(RecieverInterface::class, $this->right->getReciever());
|
$this->assertEquals($this->right,$this->right->getReciever()->getRight());
|
||||||
$this->expectException(\TypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
$this->assertNull($this->right->getLaw());
|
$this->assertNull($this->right->getLaw());
|
||||||
$this->expectException(\TypeError::class);
|
$this->expectException(\TypeError::class);
|
||||||
|
|||||||
Reference in new issue
Block a user