From 7a6f2ffda6ddbbcfc96fdf4246b9fe9f120b9f6f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 Jan 2025 09:49:52 +0000 Subject: [PATCH] Fix code style (php-cs-fixer) --- src/Commands/CreateUserWithRLSPolicies.php | 4 ++-- src/RLS/PolicyManagers/TableRLSManager.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Commands/CreateUserWithRLSPolicies.php b/src/Commands/CreateUserWithRLSPolicies.php index 551a1668..785241b8 100644 --- a/src/Commands/CreateUserWithRLSPolicies.php +++ b/src/Commands/CreateUserWithRLSPolicies.php @@ -108,9 +108,9 @@ class CreateUserWithRLSPolicies extends Command foreach ($rlsQueries as $table => $queries) { foreach ($queries as $type => $query) { [$hash, $policyQuery] = $this->hashPolicy($query); - $expectedName = $table .'_'.$type.'_rls_policy_' . $hash; + $expectedName = $table . '_' . $type . '_rls_policy_' . $hash; - $tableRLSPolicy = $this->findTableRLSPolicy($table,$type); + $tableRLSPolicy = $this->findTableRLSPolicy($table, $type); $olderPolicyExists = $tableRLSPolicy && $tableRLSPolicy->policyname !== $expectedName; // Drop the policy if an outdated version exists diff --git a/src/RLS/PolicyManagers/TableRLSManager.php b/src/RLS/PolicyManagers/TableRLSManager.php index 7530b326..a22c61b3 100644 --- a/src/RLS/PolicyManagers/TableRLSManager.php +++ b/src/RLS/PolicyManagers/TableRLSManager.php @@ -24,9 +24,9 @@ class TableRLSManager implements RLSPolicyManager $centralUserName = $this->database->getConfig('username'); foreach ($trees ?: $this->shortestPaths() as $table => $path) { - $queries[$table] =[ + $queries[$table] = [ 'tenant' => $this->generateQuery($table, $path), - 'central' => "CREATE POLICY {$table}_central_rls_policy ON {$table} AS PERMISSIVE TO {$centralUserName} USING (true);" + 'central' => "CREATE POLICY {$table}_central_rls_policy ON {$table} AS PERMISSIVE TO {$centralUserName} USING (true);", ]; }