Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
system.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Mar 2012 at 01:36 UTC
Updated:
29 Jul 2014 at 20:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
amateescu commentedThe attached patch does the following:
core/includesto a shiny new place inlib/Drupal/Core/Queuequeue()function in common.inc, much like the new cache systemComment #3
amateescu commentedThis should fix it.
Comment #4
amateescu commentedTagging.
Comment #5
aspilicious commentedYou probably going to hate me but it would be nice if we could fix all the documentation in this issue. This issue isn't blocking any other critical issue (I think/hope) so we shouldn't rush things (like with the cmi patch).
Claims and newline after @param in that docblock
Deletes
One line summary, newline between @param and @return and a description
This class has no docblocks for functions.
Other similar issues are found, but it should be trivial to fix them.
Comment #6
neclimdulIt looks like a pretty straight forward to me. I kind-of prefer the previous factory but I'm lead to believe this is the rough standard atm so that's ok and suddenly some of those class names make no sense but that's also not this patches fault :)
I don't see a problem with these trivial doc changes if that's acceptable these days. They don't confuse any history.
I'm not sure there's anything to rush though, this is very straight forward.
Comment #7
aspilicious commentedBy rush I mean, push this patch with partially fixed doc blocks. That way we have to reopen an issue specially for the docs.
Comment #8
amateescu commentedOk, let's clean up the docs in here, but only because part of it was already done in #1315886: Clean up API docs for includes directory, files starting with A-C and I don't want to burden #1326664: Clean up API docs for system module (excluding subdirectories) any more with this trivial stuff.
Fixed all the items from #5 and a few more. Interdiff is from #3.
@neclimdul, I agree about the new class names not making any sense, I raised that point in #1323124-5: Convert file transfer system to PSR-0 but was 'shot' down by Crell in #8 :)
Comment #9
Crell commentedThis may be carried over from the previous code, but this is going to double-instantiate a queue object if you need a reliable interface. Rather, we can use http://us.php.net/class_implements to determine if the class implements an interface and then not even instantiate it if not.
If that's not appropriate to fix here because it's an existing bug, then we should open up a follow-up issue to fix it. I'm fine either way.
So strictly speaking, we should not be using the queue() static factor in unit tests. We should be instantiating the actual class directly and configuring it directly, so that we have it in isolation. That does mean separate tests for System and Memory queues, which we should have anyway because those are separate pieces of code and should be tested independently (even if with similar tests, even if with tests that are the same and have a prepared object passed to them).
Very very few core tests do that properly, sadly, but it's a practice we should start following. May as well start now. :-)
Otherwise, this looks good to me. Thanks, amateescu!
23 days to next Drupal core point release.
Comment #10
amateescu commentedYep, that was carried over from the previous code as I didn't want to make any functional changes in this patch. Now that you mention it, I also thought that double instantiation is a little weird, so I'm not opposed to fixing it in here :)
Attached patch takes care of that and the tests. Interdiff is from #8.
Comment #11
lars toomre commentedWhen this is re-rolled, could we include variable type hinting here?
Also, since method getAllItems is not part of the interface, I think that our coding standards require that it get a complete docblock which includes @return directive.
Comment #12
aspilicious commentedWe can't do this, we have to document each function.
I did this for you. Needs work for Crell his comments.
Comment #13
aspilicious commentedSmall improvement
Comment #14
amateescu commentedI found a problem in my change from #10, the reliable check should go first.
Re: #11
Fixed.
Fixed.
Re: #12
This was already done in the DBTNG conversion, see http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/lib/D... for example. But.. whatever, I've included your changes.
Crell's comments were addressed in #10.
Interdiff is against #10.
Comment #15
Crell commentedWhen specifying an interface name in a string, like a class it needs to be fully qualified since that's what class_implements() should be returning.
Yeah, I'm being a pedant. :-) This method should be protected, since it's internal to this class. The test* methods (yay!) should be explicitly declared public. All methods should have their visibility specified.
I think I'm out of things to complain about otherwise. Nicely done. :-)
22 days to next Drupal core point release.
Comment #16
amateescu commentedI had this in the back of my mind before starting to work on it, don't know why it came out wrong but thanks for catching it :)
Fixed.
Interdiff is against #14.
Comment #17
Crell commentedThis should be lowerCamel case. Sorry I missed it before. :-(
That's it, then we should be done.
Comment #18
amateescu commentedDone!
Comment #19
Crell commentedI can't imagine the bot having an issue with that small a change, and it will complain anyway if it does, so...
Comment #20
catchThis looks great. We could do with a better name for the default reliably queue than 'System' but that problem pre-exists this patch, so committed/pushed to 8.x.
This will need a change notification - new factory added etc.
Comment #21
webchickCourtesy of core office hours! http://drupal.org/node/1479680
Comment #24
neclimdulUpdated the change notice to reflect that a different factory was added not it was converted to use a factory. The documentation on the notice already showed the change.