CAKEPHP
より安全で便便利利な
SAFER, MORE HELPFUL
ありがとうございました
4.0.0
COMING SOON
RELEASE TIMELINES
2.X
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.
3.X
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.
4.0.0
& SAFETY
EARLY FEEDBACK
CAKEPHP 4 SAFER?
WHAT MAKES
STRICTER
<?php
declare(strict_types=1);
BETTER TYPES
PHP7.2 &
SAFER METHODS
MAKING
MAKING
SAFER METHODS
$viewBuilder
!->template($template)
!->layout($layout)
!->helpers([‘Html’, ‘Form’]);
🧨🧨
MAKING
SAFER METHODS
$viewBuilder
!->setTemplate($template)
!->setLayout($layout)
!->setHelpers([‘Html’, ‘Form’]);
😍
STATIC ANALYSIS
LEVERAGE
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)
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);
TEXT
CONSISTENT
!// Use null to indicate no value.
Cache!::read(‘key’);
$viewBuilder!->getPlugin();
Log!::engine(‘system’);
IMPROVED FEEDBACK
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.
TEXT
IMPROVED ERROR PAGE
UPGRADE
HOW TO
UPGRADE TO 3.8
& PHP7.2
DEPRECATIONS
DEPRECATIONS
DEPRECATIONS
UPGRADE TOOL
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>
WHAT’S NEXT?
TEXT
WHAT’S NEXT? - CAKEPHP 4.1
▸ PSR-11 Container support
▸ Continued focus on error messages & Developer
Experience.
▸ We need your ideas and help!
ありがとうございました

Safer, More Helpful CakePHP