Skip to content
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

Expand use of UserEntityInterface in console commands #3638

Merged
merged 8 commits into from
May 14, 2024

Conversation

demiankatz
Copy link
Member

This PR expands the use of UserEntityInterface in console commands to enable more platform-independent mocking in tests and for greater forward-compatibility. This work is extracted from #3629 and is not exhaustive; it is just enough change to make tests pass in that PR. Nonetheless, it seemed like a worthwhile incremental step forward that made sense to commit independently.

@demiankatz demiankatz force-pushed the console-userentityinterface branch from a793b1b to 37d3ad7 Compare May 3, 2024 17:00
? $oldcipher->decrypt($row->getCatPassEnc())
: $row->getRawCatPassword();
$row->setRawCatPassword(null);
$row->setCatPassEnc($pass === null ? null : $newcipher->encrypt($pass));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't change typehints to the entity interfaces yet because of the use of ->save() below. Addressing that will require more intrusive changes to this class, which I'll take care of as a future action.

@demiankatz demiankatz added this to the 10.0 milestone May 8, 2024
@demiankatz demiankatz added the architecture pull requests that involve significant refactoring / architectural changes label May 8, 2024
public function setCreated(DateTime $dateTime): UserEntityInterface;

/**
* Created getter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: period or no period? The other one has, this doesn't..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a preference? This is inconsistent throughout the codebase (see also the last login getter and setter above). My gut feeling is "period at the end of a complete sentence, no punctuation otherwise" but I'm open to other approaches. Whatever we decide on, it's going to be difficult to apply the rule globally, but we can at least try to clean up the entity-related code.

In any case, I'm not going to let this hold up merging this PR, since the issue is bigger than the changes here anyway and will require follow-up work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've no strong preference, but I'd try to be consistent at least at class level. Your gut feeling sounds about right.

@demiankatz demiankatz removed the request for review from aleksip May 14, 2024 15:27
@demiankatz demiankatz merged commit 84bb46f into vufind-org:dev May 14, 2024
7 checks passed
@demiankatz demiankatz deleted the console-userentityinterface branch May 14, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture pull requests that involve significant refactoring / architectural changes
Projects
None yet
2 participants