Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Talk Cakefest 2024 - How to work with CakePHP f...

Talk Cakefest 2024 - How to work with CakePHP frictionless and make coding quick, easy, and fun.

Mark Sch.

July 25, 2024
Tweet

More Decks by Mark Sch.

Other Decks in Technology

Transcript

  1. How to work with CakePHP frictionless and make coding quick,

    easy, and fun. CakeFest 2024 25.07.2024 - by @dereuromark
  2. About Mark Scherer @dereuromark • Senior Software Developer & Tooling

    Architect in Berlin, Germany • CakePHP Core Developer for 14+ years • Plugin specialist and Tooling expert
  3. Topics • CakePHP 5 and PHPStorm • IDE tooling •

    IdeHelper ◦ IDE usability and speed up tips for maximum rapid developing in CakePHP ◦ Annotations ◦ Autocomplete/Typehinting • PHPStan/Psalm compatibility • Testing Harness / TDD
  4. IDE tooling • editorconfig ◦ indentation per file type •

    phpcs ◦ manual or auto • AI ◦ type-ahead or code completion 4
  5. CakePHP 5 and PHPStorm • By default very high support

    • Plugins recommended ◦ https:/ /plugins.jetbrains.com/plugin/9927-deep-assoc-completion see https:/ /github.com/dereuromark/cakephp-ide-helper/wiki/PHPStorm 5
  6. IdeHelper 6 • Annotate • Generate Code Complete / Meta

    File https:/ /github.com/dereuromark/cakephp-ide-helper + (optional) https:/ /github.com/dereuromark/cakephp-ide-helper-extra
  7. Code Complete / Meta File 8 • Generate meta files

    for IDE • Very specific format/content usually
  8. Code Complete / Meta File • Magic string autocomplete from

    start to end • Route path handling ◦ UrlHelper::urlFromPath() ◦ HtmlHelper::linkFromPath() ◦ urlArray() convenience function 9
  9. PHPStan/Psalm compatibility • Most IdeHelper adjustments already also provide support

    here. • On top use https:/ /github.com/CakeDC/cakephp-phpstan In your phpstan.neon then add 10 includes: - vendor/cakedc/cakephp-phpstan/extension.neon
  10. Coding Session IdeHelper task as real life solution: - Queue

    createJob() and isQueued() support https:/ /github.com/dereuromark/cakephp-queue -> Queue/Generator/Task/QueuedJobTask.php - other examples? 11
  11. Coding Session IdeHelper task as real life solution: - Icons

    in templates https:/ /github.com/dereuromark/cakephp-ide-helper-extra -> src/Tools/Generator/Task/IconRenderTask.php - other examples? 12