Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The phpcbf --standard=Drupal,DrupalPractice
command converted the following code (PCA module, dev version):
define('PCA_PC_TEST', 'WR2 6NJ'); // WR2 6NJ is a test code (no credits are needed).
define('PCA_URL', 'http://services.postcodeanywhere.co.uk/');
define('PCA_FORMAT', 'xmla.ws'); // Supported formats: xmla.ws or json.ws (needs some work).
into:
define('PCA_DEMO_KEY', 'RA24-BZ17-JR72-WN38');
define('PCA_PC_TEST', 'WR2 6NJ');
// WR2 6NJ is a test code (no credits are needed).
define('PCA_URL', 'http://services.postcodeanywhere.co.uk/');
define('PCA_FORMAT', 'xmla.ws');
// Supported formats: xmla.ws or json.ws (needs some work).
define('PCA_CACHE', 'cache_postcodeanywhere');
If the comments needs to be in separate line, so I think they should be before the relevant code line, otherwise the comments between two code lines are confusing to which code they explain.
So I believe it should be converted into:
define('PCA_DEMO_KEY', 'RA24-BZ17-JR72-WN38');
// WR2 6NJ is a test code (no credits are needed).
define('PCA_PC_TEST', 'WR2 6NJ');
define('PCA_URL', 'http://services.postcodeanywhere.co.uk/');
// Supported formats: xmla.ws or json.ws (needs some work).
define('PCA_FORMAT', 'xmla.ws');
define('PCA_CACHE', 'cache_postcodeanywhere');
or leave them untouched.
--
The same this code:
drupal_add_js($settings, 'setting'); // Append settings into JS file.
drupal_add_js(drupal_get_path('module', 'postcodeanywhere') . '/postcodeanywhere.js', 'file');
is converted into:
drupal_add_js($settings, 'setting');
// Append settings into JS file.
drupal_add_js(drupal_get_path('module', 'postcodeanywhere') . '/postcodeanywhere.js', 'file');
and we don't know to which code line this comment belong to.
Comments
Comment #2
kenorb CreditAttribution: kenorb commentedComment #3
klausiComment #5
klausiCommitted a fix, thanks for reporting!