scorninpc/php-gtk3

Create PHP skeletons/stubs to feed IDEs to support programmers

Opened this issue · 5 comments

Useful for code completion, static code analysis, etc. It had been created for php-gtk with the Gtk_Dumper.php script.
Because that did not work with PHP-GTK3 and could not be easily adapted to it, I tried myself by creating a script to replicate that behavior, but ReflectionMethod::getParameters() does not return any of php-gtk3's method parameters (besides missing interfaces).
Does PHP-CPP have that functionality?

I think this is not a extension function, but php internals. but, i think you ask it on php-cpp repo

I think php-cpp works fine with reflections

image

The main purpose was to have PHP skeletons. Do you plan to somehow create it with or without the support from PHP-CPP?
My side note for PHP-CPP was to know if it supports the creation of such a skeleton, optimally directly from the C++ code. Apparently it does not.

But, since you answered, that the documentation claims to theoretically support reflection, I tried to prove that in practice with the following unsuccessful minimized example:

<?php
$m = new ReflectionMethod('GtkButton', 'set_label');
var_dump($m->getParameters());

result:

array(0) {
}

Update: ReflectionMethod does not support getReturnType(), too. But getName() works as expected.

Sorry, I don't think it's possible to do it like that

I don't understand what you're doing and I don't understand much about reflections, but anyway, the class name, methods, returns and arguments (with type) are all stored in the internal table, so I really don't know why this is not showing or if this has a correlation

ps: my main problem today to automate all bind code is finding consistent def files for gtk methods and arguments. So you maybe do this by hardcode faster than find a solution (as i done in php-gtk3)