Skip to content

Commit

Permalink
Merge pull request #5 from enflow/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbardelmeijer committed Feb 10, 2022
2 parents b0bb64f + e64bf5b commit 7482a20
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.4, 8.0]
laravel: [8.*]
php: [8.1]
laravel: [9.*, 8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
testbench: ^6.23

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
}
],
"require": {
"php": "^7.4|^8.0",
"php": "^8.1",
"livewire/livewire": "^2.2"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3",
"rcrowe/twigbridge": "^0.12.2",
"orchestra/testbench": "^7.0",
"phpunit/phpunit": "^9.5",
"rcrowe/twigbridge": "^0.13.1",
"friendsofphp/php-cs-fixer": "^3.2"
},
"suggest": {
"rcrowe/TwigBridge": "For adding Twig support to your Laravel application"
"rcrowe/twigbridge": "For adding Twig support to your Laravel application"
},
"config": {
"sort-packages": true
Expand Down
8 changes: 5 additions & 3 deletions src/LivewireExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
namespace Enflow\LivewireTwig;

use Livewire\Livewire;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class LivewireExtension extends \Twig\Extension\AbstractExtension
class LivewireExtension extends AbstractExtension
{
public function getFunctions()
{
return [
new \Twig\TwigFunction('livewireStyles', [$this, 'livewireStyles'], ['is_safe' => ['html']]),
new \Twig\TwigFunction('livewireScripts', [$this, 'livewireScripts'], ['is_safe' => ['html']]),
new TwigFunction('livewireStyles', [$this, 'livewireStyles'], ['is_safe' => ['html']]),
new TwigFunction('livewireScripts', [$this, 'livewireScripts'], ['is_safe' => ['html']]),
];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/RenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function test_nested_component_correctly_renders()

public function test_invalid_type_throws_exception()
{
$this->expectException(\ErrorException::class);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Unexpected token "number" of value "63" ("name" or "string" expected).');
Livewire::component('counter', Counter::class);

Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
use Enflow\LivewireTwig\LivewireTwigServiceProvider;
use Livewire\LivewireServiceProvider;
use Orchestra\Testbench\TestCase as BaseTestCase;
use TwigBridge\ServiceProvider as TwigServiceProvider;

class TestCase extends BaseTestCase
{
protected function getPackageProviders($app)
{
return [
LivewireServiceProvider::class,
\TwigBridge\ServiceProvider::class,
TwigServiceProvider::class,
LivewireTwigServiceProvider::class,
];
}
Expand Down

0 comments on commit 7482a20

Please sign in to comment.