기존 클래스의 PHP 인터페이스 생성 도구가 있습니까? Netbeans 자동 getter/setter 생성과 같은 도구가 있지만 인터페이스 용으로 좋을 것입니다. 프로그램 사용에 대한PHP 인터페이스 생성
6
A
답변
15
은이 같은 기존 클래스에서 인터페이스를 도출 할 수 있습니다 InterfaceDistiller
있다 :
$distiller = new InterfaceDistiller;
$distiller
->methodsWithModifiers(\ReflectionMethod::IS_PUBLIC)
->extendInterfaceFrom('Iterator, SeekableIterator')
->excludeImplementedMethods()
->excludeInheritedMethods()
->excludeMagicMethods()
->excludeOldStyleConstructors()
->filterMethodsByPattern('(^get)')
->saveAs(new SplFileObject('MyInterface.php'))
->distill('SomeFoo', 'MyInterface');
그것은 또한 CLI 인터페이스가 있습니다
Usage: phpdistill [options] <classname> <interfacename>
--bootstrap Path to File containing your bootstrap and autoloader
--methodsWithModifiers <number> A ReflectionMethod Visibility BitMask. Defaults to Public.
--extendInterfaceFrom <name,...> Comma-separated list of Interfaces to extend.
--excludeImplementedMethods Will exclude all implemented methods.
--excludeInheritedMethods Will exclude all inherited methods.
--excludeMagicMethods Will exclude all magic methods.
--excludeOldStyleConstructors Will exclude Legacy Constructors.
--filterMethodsByPattern <pattern> Only include methods matching PCRE pattern.
--saveAs Filename to save new Interface to. STDOUT if omitted.
아니에요을 php와 같은 기능을 제공하는 IDE를 알고 있어야합니다.
3
관련 문제
- 1. UITable보기 인터페이스 빌더 생성
- 2. 이클립스에서 자동 생성 인터페이스
- 3. Siebel COM 인터페이스 - PHP
- 4. 레일즈에서 PHP 애플리케이션을위한 인터페이스
- 5. PHP 인터페이스 : 가시성을 지정하십시오
- 6. .NET의 Reflection.Emit을 사용하여 인터페이스 생성
- 7. Java 기본 인터페이스 생성 문제
- 8. 인터페이스 용 독립 모듈 생성
- 9. 데이터베이스 모델에서 사용자 인터페이스 생성
- 10. 게임에서 gui 오버레이 인터페이스 생성
- 11. PHP 네임 스페이스 및 인터페이스
- 12. PHP : 매개 변수로 전달 인터페이스
- 13. PHP ↔ Perl 인터페이스 또는 바인딩
- 14. 사용자 생성 그래프 용 인터페이스 구축
- 15. 자바 스크립트로 완전히 생성 된 사용자 인터페이스?
- 16. ASP.NET MVC 컨트롤러/액션 인터페이스 생성 도구?
- 17. Eclipse의 솔리드 클래스 파일에서 인터페이스 생성
- 18. 인터페이스 용 Javadoc 만 생성 하시겠습니까?
- 19. Ant를 사용하여 인터페이스 용 Javadoc 생성?
- 20. swig 인터페이스 파일의 Swig 생성 클래스
- 21. PHP/JS 이미지 생성
- 22. 무작위 문자열 생성 PHP
- 23. 자동 생성 값 PHP
- 24. PHP 용 JSON 생성
- 25. PHP : PDF 생성
- 26. php PDF 생성
- 27. PHP 폼 생성 라이브러리?
- 28. 고유 조합 생성 PHP
- 29. PHP 아약스는 바우처 생성
- 30. 섬네일 생성 PHP 문제
무슨 말씀 이세요? 인터페이스에 대한 Getters/Setters는 의미가 없지만 인터페이스에는 속성이 없어야합니다. 당신의 질문을 명확히해야합니다 – KingCrunch
@KingCrunch 'Netbeans 자동 getter/setter 생성과 같은 도구를 가지고 있으면 좋겠다.'Netbeans는 "클래스 속성에서 getter 및 setter를 자동 생성합니다. 그는 인터페이스와 비슷한 것을 원합니다." " – edorian
아마도 edorian은 이미 답을 줄지도 모릅니다.하지만 대개 ("디자인 별 계약"에 따라) 항상 인터페이스가 먼저 있어야하며 서명에 따라 클래스를 만들어야합니다. – KingCrunch