Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ $fileData = [
$response = $connector->send(new CreateAPostInAGivenStream(
streamId: '6002',
text: 'Please indicate your preferred dates for next team event in the poll below. Thanks!',
html: '<p>Please <b>indicate</b> your preferred dates below.</p><p>Thanks!</p>',
title: 'Hello guys!',
labels: ['food', 'poll', 'events'],
sticky: true,
Expand Down Expand Up @@ -318,7 +319,8 @@ CodebarAg\LaravelBeekeeper\Data\Files\FileVersion {
```php
CodebarAg\LaravelBeekeeper\Data\Streams\Post {
+id: 2234 // int
+text: "Please indicate your preferred dates for next team event in the poll below. Thanks!" // string
+text: "Please indicate your preferred dates for next team event in the poll below. Thanks!" // string|null
+html: "<p>Please <b>indicate</b> your preferred dates below.</p><p>Thanks!</p>" // string|null
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

The documentation shows that the Post response object has an html property, but the actual Post data class at src/Data/Streams/Post.php does not include this field. This documentation is misleading as the html field will not actually be available on the returned Post object until the data class is updated.

This documentation should either be removed or the Post data class should be updated to include the html property.

Suggested change
+html: "<p>Please <b>indicate</b> your preferred dates below.</p><p>Thanks!</p>" // string|null

Copilot uses AI. Check for mistakes.
+title: "Hello guys!" // string|null
+labels: Illuminate\Support\Collection // Collection
+sticky: true // bool
Expand Down
1 change: 1 addition & 0 deletions src/Requests/CreateAChildToAnArtifact.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function defaultQuery(): array

public function defaultBody(): array
{

Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

[nitpick] This extra blank line appears to be unintentional and doesn't add value to the code. Consider removing it to maintain consistency with the codebase style.

Suggested change

Copilot uses AI. Check for mistakes.
$body = [
'name' => $this->name,
'type' => $this->type,
Expand Down
15 changes: 10 additions & 5 deletions src/Requests/CreateAPostInAGivenStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class CreateAPostInAGivenStream extends Request implements HasBody

public function __construct(
protected readonly string $streamId,
protected readonly string $text,
protected readonly ?string $text = null,
protected readonly ?string $html = null,
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

The html parameter is added to the request constructor and body, but the Post data class (at src/Data/Streams/Post.php) does not have an html property. This means that when the API response includes an html field, it will be silently ignored and not accessible on the returned Post object.

You need to add the html property to the Post class constructor and the make() method:

public function __construct(
    public int $id,
    public ?string $text,
    public ?string $html,  // Add this
    // ... rest of properties
)

And in the make() method:

return new self(
    id: Arr::get($data, 'id'),
    text: Arr::get($data, 'text'),
    html: Arr::get($data, 'html'),  // Add this
    // ... rest of properties
)

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +24
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

Both text and html parameters are now optional (nullable with default null), but there's no validation to ensure that at least one of them is provided. Creating a post with neither text nor html would likely result in an API error.

Consider adding validation in the constructor to ensure at least one content field is provided:

public function __construct(
    protected readonly string $streamId,
    protected readonly ?string $text = null,
    protected readonly ?string $html = null,
    // ... rest of parameters
) {
    if (empty($this->text) && empty($this->html)) {
        throw new \InvalidArgumentException('Either text or html must be provided');
    }
}

Copilot uses AI. Check for mistakes.
protected readonly ?string $title = null,
protected null|array|Collection $labels = null,
protected readonly bool $sticky = false,
Expand Down Expand Up @@ -55,14 +56,18 @@ public function defaultBody(): array
{
$body = [];

if (filled($this->title)) {
$body = Arr::add(array: $body, key: 'title', value: $this->title);
}

if (filled($this->text)) {
$body = Arr::add(array: $body, key: 'text', value: $this->text);
}

if (filled($this->html)) {
$body = Arr::add(array: $body, key: 'html', value: $this->html);
}

if (filled($this->title)) {
$body = Arr::add(array: $body, key: 'title', value: $this->title);
}

$labels = $this->labels;

if ($labels instanceof Collection) {
Expand Down