Skip to content

Commit

Permalink
fix: incorrect phpdoc for Mutations (#220)
Browse files Browse the repository at this point in the history
fix/mutations-phpdoc
  • Loading branch information
taka-oyama authored Jun 11, 2024
1 parent 60d8e79 commit 1c46ef7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
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

0 comments on commit 1c46ef7

Please sign in to comment.