Skip to content

[AI Store] Remove the Assert library #86

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Spomky
Copy link

@Spomky Spomky commented Jul 11, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues none
License MIT

Hi,

I am not sure w need the webmozart/assert dependency for just one verification.
Let me squash this PR before any action (I am not with my usual setup at the moment).

Regards.

@Spomky Spomky requested review from chr-hertel and Nyholm as code owners July 11, 2025 12:59
@Spomky Spomky marked this pull request as draft July 11, 2025 13:02
Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Thank you. I agree

@@ -24,6 +23,6 @@ public function __construct(
public string $content,
public Metadata $metadata = new Metadata(),
) {
Assert::stringNotEmpty(trim($this->content));
'' !== trim($this->content) || throw new \InvalidArgumentException('The content shall not be an empty string');
Copy link
Member

Choose a reason for hiding this comment

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

Let's be more explicit and do

if ('' === trim($this->content)) {
  throw new \InvalidArgumentException('The content shall not be an empty string');
}

@chr-hertel
Copy link
Contributor

yes, agree as well, but for the Platform component you'd need to replace more code - or keep it for now and only take action on store

@Spomky
Copy link
Author

Spomky commented Jul 11, 2025

Yes indeed. I will continue this PR when I get back home on Thursday.

@chr-hertel chr-hertel added Store Issues & PRs about the AI Store component Status: Needs Work labels Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Work Store Issues & PRs about the AI Store component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants