あなたは私のInterfaceDistillerとのインタフェースを蒸留することができます
namespace com\github\gooh\InterfaceDistiller;
include __DIR__ . '/../src/autoload.php';
var_dump(extension_loaded('phalcon')); // should be true
$phalconClasses = new \RegexIterator(
new \ArrayIterator(get_declared_classes()),
'/^Phalcon/'
);
foreach ($phalconClasses as $phalconClass)
{
$reflector = new \ReflectionClass($phalconClass);
$methodIterator = new \ArrayIterator($reflector->getMethods());
$distillate = new Distillate;
$distillate->setInterfaceName($reflector->getNamespaceName());
$distillate->setExtendingInterfaces(
implode(',', $reflector->getInterfaceNames())
);
foreach ($methodIterator as $method) {
$distillate->addMethod($method);
}
$file = new \SplTempFileObject(-1);
$writer = new Distillate\Writer($file);
$writer->writeToFile($distillate);
$file->rewind();
$file->fpassthru();
}
これは、次を生成します出力:
full file holding all distilled interfaces of Phalcon
InterfaceDistillerはインターフェイスのみを生成できることに注意してください。したがって、クラススケルトンとインターフェイスを混在させるのではなく、インターフェイスだけを使用します。
もう1つの問題は、インターフェイスメソッドがすべて公開されることです。なぜなら、インターフェイスメソッドはパブリックにする必要があるからです。実際の視認性を使用するにはtweak the writerのどちらかを使用できます。または、Distillerがどのメソッドを蒸留するかを制限できます。
ご覧のとおり、APIの一部を解決することはできません。これは、InterfaceDistillerがReflectionを使用してクラスからインターフェイスを抽出するためで、一部の値はこのように使用できないためです。解決不可能な値を手で埋めることを検討してください。
あなたのUseCaseには完璧ではありませんが、それはあなたに素晴らしいスタートアップを与えるはずです。
あなたはそれが完全に使用可能ですので、ファイルを適応し、完了することを決定した場合は、たぶん、あなたはこの探しているPhalconの人々にファイル全体で
ありがとうございます!これは私が探していたものです!外部ライブラリの –
は 'phalcon-devtools \ ide \ 1.3.1 \ Phalcon'へのパスを追加します – Patrioticcow
バージョン3ではグローバルパスを追加しました:'/usr/local/share/composer/vendor/phalcon-devtools/ide' – JREAM