chevere/docs

Use named arguments in code samples

Closed this issue · 0 comments

Many code samples are taken "as-is" from the code, with the intention that the user will copy-paste the code to tryout. As PHP 8 adds named arguments I think that this:

$cache->withPut(key: $foo, varExportable: $bar);

Is easier to understand than:

$cache->withPut($key, $varExportable);

Code samples should be reviewed to use this language feature, it provides more clear examples.

  • Action
  • Cache
  • ClassMap
  • Common
  • DataStructure
  • Dependent
  • Filesystem
  • Http
  • Message
  • Parameter
  • Pluggable
  • Regex
  • Response
  • Router
  • Serialize
  • Spec
  • Str
  • ThrowableHandler
  • Translator
  • Type
  • VarDump
  • VarStorable
  • Workflow
  • Writer