Skip to content

chore: Set version to 0.1.0 and add changelog - #1

Merged
nfebe merged 4 commits into
devfrom
chore/version-0.1.0
Jul 23, 2026
Merged

chore: Set version to 0.1.0 and add changelog#1
nfebe merged 4 commits into
devfrom
chore/version-0.1.0

Conversation

@nfebe

@nfebe nfebe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Switches to a standard composer version field (from package-version) and starts the package at 0.1.0, pre-1.0, ahead of its first tagged release. Adds a matching CHANGELOG entry so the release workflow can cut the tag.

Use a standard composer 'version' field and start the package pre-1.0
ahead of its first tagged release.
@sourceant

sourceant Bot commented Jul 23, 2026

Copy link
Copy Markdown

Code Review Summary

This PR performs necessary housekeeping by setting the package version and establishing a changelog. It also includes several refactors that modernize the code (moving towards native PHP functions) and improve naming consistency across the destination handlers.

🚀 Key Improvements

  • Optimized FormSubmission::fields() by using native array functions.
  • Improved naming conventions for recipients and success states.
  • Standardized secret handling in WebhookDestination.

💡 Minor Suggestions

  • Modernize property access using the null-safe operator in MailDestination.
  • Consider omitting the version field in composer.json to let VCS tags handle versioning.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

Comment thread CHANGELOG.md
@@ -0,0 +1,10 @@
# Changelog

## [0.1.0] - 2026-07-23

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The year in the release date seems to be a future date (2026). Unless this is intentional, it is likely a typo and should be updated to reflect the actual release date.

Suggested change
## [0.1.0] - 2026-07-23
+## [0.1.0] - 2025-02-24

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Coverage Report
PR coverage: 92.38%
Baseline: 0%
Change: ✅+92.4%

@github-actions

Copy link
Copy Markdown

Coverage Report
PR coverage: 92.27%
Baseline: 0%
Change: ✅+92.3%

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

Comment thread CHANGELOG.md
Comment on lines +4 to +10
- Polymorphic form collection: a Form definition and its submissions, each scoped to any owning model via an owner morph
- Public, throttled submission endpoint that resolves a form by key and records the submission
- Pluggable, delivery-agnostic destinations (mail, webhook, Mautic, Smartpings) behind a destination contract, selectable per form
- Spam protection: honeypot fields, a minimum submit time, and per-minute rate limiting
- Typed submission columns (name, email, phone, subject, message) alongside an arbitrary payload, plus a delivery log
- A FormSubmittedEvent the host can bridge to its own workflows
- Config-driven throughout: destinations, protection thresholds, and the response formatter

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To follow the 'Keep a Changelog' standard, items should be grouped under category headings such as ### Added. This improves readability and organization as the project evolves.

Suggested change
- Polymorphic form collection: a Form definition and its submissions, each scoped to any owning model via an owner morph
- Public, throttled submission endpoint that resolves a form by key and records the submission
- Pluggable, delivery-agnostic destinations (mail, webhook, Mautic, Smartpings) behind a destination contract, selectable per form
- Spam protection: honeypot fields, a minimum submit time, and per-minute rate limiting
- Typed submission columns (name, email, phone, subject, message) alongside an arbitrary payload, plus a delivery log
- A FormSubmittedEvent the host can bridge to its own workflows
- Config-driven throughout: destinations, protection thresholds, and the response formatter
### Added
- Polymorphic form collection: a Form definition and its submissions, each scoped to any owning model via an owner morph
- Public, throttled submission endpoint that resolves a form by key and records the submission
- Pluggable, delivery-agnostic destinations (mail, webhook, Mautic, Smartpings) behind a destination contract, selectable per form
- Spam protection: honeypot fields, a minimum submit time, and per-minute rate limiting
- Typed submission columns (name, email, phone, subject, message) alongside an arbitrary payload, plus a delivery log
- A FormSubmittedEvent the host can bridge to its own workflows
- Config-driven throughout: destinations, protection thresholds, and the response formatter

{
throw new RuntimeException(
'SmartPings destination is not implemented yet. Provide SMARTPINGS_CLIENT_ID and SMARTPINGS_SECRET_ID so it can be built on smartpings/php-sdk and tested.'
'SmartPings destination is not implemented yet. Set SMARTPINGS_CLIENT_ID and SMARTPINGS_SECRET_ID before enabling it.'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The updated error message implies that setting the environment variables is sufficient to enable the destination. However, the method remains unimplemented and will still throw a RuntimeException. It is clearer to state that the implementation is pending integration.

Suggested change
'SmartPings destination is not implemented yet. Set SMARTPINGS_CLIENT_ID and SMARTPINGS_SECRET_ID before enabling it.'
'SmartPings destination is not implemented yet. It requires integration with the smartpings/php-sdk.'

Rename short variables, lift an assignment out of an if condition, and
drop an unused closure parameter so the mess detector passes.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

public function deliver(FormSubmission $submission): void
{
$to = optional($submission->form)->recipient_email
$recipient = optional($submission->form)->recipient_email

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since the project uses PHP 8.0+ features (like str_starts_with), you can replace the Laravel optional() helper with the native null-safe operator (?->). This is more idiomatic in modern PHP and avoids the overhead of a helper function call.

Suggested change
$recipient = optional($submission->form)->recipient_email
$recipient = $submission->form?->recipient_email

@nfebe
nfebe merged commit 431c553 into dev Jul 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant