-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flexmailer - Update [CiviMail Draft]
prefix to match BAO behavior
#21715
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non - blocking - but I definitely find it much easier to read / search for when we define classes in their own file rather than this on-the-fly way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I do see the slippery-slope argument where some class may be misjudged as "anonymous/strictly-hands-off to others" -- and then create some cost around discovering that this anonymous class is actually a supported interface.
At the same time, suppose we did a class
CRM_Mailing_DAO_MailingJob_SaveProhibited
. Future-person would be just as likely to read too much into it -- eg taking it as an exemplar to emulate in newCRM_*_DAO_*_SaveProhibited
classes, and/or rightly objecting that SaveProhibited hierarchy conflicts with the BAO hierarchy, and/or feeling an obligation to support some external evil likeif ($dao instance of CRM_Mailing_DAO_MailingJob_SaveProhibited) { activateThirdPartyBits(); }
.It seems to me - if one wants to be a good precedent - then that's undertaking a bigger task: systemically adding a freeze-mode to
CRM_Core_DAO
. Maybe that's a good feature? But it seems a bit by-the-by?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@totten to be honest I don't really understand this code - I merged based on the tests - I find the cognitve load of classes declared on the fly to be really high.
If you had declared an actual class in a file like
class CRM_Mailing_BAO_Mailing_Job_PreviewMode extends \CRM_Mailing_BAO_MailingJob
it would have been easy to read.
I've always thought stuff like this was 'complicated stuff that Tim understands' but I actually had to debug some code like this the other day & I found that if I re-wrote constructs like this before trying to read it & also renaming all the abbreviations to words I could make sense of it.