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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
.phpunit.result.cache
.phpunit.cache/
composer.lock
1 change: 0 additions & 1 deletion .phpunit.cache/test-results

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"illuminate/http": "^11.0|^12.0",
"illuminate/routing": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"vatly/vatly-fluent-php": "^0.3.0"
"vatly/vatly-fluent-php": "0.4.0-alpha.1"
},
"require-dev": {
"larastan/larastan": "^3.9",
Expand Down
34 changes: 8 additions & 26 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,37 @@ parameters:
ignoreErrors:
# Traits used via "use" statements aren't directly instantiated
- '#^Trait .+ is used zero times and is not analysed\.$#'

# BillableInterface is from external package, getMorphClass() is Laravel magic
- '#^Call to an undefined method Vatly\\Fluent\\Contracts\\BillableInterface::getMorphClass\(\)\.$#'

# Static factory methods on exceptions are safe
-
-
message: '#^Unsafe usage of new static\(\)\.$#'
path: src/Exceptions/*
-
message: '#^Unsafe usage of new static\(\)\.$#'
path: src/VatlyApiActions/*Response.php

# API package returns BaseResource, runtime type is correct
-
message: '#^Parameter .+ expects .+, Vatly\\API\\Resources\\BaseResource.* given\.$#'
path: src/VatlyApiActions/*
# MorphTo covariance is a known Larastan limitation

# MorphTo covariance is a known Larastan limitation
-
message: '#^Method Vatly\\Laravel\\Models\\Order::owner\(\) should return Illuminate\\Database\\Eloquent\\Relations\\MorphTo.+ but returns .+\.$#'
path: src/Models/Order.php
-
message: '#^Method Vatly\\Laravel\\Models\\Subscription::owner\(\) should return Illuminate\\Database\\Eloquent\\Relations\\MorphTo.+ but returns .+\.$#'
path: src/Models/Subscription.php

# Model uses Billable trait which adds vatlyId() method
-
message: '#^Call to an undefined method Illuminate\\Database\\Eloquent\\Model::vatlyId\(\)\.$#'
path: src/Builders/CheckoutBuilder.php

# Model uses Billable trait which adds vatly_id property
-
message: '#^Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$vatly_id\.$#'
path: src/Exceptions/CustomerAlreadyCreated.php


# getOwner() returns Model with Billable trait (implements BillableInterface at runtime)
-
message: '#^Method .+::getOwner\(\) should return Vatly\\Fluent\\Contracts\\BillableInterface but returns Illuminate\\Database\\Eloquent\\Model\|null\.$#'
path: src/Models/Order.php

# Static methods called via events (dynamic handler registration)
-
message: '#^Call to an undefined static method Vatly\\Laravel\\Models\\Subscription::handle.+AtVatly\(\)\.$#'
path: src/Listeners/*
-
message: '#^Call to an undefined static method Vatly\\Laravel\\Models\\Subscription::createFromSubscriptionWasStartedAtVatly\(\)\.$#'
path: src/Listeners/StartSubscription.php

# Event method called dynamically
-
message: '#^Call to an undefined method .+::vatlyEventName\(\)\.$#'
path: src/Listeners/LogUnsupportedVatlyWebhookCallReceived.php
4 changes: 1 addition & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use Illuminate\Support\Facades\Route;
use Vatly\Laravel\Http\Controllers\VatlyInboundWebhookController;
use Vatly\Laravel\Http\Middleware\VerifyVatlyWebhookSignature;

Route::middleware(VerifyVatlyWebhookSignature::class)
->post('webhooks/vatly', VatlyInboundWebhookController::class)
Route::post('webhooks/vatly', VatlyInboundWebhookController::class)
->name('webhook');
2 changes: 1 addition & 1 deletion src/Billable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Your model should also implement BillableInterface:
*
* ```php
* use Vatly\Laravel\Contracts\BillableInterface;
* use Vatly\Fluent\Contracts\BillableInterface;
* use Vatly\Laravel\Billable;
*
* class User extends Model implements BillableInterface
Expand Down
21 changes: 0 additions & 21 deletions src/Contracts/BillableInterface.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Events/BaseVatlyEvent.php

This file was deleted.

19 changes: 0 additions & 19 deletions src/Events/Inbound/BaseAtVatlyEvent.php

This file was deleted.

28 changes: 0 additions & 28 deletions src/Events/Inbound/SubscriptionWasCanceledImmediatelyAtVatly.php

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions src/Events/Inbound/SubscriptionWasStartedAtVatly.php

This file was deleted.

34 changes: 0 additions & 34 deletions src/Events/Inbound/UnsupportedVatlyWebhookCallReceived.php

This file was deleted.

46 changes: 0 additions & 46 deletions src/Events/Inbound/VatlyWebhookCallReceived.php

This file was deleted.

17 changes: 0 additions & 17 deletions src/Events/OrderPaid.php

This file was deleted.

17 changes: 0 additions & 17 deletions src/Events/SubscriptionCanceledImmediately.php

This file was deleted.

Loading
Loading