Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

perfect FunctionScanner class #181

Closed
wants to merge 8 commits into from
Closed

perfect FunctionScanner class #181

wants to merge 8 commits into from

Conversation

pifeifei
Copy link

@pifeifei pifeifei commented Dec 28, 2019

  • Add FunctionScanner for the new feature.
  • Add tests for the new feature.
  • Add a CHANGELOG.md entry for the new feature.

@Ocramius
Copy link
Member

Hey, all the scanners are generally to be avoided: consider using (and contributing to) roave/better-reflection instead

@pifeifei
Copy link
Author

Performance, which can be ignored temporarily

purpose

The code prompt file is generated automatically according to the ide-helper-generator I wrote. It's useful here to scanner

conceive

For PHP Extensions, such as swoole updates

Existing ide helper (v2.2.0)

<?php
    
/**
 * docblock and other
 */
class Server{
    /**
     * docblock and other
     * @param string $ip
     * @param int $port
     */
    public function __constuct($ip, $port);
}

/**
 * function docblock and other
 * @param string $ip
 * @param int $port
 */
function swoole_server($ip, $port);

Need to update to 4.x.x

function and class updating.

<?php
Swoole\Server::__construct(string $host, int $port = 0, int $mode = SWOOLE_PROCESS,$sock_type = SWOOLE_SOCK_TCP);
function swoole_server($ip, $port, $mode, $sock_type);

Desired result

Version updates inevitably have functions / class added, deprecated, deprecated, and existing comments combined to generate the latest version of ide-helper

<?php
    
/**
 * docblock and other
 */
class Server{
    /**
     * docblock and other
     * @param string $ip
     * @param int $port
     * Some parameters are not, and need to be processed manually.
     */
    public function __constuct(
        string $host, 
        int $port = 0,
        int $mode = SWOOLE_PROCESS,
        $sock_type = SWOOLE_SOCK_TCP
    );
}

/**
 * function docblock and other
 * @param string $ip
 * @param int $port
 */
function swoole_server($ip, $port, $mode, $sock_type);

Here you need to use classScanner and FunctionScanner.

The actual situation

One day I need to use ftp to update the html files of different servers, because the server has an intranet IP, using the passive mode, the upload fails all the time, and various searches on the Internet have not found a suitable one. I didn't find it, and finally found php bug # 55651. I need a parameter FTP_USEPASVADDRESS to solve the problem instantly. Then I went through the documentation and finally found this parameter in the English page.

Chinese Version:no FTP_USEPASVADDRESS

English original:Have FTP_USEPASVADDRESS

If you have the latest code prompt, type FTP_ and you will be prompted accordingly. There is no need to work hard to find a solution.

Of course, this is official and there is help documentation, so using your own development php extension, or niche php extension, ide-helper automatic generation will be very convenient. You don't need to check the git log to improve the document, although I will not develop PHP at this time. Expansion.

Conclusion: I have a limited level of English, and I am learning English in order to see the original English documents. These are also translated with Google. Please forgive me if there are errors.

@pifeifei
Copy link
Author

The FunctionGenerator class is also added to see if it is needed.
at master branch: https://github.com/pifeifei/zend-code.git

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-code; a new issue has been opened at laminas/laminas-code#1.

@weierophinney
Copy link
Member

This repository has been moved to laminas/laminas-code. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:

  • Squash all commits in your branch (git rebase -i origin/{branch})
  • Make a note of all changed files (`git diff --name-only origin/{branch}...HEAD
  • Run the laminas/laminas-migration tool on the code.
  • Clone laminas/laminas-code to another directory.
  • Copy the files from the second bullet point to the clone of laminas/laminas-code.
  • In your clone of laminas/laminas-code, commit the files, push to your fork, and open the new PR.
    We will be providing tooling via laminas/laminas-migration soon to help automate the process.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants