Comments (6)
I was able to trigger a very similar bug with a small test case. It would be helpful if #24 were tested against the source file the above snippets come from. Thank you.
from phpdoc-to-typehint.
https://github.com/AJenbo/Imap.php/blob/8fc1a46104414b4ef44d78078a09e765012b71ab/Imap.php
from phpdoc-to-typehint.
I also encountered this issue a lot on a private project (huge code base) so it would be super helpful if you can release a new version once the issue is resolved.
from phpdoc-to-typehint.
Indeed the patch seems to make more parameters hinted.
diff between Imap.php as edited by phpdoc-to-typehint before and after #24
@@ -101,7 +101,7 @@
*
* @return array Responce from server devided in to types
*/
- private function responce($literal = false): array
+ private function responce(bool $literal = false): array
{
$responce = '';
$return = array('message' => '', 'responce' => '', 'data' => '');
@@ -146,7 +146,7 @@
*
* @return null
*/
- private function capability($string = '')
+ private function capability(string $string = '')
{
if (!$string) {
$this->writeLine('CAPABILITY');
@@ -382,7 +382,7 @@
*
* @return null
*/
- public function create($mailbox)
+ public function create(string $mailbox)
{
$mailbox = mb_convert_encoding($mailbox, 'UTF7-IMAP', 'UTF-8');
$this->writeLine('CREATE "' . $mailbox . '"');
@@ -517,7 +517,7 @@
*
* @return array Key is item
*/
- public function status($mailbox, string $item): array
+ public function status(string $mailbox, string $item): array
{
$mailbox = mb_convert_encoding($mailbox, 'UTF7-IMAP', 'UTF-8');
$this->writeLine('STATUS "' . $mailbox . '" (' . $item . ')');
@@ -664,7 +664,7 @@
*
* @return array Raw from responce()
*/
- public function fetch($msg_set, string $data, bool $uid = false): array
+ public function fetch(string $msg_set, string $data, bool $uid = false): array
{
if (!$this->selected) {
throw new Exception('Open mailbox first');
@@ -690,7 +690,7 @@
* @return array Key is message id with the message flags as a sub array under
* the flags key
*/
- public function store($msg_set, string $action, string $flags, bool $uid = false): array
+ public function store(string $msg_set, string $action, string $flags, bool $uid = false): array
{
if (!$this->selected) {
throw new Exception('Open mailbox first');
@@ -735,7 +735,7 @@
*
* @return array Raw from responce()
*/
- public function copy($msg_set, string $mailbox, bool $uid = false): array
+ public function copy(string $msg_set, string $mailbox, bool $uid = false): array
{
if (!$this->selected) {
throw new Exception('Open mailbox first');
from phpdoc-to-typehint.
Thanks guys for the report and the fix!
from phpdoc-to-typehint.
Thank you for this tool :)
from phpdoc-to-typehint.
Related Issues (15)
- Aliased classes in return statements are not mantained when ported to PHP7 HOT 2
- Support PHP7.1 HOT 4
- Example in readme is invalid HOT 2
- By reference is applied in correctly HOT 2
- Error doesn't point to file and line that is at fault
- Possible to run on single file
- php 7.1: requirements could not be resolved to an installable set of packages
- Cannot ue 'Void' as class name HOT 7
- Add a dry run mode
- @see is mistaken for a type HOT 10
- Constant visibility is not supported HOT 1
- Nullable type hints in existing code break the parser HOT 1
- RFC: Do not change method signature when this would break inheritance HOT 1
- InvalidArgumentException at @see HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpdoc-to-typehint.