Skip to content

Throw InvalidArgumentException for join names without a leading string - #223

Merged
simon-mundy merged 5 commits into
php-db:0.6.xfrom
simon-mundy:fix/206-join-name-type
Oct 9, 2026
Merged

simon-mundy merged 5 commits into
php-db:0.6.xfrom
simon-mundy:fix/206-join-name-type

Conversation

@simon-mundy

Copy link
Copy Markdown
Member

Fixes #206.

Join::join() built its invalid-name exception from the name array's first element. When that element was not a string, forInvalidJoinName(string) raised a TypeError instead.

Changes

  • A non-string first element is described by its type (get_debug_type()), e.g. join() expects 'int' as a single element associative array. A string element is reported as before.
  • JoinTest covers an empty array, an unaliased Select and an integer element.

Breaking changes

None.

mago format, mago lint, mago analyze and the unit tests pass.

An invalid join name array whose first element was not a string, such
as an empty array or an unaliased Select, reached forInvalidJoinName()
with a non-string and raised a TypeError. The message now names the
element's type instead.

Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
@simon-mundy simon-mundy added documentation Improvements or additions to documentation qa Improvements in quality assurance of the project Lang Feature Refactor Refactoring to new language features labels Oct 5, 2026
@simon-mundy simon-mundy added this to the 0.6.0 milestone Oct 5, 2026
@simon-mundy simon-mundy self-assigned this Oct 5, 2026
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…e-type

# Conflicts:
#	analyzer-baseline.toml
@simon-mundy
simon-mundy requested a review from tyrsson October 6, 2026 02:21
tyrsson
tyrsson previously approved these changes Oct 8, 2026
@simon-mundy
simon-mundy merged commit 992ffa3 into php-db:0.6.x Oct 9, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in @phpdb Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Lang Feature Refactor Refactoring to new language features qa Improvements in quality assurance of the project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Join::join() raises TypeError instead of InvalidArgumentException for an invalid name without a leading string

2 participants