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.
This is not something that I have had the opportunity to test, but while looking through Drupal 8 Beta 2 code I noticed the following:
In \core\includes\entity.inc
function entity_render_cache_clear() {
$entity_manager = Drupal::entityManager();
.....
Shouldn't it be "\Drupal::" with a back slash? Other functions in the entity include file reference Drupal container layer that way.
I'm sure that someone else will detect this soon enough. But since it is in an INCLUDE file, the developers/maintainers of the Entity system may not yet have seen it?
Comments
Comment #1
BerdirIt could be, and there is a coding standard that says it should be there, but it is no functional bug.
Because the file itself is not in a namespace, so not explicitly specifying the namespace works fine.
Comment #2
BerdirComment #3
nikita.izotov CreditAttribution: nikita.izotov commentedFixed,
+ i've found some formating mistakes what've fixed also
Now sniffer says that "PHP_CodeSniffer did not find any problems."
Comment #4
BerdirChanges look fine, but be careful with changing more than you have to in an issue. I think it's fine to expand the scope here, but you shouldn't do that if you are working on an actual change for example.
Comment #5
alexpottThe file mode should not be changing
@return array|FALSE
There is no need to start each new sentence on a new line.
should be @return string|null
Comment #6
adci_contributor CreditAttribution: adci_contributor commentedFixed according to the recommendations from @alexpot
Comment #9
jhedstromPatch in #6 has addressed #5.
Comment #11
alexpottEntities are not arrays.
Comment #12
gsharm CreditAttribution: gsharm at Srijan | A Material+ Company commentedComment #13
gsharm CreditAttribution: gsharm at Srijan | A Material+ Company commentedComment #14
gsharm CreditAttribution: gsharm at Srijan | A Material+ Company commentedComment #15
Shamsher_Alam CreditAttribution: Shamsher_Alam commentedComment #16
Shamsher_Alam CreditAttribution: Shamsher_Alam commentedComment #17
mgiffordPatch no longer applies.
Comment #18
wellme CreditAttribution: wellme at Zyxware Technologies commentedComment #19
wellme CreditAttribution: wellme at Zyxware Technologies commentedComment #20
timmillwoodComment #21
alexpottThese kind of grabbag coding standards issues are discouraged because it is almost impossible to prevent regressions. If you interested in helping make core comply with coding standards please see #2571965: [meta] Fix PHP coding standards in core and the numerous sub issues there. Also it is worth reviewing https://www.drupal.org/core/scope for guidelines and examples for Drupal core issue scope.
Comment #27
Berdirentity.inc is now 100% deprecated, so I don't think we should spend time on fixing coding standard issues ther.