Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Current status of PSR - Phpblt1


Published on


  • Be the first to comment

  • Be the first to like this

Current status of PSR - Phpblt1

  1. 1. Current status of PSR PHP BLT #1
  2. 2. @yui_tang / Yui Sakamoto • Software Engineer @ Mercari, Inc. • I was server-side engineer… • But, I m writing JavaScript…
  3. 3. • 推し松は十四松です。
  4. 4. What’s PSR PHP Standards Recommendations • 直訳するとPHP標準勧告 • どうにでも自由に書けちゃうテンプレートエンジ ンに、秩序を与える。 • 当然、言語側には何の強制力も無い • 本当に大事なことはプロダクト。その他の瑣末な ことに気を使う時間を極力減らす為に存在。
  5. 5. PHP-FIG • “PHP Framework In Group” • フレームワークの相互運用性 について議論するグループ • その為にPSRを策定・発表
  6. 6. Accepted • PSR-0 Autoloading Standard • PSR-1 Basic Coding Standard • PSR-2 Coding Style Guide • PSR-3 Logger Interface • PSR-4 Autoloading Standard • PSR-7 HTTP Message Interface
  7. 7. Review • PSR-6 Caching Interface proposed/
  8. 8. Draft • PSR-5 PHPDoc Standard • PSR-8 Huggable Interface • PSR-9 Security Disclosure • PSR-10 Security Advisories • PSR-11 Container Interface • PSR-12 Extended Coding Style Guide
  9. 9. Review flow
  10. 10. Stages 1. Pre-Draft 提案段階、当然まだ番号は振られない。 2. Draft PSR-XXの番号が振られる。 3. Review PHP-FIGメンバーの投票段階 4. Accepted 正式なPSRとして認められる
  11. 11. Introducing Drafts PSR-9 Security Disclosure “The main goal of the PSR-9 standard is to provide structure around the documentation a project provides to the wider community around security vulnerabilities that have been found (and fixed) and those that are still pending.”
  12. 12. Introducing Drafts PSR-10 Security Advisories “The goal of this PSR is to give researchers, project leads, upstream project leads and end users a defined and structured process for disclosing security vulnerabilities.”
  13. 13. • PSR-9 セキュリティ勧告の報告基準 • PSR-10 レポートの発見を容易にするために、セキュリティの開示ワークフ ロー • 要約、公開された日付、より多くの情報とユニークな参照IDへのリンクが含まれ、それぞれの 脆弱性のエントリ • CWEおよび/またはCVE情報、可能であれば(すべてではない脆弱性のCVEとして報告されま す) • どのバージョンの問題が影響 • 問題の現状 • 解決した場合、修復の説明 • プロジェクトのユーザーへの影響に基づいて、低/中/高深刻度 ““
  14. 14. Introducing Drafts PSR-11 Container Interface “The goal set by ContainerInterface is to standardize how frameworks and libraries make use of a container to obtain objects and parameters (called entries in the rest of this document).”
  15. 15. The following projects already implement the container-interop version of the interface and therefore would be willing to switch to a Container PSR as soon as it is available. Projects implementing ContainerInterface • Acclimate: Adapters for Aura.Di, Laravel, Nette DI, Pimple, Symfony DI, ZF2 Service manager, ZF2 Dependency injection and any container using ArrayAccess • Aura.DI (v3+) • dcp-di • Mouf • Njasm Container • PHP-DI • PimpleInterop • XStatic Projects implementing the delegate lookup feature • Aura.DI • Mouf • PHP-DI • PimpleInterop • Middlewares implementing ContainerInterface
  16. 16. Introducing Drafts PSR-12 Extended Coding Style Guide “This guide extends and expands on PSR-2, the coding style guide and PSR-1, the basic coding standard.”
  17. 17. • Keywords and True/False/Null “PHP keywords MUST be in lower case. The PHP reserved words int, true, object, float, false, mixed, bool, null, numeric, string and resource MUST be in lower case” • Strict Types, Namespace, and Use Declarations • When present, there MUST be one blank line after the declare declaration. • When present, there MUST be one blank line after the namespace declaration. • When present, the namespace declaration MUST go after the declare declaration. • When present, all use declarations MUST go after the namespace declaration. • There MUST be one use keyword per declaration.
  18. 18. • Using traits • abstract, final, and static • Method and Function Calls • Closures • try, catch, finally • Anonymous Classes
  19. 19. How to commit PHP Framework Interoperability Group!forum/ php-fig
  20. 20. 参考 • PHP-FIG • PHP FIG mailing list!forum/php-fig • PHP - 憂鬱な希望としての PSR-7 • PSR-3 Logger Interfaceのご紹介
  21. 21. ご清聴ありがとうございました。