Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1106617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:49:13+00:00 2026-05-17T01:49:13+00:00

this is my first question.. be gentle :) I am part of the development

  • 0

this is my first question.. be gentle 🙂

I am part of the development team for a PHP application (that is I am building the application). We shall call this our ‘core code’. We have a separate team who use the core code on a day to day basis, they develop other sites using the core code.

Now here’s the thing, currently we give our developers access to the core code and all is fine, but in the future we are planning to document the code using PHPdoc, and then we won’t need to give them the actual code.

The problem then becomes that if our developers don’t have the actual code then their IDE’s will no longer give them the benefit of code completion.

Now, I use Netbeans, and I notice that it stores files such as Standard.php, these simply contain a huge list of functions and their PHP doc above, my question is this:

does anybody know of a way I can generate such a set of files? They don’t need to contain any code, they should strip out the actual PHP, and just leave behind all the classes and PHPdoc.

Any help is greatly appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:49:14+00:00Added an answer on May 17, 2026 at 1:49 am

    Well, I can understand why you want to do this. But it will make debugging MUCH more difficult (since they can’t trace the calls through the core code.

    But if you really want to do this, you can create a generator that uses token_get_all to fetch all the tokens from each file, and write a new one with only the appropriate tokens left (the interface, with empty code blocks)…

    Either that, or use reflection to generate the classes. Basically load a new reflector for each class, and use its methods to generate the code. For example, to generate the methods:

    foreach ($reflector->getMethods() as $method) {
        $signature = $method->getDocComment() . "\n";
        $modifiers = $method->getModifiers();
    
        if ($modifiers & ReflectionMethod::IS_PUBLIC) {
            $signature .= 'public ';
        } elseif ($modifiers & ReflectionMethod::IS_PROTECTED) {
            $signature .= 'protected ';
        } elseif ($modifiers & ReflectionMethod::IS_PRIVATE) {
            $signature .= 'private ';
        }
        if ($modifiers & ReflectionMethod::IS_STATIC) {
            $signature .= 'static ';
        }
        if ($modifiers & ReflectionMethod::IS_ABSTRACT) {
            $signature .= 'abstract ';
        }
        if ($modifiers & ReflectionMethod::IS_FINAL) {
            $signature .= 'final ';
        }
        $signature .= 'function ' . $method->name.'(';
        $params = array();
        foreach ($method->getParameters() as $param) {
            $paramSignature = $param->name;
            if ($param->isDefaultAvailable()) {
                $paramSignature .= ' = ' . var_export($param->getDefaultValue(), true);
            }
            $params[] = $paramSignature;
        }
        $signature .= implode(', ', $params) . ') {}';
    }
    

    There’s some more to be done (like type hinting, etc), but that should get you started…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my first question here so be gentle ! recently i try to
This is my first question, so please be gentle. I'm trying out Apache Camel
This is my first question on Stack Overflow, so I hope that I'm clear
this is my first question on stack overflow, so be gentle. Let me first
First question. Be gentle. I'm working on software that tracks technicians' time spent working
This is my first question her so please be gentle: I have followig animation
First question on SOF, please be gentle if this may be a stupid question.
This is my first time asking a question, please be gentle! I have a
This is my first question on SO so be gentle. I am writing some
This is my first question here (so be gentle :)). I've looked everywhere and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.