Skip to content

Override findOneByColumn, findAllByColumn and sum to use deletiontimestamp.#31

Merged
joshmcrae merged 2 commits intotithely:masterfrom
rrigby:override-find-columns-and-sum
Apr 2, 2026
Merged

Override findOneByColumn, findAllByColumn and sum to use deletiontimestamp.#31
joshmcrae merged 2 commits intotithely:masterfrom
rrigby:override-find-columns-and-sum

Conversation

@rrigby
Copy link
Copy Markdown
Contributor

@rrigby rrigby commented Mar 7, 2026

This should be the last of the methods we need to override to use the deletion timestamp.

*/
public function findAllByColumn($column)
{
if ($this->definition->getDeletionTimestamp()) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
*/
public function findOneColumn($column)
{
if ($this->definition->getDeletionTimestamp()) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
*/
public function sum(string $column)
{
if ($this->definition->getDeletionTimestamp()) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
@joshmcrae
Copy link
Copy Markdown
Member

Looks good. Could you please address the Psalm issues before we merge.

There's some annotations needed because you're overriding methods on Table and one of them is already typed as bool|string but your override is typed mixed via the DocBlock (the original method has a more specific type signature, so the reimplementation needs to be as strict or stricter).

@rrigby
Copy link
Copy Markdown
Contributor Author

rrigby commented Mar 31, 2026

@joshmcrae not sure how psalm manages to pick just these things out, if I run it locally it produces tons of errors 😅

I've made the changes for those specific ones it's upset about 👍

@joshmcrae joshmcrae merged commit 8e659c9 into tithely:master Apr 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants