Skip to content

docs: replace mixed in system/HTTP/IncomingRequest.php#7355

Merged
kenjis merged 4 commits intocodeigniter4:developfrom
totoprayogo1916:mixed
Apr 3, 2023
Merged

docs: replace mixed in system/HTTP/IncomingRequest.php#7355
kenjis merged 4 commits intocodeigniter4:developfrom
totoprayogo1916:mixed

Conversation

@totoprayogo1916
Copy link
Copy Markdown
Contributor

@totoprayogo1916 totoprayogo1916 commented Mar 15, 2023

Description
See #6310

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@totoprayogo1916 totoprayogo1916 marked this pull request as ready for review March 16, 2023 16:32
@kenjis kenjis changed the title doc: replace mixed in *system/HTTP/IncomingRequest.php* docs: replace mixed in system/HTTP/IncomingRequest.php Mar 25, 2023
Comment thread system/HTTP/IncomingRequest.php Outdated
* @param array|int|null $flags Option
*
* @return mixed
* @return array|bool|int|object|null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Basically the value is a string, and an array if $index is an array.

It can get $filter, so FILTER_CALLBACK can return any type value.
https://www.php.net/manual/en/filter.filters.misc.php

It seems the return type is array|bool|float|int|object|string|null.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any get*() method return type is the same?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any get*() method return type is the same?

I don't know yet, get*() only fetches from here
https://github.com/totoprayogo1916/framework-CI4/blob/d239b2a09188b1c28e7ed44a38e0f240216be00a/system/HTTP/RequestTrait.php#L242-L248

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any get*() method return type is the same.

dd($this->request->getGetPost('test', FILTER_VALIDATE_FLOAT));

Navigate to http://localhost:8080/?test=1.11 and I got:

$this->request->getGetPost(...) double 1.11

The return type of fetchGlobal() also should be array|bool|float|int|object|string|null.

Comment thread system/HTTP/IncomingRequest.php Outdated
Comment thread system/HTTP/IncomingRequest.php Outdated
Comment thread system/HTTP/IncomingRequest.php Outdated
Comment thread system/HTTP/IncomingRequest.php Outdated
Comment thread system/HTTP/IncomingRequest.php Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Comment thread user_guide_src/source/incoming/incomingrequest.rst Outdated
Co-authored-by: kenjis <kenji.uui@gmail.com>
Copy link
Copy Markdown
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kenjis kenjis merged commit 583de40 into codeigniter4:develop Apr 3, 2023
@totoprayogo1916 totoprayogo1916 deleted the mixed branch April 3, 2023 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants