Successfully reported this slideshow.
Your SlideShare is downloading. ×

Safer, More Helpful CakePHP

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 31 Ad

More Related Content

Similar to Safer, More Helpful CakePHP (20)

Advertisement

Recently uploaded (20)

Safer, More Helpful CakePHP

  1. 1. CAKEPHP より安全で便便利利な SAFER, MORE HELPFUL
  2. 2. ありがとうございました
  3. 3. 4.0.0 COMING SOON
  4. 4. RELEASE TIMELINES
  5. 5. 2.X
  6. 6. 2.X ▸ Bug fixes for 12 months after the release of 4.0.0. ▸ Security fixes for 18 months after the release of 4.0.0.
  7. 7. 3.X
  8. 8. 3.X ▸ Will continue to do forwards compatible feature releases with community support. ▸ Unlikely that cake-core team will invest time in shipping new features to 3.x in the future. ▸ Security fixes for 36 months after 4.0.0 is released.
  9. 9. 4.0.0
  10. 10. & SAFETY EARLY FEEDBACK
  11. 11. CAKEPHP 4 SAFER? WHAT MAKES
  12. 12. STRICTER <?php declare(strict_types=1);
  13. 13. BETTER TYPES PHP7.2 &
  14. 14. SAFER METHODS MAKING
  15. 15. MAKING SAFER METHODS $viewBuilder !->template($template) !->layout($layout) !->helpers([‘Html’, ‘Form’]); 🧨🧨
  16. 16. MAKING SAFER METHODS $viewBuilder !->setTemplate($template) !->setLayout($layout) !->setHelpers([‘Html’, ‘Form’]); 😍
  17. 17. STATIC ANALYSIS LEVERAGE
  18. 18. TEXT STATIC ANALYSIS ERROR: MoreSpecificReturnType - src/Console/ CommandFactory.php:30:21 - The declared return type 'CakeConsoleShell|CakeConsoleCommand' for CakeConsoleCommandFactory!::create is more specific than the inferred return type ‘CakeConsoleShell| CakeConsoleCommandInterface’ public function create(string $className)
  19. 19. CONSISTENT !// These all return `null` now. Type!::get(‘boolean’)!->marshal(‘nope’); Type!::get(‘boolean’)!->marshal(‘’); Type!::get(‘string’)!->marshal([‘one’]); !// No more lost nulls Type!::get(‘json’)!->toDatabase(null);
  20. 20. TEXT CONSISTENT !// Use null to indicate no value. Cache!::read(‘key’); $viewBuilder!->getPlugin(); Log!::engine(‘system’);
  21. 21. IMPROVED FEEDBACK
  22. 22. TEXT CLEARER ERROR MESSAGES Controller actions can only return ResponseInterface instance or null. Got boolean instead. Loggers must implement CakeLogLoggerInterface. Found `Closure` instance instead. File must be a filepath or UploadedFileInterface instance. Found `integer` instead.
  23. 23. TEXT IMPROVED ERROR PAGE
  24. 24. UPGRADE HOW TO
  25. 25. UPGRADE TO 3.8 & PHP7.2
  26. 26. DEPRECATIONS DEPRECATIONS DEPRECATIONS
  27. 27. UPGRADE TOOL
  28. 28. UPGRADE TOOL New CLI tool to help with upgrade. # Update an application or plugin bin/cake upgrade <path/to/app> # Update locales & templates bin/cake upgrade file_rename locales <path> bin/cake upgrade file_rename templates <path> # Apply rector refactoring bin/cake upgrade rector <path>
  29. 29. WHAT’S NEXT?
  30. 30. TEXT WHAT’S NEXT? - CAKEPHP 4.1 ▸ PSR-11 Container support ▸ Continued focus on error messages & Developer Experience. ▸ We need your ideas and help!
  31. 31. ありがとうございました

×