Skip to content

Commit

Permalink
Add Laravel 12 support (#3)
Browse files Browse the repository at this point in the history
* Add Laravel 12 support

* Fix styling
  • Loading branch information
tjardoo authored Feb 24, 2025
1 parent 0987d35 commit 7ec8a3a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Easier way to add Google Tag Manager to your Laravel application. Including supp

| Version | Release |
|---------|---------|
| 11.x | ^1.4 |
| 10.x | ^1.4 |
| 12.x | ^1.5 |
| 11.x | ^1.5 |

## Installation

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
}
],
"require": {
"illuminate/support": "^10.0|^11.0"
"illuminate/support": "^11.0|^12.0"
},
"require-dev": {
"orchestra/testbench": "^8.0|^9.0",
"larastan/larastan": "^2.0",
"laravel/pint": "^1.14"
"orchestra/testbench": "^9.0|^10.0",
"larastan/larastan": "^2.0|^3.1",
"laravel/pint": "^1.21"
},
"extra": {
"laravel": {
Expand Down
8 changes: 3 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ parameters:
level: 8

ignoreErrors:

excludes_analyse:

checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
- identifier: missingType.iterableValue
- identifier: missingType.generics
- identifier: argument.type
4 changes: 2 additions & 2 deletions src/TagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TagManager

public function __construct()
{
$this->data = new Collection();
$this->data = new Collection;
}

public function push(array $variables): self
Expand All @@ -32,7 +32,7 @@ public function set(Collection $data): void

public function clear(): void
{
$this->data = new Collection();
$this->data = new Collection;
}

public function event(string $name, array $variables = []): self
Expand Down
4 changes: 2 additions & 2 deletions src/TagManagerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public function register(): void
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'tagmanager');

$this->app->singleton(TagManager::class, function ($app) {
return new TagManager();
return new TagManager;
});

$this->app->singleton(MeasurementProtocol::class, function ($app) {
return new MeasurementProtocol();
return new MeasurementProtocol;
});

$this->app->alias(TagManager::class, 'tagmanager');
Expand Down
2 changes: 1 addition & 1 deletion src/View/Components/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(TagManager $tagManager, Session $session)

public function render(): View
{
$sessionData = $this->session->get(config('tagmanager.session_name')) ?? new Collection();
$sessionData = $this->session->get(config('tagmanager.session_name')) ?? new Collection;

$data = $sessionData->merge($this->tagManager->get());

Expand Down

0 comments on commit 7ec8a3a

Please sign in to comment.