Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I did it for whole drupal core with ONE exception in install.inc
/**
* Helper for drupal_rewrite_settings().
*
* Dump the value of a value property and adds the comment if it exists.
*
* @param stdClass $variable
* A stdClass object with at least a value property.
* @param string $prefix
* A string to prepend to the variable's value.
* @param string $suffix
* A string to append to the variable's value.
*
* @return string
* A string containing valid PHP code of the variable suitable for placing
* into settings.php.
*/
function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $suffix = '') {
$return = $prefix . var_export($variable->value, TRUE) . ';';
if (!empty($variable->comment)) {
$return .= ' // ' . $variable->comment;
}
$return .= $suffix;
return $return;
}
There is an explicit \stdClass and I don't want to change the signature of that method. I did not even knew that you can do this in PHP now. But it seems the namespaces have that.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal_core-documentation_stdClass_rename-1969256-3.patch | 4.03 KB | zhuber |
drupal_core-documentation-stdClass_Rename.patch | 4.44 KB | ro-no-lo | |
Comments
Comment #1
ro-no-lo CreditAttribution: ro-no-lo commentedI would like to see this \stdClass everwhere where a simpe object MUST be the argument type. That would bring Drupal even further to be type aware and guideful for developers to use the correct types for function calls.
Comment #2
jhodgdonThanks, good effort! Can you restrict your patch to just this one change though (as described in the issue title)? Some of what you put in isn't OK, such as:
Every @param needs a description and this doesn't have one, and there should also not be a blank line between the two @param sections.
And in this change
that should be a separate issue. Thanks!
Comment #3
zhuber CreditAttribution: zhuber commentedI was looking through the issue queue and this one looked like a simple fix that I could help with.
Here is a patch that just renames the out-dated stdClass documentation.
Comment #4
jhodgdonThanks! The patch in #3 is correct and complete. Committed to 8.x.