mark-gerarts/phpstan-automapper-plus
PHPStan extension for AutoMapper+ that suppresses false “map() invoked with 3 parameters” errors while MapperInterface lacks the optional $context parameter (added post-1.0, formal in 2.0). Install via extension-installer or include phpstan.neon.
This package is a 0.1.0 initial release, meaning it’s brand new and likely focused on a single core functionality. To begin:
Installation: Add via Composer:
composer require vendor/package-name
(Replace vendor/package-name with the actual package name.)
Publish Config (if applicable): Check if the package includes a config file:
php artisan vendor:publish --provider="Vendor\PackageName\PackageServiceProvider"
(Verify the provider class in the package’s composer.json.)
Basic Usage: Review the package’s README.md for the simplest use case (e.g., a single method call or facade usage). Example:
use Vendor\PackageName\Facades\PackageName;
$result = PackageName::doSomething($input);
Documentation: Since this is version 0.1.0, the package may lack extensive docs. Check:
README.md for examples.src/ directory for class-level PHPDoc comments.PackageName::method()), prefer it for simplicity. Understand if it’s a thin wrapper or a full API.$service = app('vendor.package.service');
EventServiceProvider:
protected $listen = [
'vendor.package.event' => [
'App\Listeners\HandlePackageEvent',
],
];
public function register()
{
$this->app->bind('vendor.package.service', function ($app) {
return new CustomService($app->make('vendor.package.dependency'));
});
}
$middleware array in app/Http/Kernel.php.php artisan make:command CustomPackageCommand
0.1.0, expect breaking changes in minor releases. Pin the version in composer.json:
"require": {
"vendor/package-name": "^0.1.0"
}
User), qualify namespaces explicitly:
use Vendor\PackageName\Models\User as PackageUser;
APP_DEBUG=true) and check logs for package-related errors.php artisan container:dump
HasPackageFeature), extend them in your models:
use Vendor\PackageName\Traits\HasPackageFeature;
class MyModel extends Model
{
use HasPackageFeature;
}
'package' => [
'setting' => env('CUSTOM_VALUE', 'default'),
],
$this->app->instance('vendor.package.service', $mockService);
How can I help you explore Laravel packages today?