Your project must not contain invalid function or method calls 6

More information: https://insight.symfony.com/what-we-analyse/php.invalid_call

in src/SendGrid.php, line 22
  1. {
  2. $isValidInstance = $this instanceof Mailable || $this instanceof MailMessage;
  3. if ($isValidInstance && $this->mailDriver() === 'sendgrid') {
  4. $this->withSymfonyMessage(function (Email $email) use ($params) {
  5. $email->embed(static::sgEncode($params), SendgridTransport::REQUEST_BODY_PARAMETER);
    Parameter #1 $params of static method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::sgEncode() expects array<string, mixed>|string, array<string, mixed>|string|null given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. });
  7. }
  8. return $this;
  9. }
  1. public function register()
  2. {
  3. $this->app->afterResolving(MailManager::class, function (MailManager $mail_manager) {
  4. $mail_manager->extend('sendgrid', function ($config) {
  5. if (! isset($config['api_key'])) {
  6. $config = $this->app['config']->get('services.sendgrid', []);
    Cannot call method get() on mixed.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  7. }
  8. $client = new HttpClient(Arr::get($config, 'guzzle', []));
  9. $endpoint = $config['endpoint'] ?? null;
  10. return new SendgridTransport($client, $config['api_key'], $endpoint);
  1. $this->app->afterResolving(MailManager::class, function (MailManager $mail_manager) {
  2. $mail_manager->extend('sendgrid', function ($config) {
  3. if (! isset($config['api_key'])) {
  4. $config = $this->app['config']->get('services.sendgrid', []);
  5. }
  6. $client = new HttpClient(Arr::get($config, 'guzzle', []));
    Parameter #1 $array of static method Illuminate\Support\Arr::get() expects array|ArrayAccess, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  7. $endpoint = $config['endpoint'] ?? null;
  8. return new SendgridTransport($client, $config['api_key'], $endpoint);
  9. });
  1. case 'api_key':
  2. $this->apiKey = $val;
  3. continue 2;
  4. case 'personalizations':
  5. $this->setPersonalizations($data, $val);
    Parameter #2 $personalizations of method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::setPersonalizations() expects array<int, array<string, mixed>>, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. continue 2;
  7. case 'attachments':
  8. $val = array_merge($this->attachments, $val);
  9. break;
  1. case 'personalizations':
  2. $this->setPersonalizations($data, $val);
  3. continue 2;
  4. case 'attachments':
  5. $val = array_merge($this->attachments, $val);
    Parameter #2 ...$arrays of function array_merge expects array, mixed given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. break;
  7. }
  8. Arr::set($data, $key, $val);
  9. }
  1. *
  2. * @throws ClientException
  3. */
  4. protected function post(array $payload): ResponseInterface
  5. {
  6. return $this->client->request('POST', $this->endpoint, $payload);
    Parameter #3 $options of method GuzzleHttp\ClientInterface::request() expects array{base_uri?: Psr\Http\Message\UriInterface|string, allow_redirects?: array{max?: int, strict?: bool, referer?: bool, protocols?: non-empty-array<string>, on_redirect?: callable(Psr\Http\Message\RequestInterface, Psr\Http\Message\ResponseInterface, Psr\Http\Message\UriInterface): mixed, track_redirects?: bool}|bool, auth?: array{0: string, 1: string, 2?: string|null}|string|false|null, body?: callable-object|Iterator|resource|string|Stringable|null, cert?: array{0: string, 1?: string|null}|string, cert_type?: string, connect_timeout?: float|int, cookies?: GuzzleHttp\Cookie\CookieJarInterface|false, ...}, array<string, mixed> given.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  7. }
  8. public function __toString(): string
  9. {
  10. return 'sendgrid';

Your project should not use invalid return types 5

More information: https://insight.symfony.com/what-we-analyse/php.invalid_return_typehint

in src/SendGrid.php, line 34
  1. /**
  2. * @return string
  3. */
  4. private function mailDriver()
  5. {
  6. return function_exists('config') ? config('mail.default', config('mail.driver')) : env('MAIL_MAILER', env('MAIL_DRIVER'));
    Method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::mailDriver() should return string but returns mixed.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  7. }
  8. /**
  9. * @param array<string, mixed>|string $params
  10. * @return string
in src/SendGrid.php, line 47
  1. {
  2. if (is_string($params)) {
  3. return $params;
  4. }
  5. return json_encode($params);
    Method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::sgEncode() should return string but returns string|false.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. }
  7. /**
  8. * @param string|array<string, mixed> $strParams
  9. * @return array<string, mixed>
in src/SendGrid.php, line 61
  1. if (! is_string($strParams)) {
  2. return $strParams;
  3. }
  4. $params = json_decode($strParams, true);
  5. return is_array($params) ? $params : [];
    Method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::decode() should return array<string, mixed> but returns array<mixed>.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. }
  7. }
  1. 'type' => 'text/html',
  2. 'value' => $email->getHtmlBody(),
  3. ];
  4. }
  5. return $contents;
    Method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::getContents() should return array<int, array<string, string>> but returns list<array<string, resource|string>>.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. }
  7. /**
  8. * @return array<string, string>|null
  9. */
  1. return $attachments;
  2. }
  3. private function getAttachmentName(DataPart $dataPart): string
  4. {
  5. return $dataPart->getPreparedHeaders()->getHeaderParameter('Content-Disposition', 'filename');
    Method Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport::getAttachmentName() should return string but returns string|null.
    Time to fix: about 9 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by s-ichikawa
  6. }
  7. private function getAttachmentContentType(DataPart $dataPart): string
  8. {
  9. return $dataPart->getMediaType().'/'.$dataPart->getMediaSubtype();

Your project must not contain invalid instantiations 3

More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation

  1. $this->app->afterResolving(MailManager::class, function (MailManager $mail_manager) {
  2. $mail_manager->extend('sendgrid', function ($config) {
  3. if (! isset($config['api_key'])) {
  4. $config = $this->app['config']->get('services.sendgrid', []);
  5. }
  6. $client = new HttpClient(Arr::get($config, 'guzzle', []));
    Parameter #1 $config of class GuzzleHttp\Client constructor expects array{handler?: callable(Psr\Http\Message\RequestInterface, array<mixed>): GuzzleHttp\Promise\PromiseInterface<Psr\Http\Message\ResponseInterface, mixed>, base_uri?: Psr\Http\Message\UriInterface|string, transport_sharing?: string|null, max_host_connections?: int|null, max_total_connections?: int|null, allow_redirects?: array{max?: int, strict?: bool, referer?: bool, protocols?: non-empty-array<string>, on_redirect?: callable(Psr\Http\Message\RequestInterface, Psr\Http\Message\ResponseInterface, Psr\Http\Message\UriInterface): mixed, track_redirects?: bool}|bool, auth?: array{0: string, 1: string, 2?: string|null}|string|false|null, body?: callable-object|Iterator|resource|string|Stringable|null, ...}, mixed given.
    Last edited by s-ichikawa
  7. $endpoint = $config['endpoint'] ?? null;
  8. return new SendgridTransport($client, $config['api_key'], $endpoint);
  9. });
  1. $config = $this->app['config']->get('services.sendgrid', []);
  2. }
  3. $client = new HttpClient(Arr::get($config, 'guzzle', []));
  4. $endpoint = $config['endpoint'] ?? null;
  5. return new SendgridTransport($client, $config['api_key'], $endpoint);
    Parameter #3 $endpoint of class Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport constructor expects string|null, mixed given.
    Last edited by s-ichikawa
  6. });
  7. });
  8. }
  9. }
  1. $config = $this->app['config']->get('services.sendgrid', []);
  2. }
  3. $client = new HttpClient(Arr::get($config, 'guzzle', []));
  4. $endpoint = $config['endpoint'] ?? null;
  5. return new SendgridTransport($client, $config['api_key'], $endpoint);
    Parameter #2 $api_key of class Sichikawa\LaravelSendgridDriver\Transport\SendgridTransport constructor expects string, mixed given.
    Last edited by s-ichikawa
  6. });
  7. });
  8. }
  9. }