Code Monkey home page Code Monkey logo

Comments (6)

ricordisamoa avatar ricordisamoa commented on May 26, 2024

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.

AJenbo avatar AJenbo commented on May 26, 2024

https://github.com/AJenbo/Imap.php/blob/8fc1a46104414b4ef44d78078a09e765012b71ab/Imap.php

from phpdoc-to-typehint.

AJenbo avatar AJenbo commented on May 26, 2024

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.

ricordisamoa avatar ricordisamoa commented on May 26, 2024

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.

dunglas avatar dunglas commented on May 26, 2024

Thanks guys for the report and the fix!

from phpdoc-to-typehint.

AJenbo avatar AJenbo commented on May 26, 2024

Thank you for this tool :)

from phpdoc-to-typehint.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.