Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291165

[policy] Define coding standards for anonymous functions (closures)

$
0
0

We do not yet have a consensus about how to write anonymous functions. Currently two different versions are in use in D8:

With a space between the function and the opening parenthesis:

<?php
  $callback
= function ($parameter) use ($variable) {
  }
?>

Or without a space between the function and the opening parenthesis:

<?php
  $callback
= function($parameter) use ($variable) {
  }
?>

Both are being used in the D8 codebase at the moment.


Viewing all articles
Browse latest Browse all 291165

Trending Articles