Skip to content

Commit

Permalink
Update TemplateOutput to implement Stringable
Browse files Browse the repository at this point in the history
  • Loading branch information
bryannielsen committed Oct 1, 2024
1 parent 048ad2c commit 52ed806
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Updated [Rcrowe/TwigBridge](https://github.com/rcrowe/TwigBridge) Dependency from version 0.14.1 to 0.14.3
- Relaxed GraphQL handling of fieldtypes during schema generation. Now errors will be logged but schemas can still be built
- Default url for ExpressionEngine Control Panel is now `admin` instead of `admin.php`. This can be changed in `config/coilpack.php`.
- TemplateOutput now implements the [Stringable](https://www.php.net/manual/en/class.stringable.php) interface

## [1.4.2] - 2024-09-26

Expand Down
4 changes: 2 additions & 2 deletions src/TemplateOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Contracts\Support\Arrayable;

class TemplateOutput implements \ArrayAccess, \Countable, \IteratorAggregate
class TemplateOutput implements \ArrayAccess, \Countable, \IteratorAggregate, \Stringable
{
protected $array = [];

Expand Down Expand Up @@ -136,7 +136,7 @@ public function offsetUnset($offset): void
unset($this->array[$offset]);
}

public function __toString()
public function __toString(): string
{
if (empty($this->string) && count($this->array) === 1 && is_string(current($this->array))) {
return current($this->array);
Expand Down

0 comments on commit 52ed806

Please sign in to comment.