Skip to content

docs: fix incorrect PHPDoc types #8244

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

Merged
merged 1 commit into from
Nov 25, 2023
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
6 changes: 4 additions & 2 deletions system/Database/BaseResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,16 @@ public function getResultObject(): array
*
* If row doesn't exist, returns null.
*
* @param int $n The index of the results to return
* @param string $type The type of result object. 'array', 'object' or class name.
* @param int|string $n The index of the results to return, or column name.
* @param string $type The type of result object. 'array', 'object' or class name.
* @phpstan-param class-string|'array'|'object' $type
*
* @return array|object|stdClass|null
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : object|null))
*/
public function getRow($n = 0, string $type = 'object')
{
// $n is a column name.
if (! is_numeric($n)) {
// We cache the row data for subsequent uses
if (! is_array($this->rowData)) {
Expand Down
5 changes: 3 additions & 2 deletions system/Database/ResultInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public function getResultObject(): array;
*
* If row doesn't exist, returns null.
*
* @param int $n The index of the results to return
* @param string $type The type of result object. 'array', 'object' or class name.
* @param int|string $n The index of the results to return, or column name.
* @param string $type The type of result object. 'array', 'object' or class name.
* @phpstan-param class-string|'array'|'object' $type
*
* @return array|object|stdClass|null
* @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : object|null))
Expand Down
2 changes: 1 addition & 1 deletion system/Email/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ public function setHeader($header, $value)
}

/**
* @param string $email
* @param array|string $email
*
* @return array
*/
Expand Down
4 changes: 2 additions & 2 deletions system/HTTP/Files/FileCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getFile(string $name)
/**
* Verify if a file exist in the collection of uploaded files and is have been uploaded with multiple option.
*
* @return array|null
* @return list<UploadedFile>|null
*/
public function getFileMultiple(string $name)
{
Expand Down Expand Up @@ -245,7 +245,7 @@ protected function fixFilesArray(array $data): array
* @param array $index The index sequence we are navigating down
* @param array $value The portion of the array to process
*
* @return UploadedFile|null
* @return list<UploadedFile>|UploadedFile|null
*/
protected function getValueDotNotationSyntax(array $index, array $value)
{
Expand Down