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

4,262 views

Published on

PSRの最近についてまとめたよ。

  • 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 https://github.com/php-fig/fig-standards/blob/master/ proposed/cache.md
  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として報告されま す) • どのバージョンの問題が影響 • 問題の現状 • 解決した場合、修復の説明 • プロジェクトのユーザーへの影響に基づいて、低/中/高深刻度 “http://blog.phpdeveloper.org/2015/05/22/php-security-psr-9psr-10/“
  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 https://groups.google.com/forum/?fromgroups#!forum/ php-fig
  20. 20. 参考 • PHP-FIG http://www.php-fig.org/ • PHP FIG mailing list https://groups.google.com/forum/#!forum/php-fig • PHP - 憂鬱な希望としての PSR-7 http://sasezaki.hatenablog.com/entry/2015/03/07/195908 • PSR-3 Logger Interfaceのご紹介 http://www.slideshare.net/hinakano/psr-3loggerinterface
  21. 21. ご清聴ありがとうございました。

×