Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect phpdoc for Mutations #220

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Concerns/ManagesMutations.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract protected function getDatabaseContext(): Database|Transaction;

/**
* @param string $table
* @param array $dataSet
* @param list<array<string, mixed>>|array<string, mixed> $dataSet
* @return void
*/
public function insertUsingMutation(string $table, array $dataSet)
Expand All @@ -51,7 +51,7 @@ public function insertUsingMutation(string $table, array $dataSet)

/**
* @param string $table
* @param array $dataSet
* @param list<array<string, mixed>>|array<string, mixed> $dataSet
* @return void
*/
public function updateUsingMutation(string $table, array $dataSet)
Expand All @@ -65,7 +65,7 @@ public function updateUsingMutation(string $table, array $dataSet)

/**
* @param string $table
* @param array<string, mixed> $dataSet
* @param list<array<string, mixed>>|array<string, mixed> $dataSet
* @return void
*/
public function insertOrUpdateUsingMutation(string $table, array $dataSet)
Expand Down Expand Up @@ -109,8 +109,8 @@ protected function withTransactionEvents(callable $mutationCall)
}

/**
* @param array $dataSet
* @return array
* @param list<array<string, mixed>>|array<string, mixed> $dataSet
* @return list<array<string, mixed>>
*/
protected function prepareForMutation(array $dataSet): array
{
Expand All @@ -122,6 +122,7 @@ protected function prepareForMutation(array $dataSet): array
$dataSet = [$dataSet];
}

/** @var list<array<string, mixed>> $dataSet */
foreach ($dataSet as $index => $values) {
foreach ($values as $name => $value) {
if ($value instanceof DateTimeInterface) {
Expand Down
4 changes: 2 additions & 2 deletions src/Events/MutatingData.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class MutatingData extends ConnectionEvent
public $command;

/**
* @var array
* @var list<array<string, mixed>>
*/
public $values;

/**
* @param Connection $connection
* @param string $tableName
* @param string $command
* @param array $values
* @param list<array<string, mixed>> $values
*/
public function __construct($connection, string $tableName, string $command, array $values)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Query/Concerns/UsesMutations.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
trait UsesMutations
{
/**
* @param array<string, mixed> $values
* @param list<array<string, mixed>>|array<string, mixed> $values
* @return void
*/
public function insertUsingMutation(array $values)
Expand All @@ -35,7 +35,7 @@ public function insertUsingMutation(array $values)
}

/**
* @param array<string, mixed> $values
* @param list<array<string, mixed>>|array<string, mixed> $values
* @return void
*/
public function updateUsingMutation(array $values)
Expand All @@ -44,7 +44,7 @@ public function updateUsingMutation(array $values)
}

/**
* @param array<string, mixed> $values
* @param list<array<string, mixed>>|array<string, mixed> $values
* @return void
*/
public function insertOrUpdateUsingMutation(array $values)
Expand Down
Loading