Skip to content

Commit

Permalink
Max length, trailing slashes, static
Browse files Browse the repository at this point in the history
  • Loading branch information
arogachev committed Feb 26, 2024
1 parent d432097 commit 3953435
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ return [
];
```

Because item and assignment storages are completely independent, migrations are separated as well to prevent
the creation of unused tables. So, for example, if you only want to use assignment storage, add only
Because item and assignment storages are completely independent, migrations are separated as well to prevent the
creation of unused tables. So, for example, if you only want to use assignment storage, add only
[migrations/assignments](./migrations/assignments) to source paths.

Other ways of using migrations are covered [here](https://github.com/yiisoft/db-migration#usage).
Expand Down
5 changes: 3 additions & 2 deletions src/ItemTreeTraversal/ItemTreeTraversalFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class ItemTreeTraversalFactory
* @param string $namesSeparator Separator used for joining item names.
* @psalm-param non-empty-string $namesSeparator
*
* @throws RuntimeException When a database was configured with an unknown driver, either because it is not supported
* by Yii Database out of the box or newly added by Yii Database and not supported / tested yet in this package.
* @throws RuntimeException When a database was configured with an unknown driver, either because it is not
* supported by Yii Database out of the box or newly added by Yii Database and not supported / tested yet in this
* package.
* @return ItemTreeTraversalInterface Item tree traversal strategy.
*/
public static function getItemTreeTraversal(
Expand Down
7 changes: 3 additions & 4 deletions src/ItemsStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ private function getItemsByType(string $type): array
* @param string $type Either {@see Item::TYPE_ROLE} or {@see Item::TYPE_PERMISSION}.
* @psalm-param Item::TYPE_* $type
*
* @return Permission|Role|null Either role or permission, depending on an initial type specified. `null` is returned
* when no item was found by given condition.
* @return Permission|Role|null Either role or permission, depending on an initial type specified. `null` is
* returned when no item was found by given condition.
* @psalm-return ($type is Item::TYPE_PERMISSION ? Permission : Role)|null
*/
private function getItemByTypeAndName(string $type, string $name): Permission|Role|null
Expand Down Expand Up @@ -568,8 +568,7 @@ private function clearItemsByType(string $type): void

/**
* Creates RBAC item tree traversal strategy and returns it.
* In case it was already created, it just retrieves
* previously saved instance.
* In case it was already created, it just retrieves previously saved instance.
*/
private function getTreeTraversal(): ItemTreeTraversalInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/TransactionalManagerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class TransactionalManagerDecorator implements ManagerInterface
{
public function __construct(
private readonly ManagerInterface $manager,
private readonly ConnectionInterface $database
private readonly ConnectionInterface $database,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Base/ItemsStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class ItemsStorageTest extends TestCase
setUp as protected traitSetUp;
tearDown as protected traitTearDown;
testClear as protected traitTestClear;
dataRemove as public traitDataRemove;
dataRemove as public static traitDataRemove;
testRemove as protected traitTestRemove;
testClearPermissions as protected traitTestClearPermissions;
testClearRoles as protected traitTestClearRoles;
Expand Down

0 comments on commit 3953435

Please sign in to comment.