5 Commits
Author SHA1 Message Date
maxime a57b8fbfa5 Update src/PushTemplate.php 2026-09-25 12:09:33 +02:00
maxime 70d09c4c7c Update src/PushApi.php 2026-09-25 12:08:37 +02:00
maxime 00ab381efd Update composer.json 2026-09-25 10:53:31 +02:00
maxime 2df1092c56 Update composer.json 2026-09-25 10:50:41 +02:00
maxime 00ea95cc8d php 8.4 support 2025-12-16 16:30:18 +01:00
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -34,8 +34,8 @@
} }
}, },
"require": { "require": {
"guzzlehttp/guzzle": "^7.0.1", "guzzlehttp/guzzle": "^7.0.1 | ^8.0",
"php": "^7.3 | ^8.0" "php": "^7.4 | ^8.0"
}, },
"prefer-stable": true "prefer-stable": true
} }
+1 -1
View File
@@ -106,7 +106,7 @@ class PushApi
} }
} }
return $client->request('post', $url, [ return $client->request('POST', $url, [
'multipart' => $multipart_form, 'multipart' => $multipart_form,
'headers' => [ 'headers' => [
'Authorization' => 'Bearer ' . $this->api_key, 'Authorization' => 'Bearer ' . $this->api_key,
+7 -7
View File
@@ -85,7 +85,7 @@ class PushTemplate implements \JsonSerializable
* @param string|null $name * @param string|null $name
* @return $this * @return $this
*/ */
public function sender(string $email, string $name = null): PushTemplate public function sender(string $email, ?string $name = null): PushTemplate
{ {
$this->sender['email'] = $email; $this->sender['email'] = $email;
@@ -100,7 +100,7 @@ class PushTemplate implements \JsonSerializable
* @param string|null $name * @param string|null $name
* @return $this * @return $this
*/ */
public function replyTo(string $email, string $name = null): PushTemplate public function replyTo(string $email, ?string $name = null): PushTemplate
{ {
$this->replyTo['email'] = $email; $this->replyTo['email'] = $email;
@@ -156,7 +156,7 @@ class PushTemplate implements \JsonSerializable
* @param string|null $unsubscribe_url * @param string|null $unsubscribe_url
* @return $this * @return $this
*/ */
public function addRecipient(string $email, string $name = null, array $parameters = [], string $unsubscribe_url = null, string $locale = null): PushTemplate public function addRecipient(string $email, ?string $name = null, array $parameters = [], ?string $unsubscribe_url = null, ?string $locale = null): PushTemplate
{ {
$data = [ $data = [
'email' => $email 'email' => $email
@@ -212,7 +212,7 @@ class PushTemplate implements \JsonSerializable
* @param $filename * @param $filename
* @return $this * @return $this
*/ */
public function addAttachment($file, $filename = null) public function addAttachment($file, ?string $filename = null)
{ {
$file = is_object($file) && method_exists($file, 'getRealPath') ? $file->getRealPath() : $file; $file = is_object($file) && method_exists($file, 'getRealPath') ? $file->getRealPath() : $file;
@@ -262,14 +262,14 @@ class PushTemplate implements \JsonSerializable
* @param string|null $locale * @param string|null $locale
* @return $this * @return $this
*/ */
public function locale(string $locale = null) public function locale(?string $locale = null)
{ {
$this->locale = $locale; $this->locale = $locale;
return $this; return $this;
} }
public function unsubscribeUrl($url = null) public function unsubscribeUrl(?string $url = null)
{ {
$this->unsubscribe_url = $url; $this->unsubscribe_url = $url;
@@ -297,7 +297,7 @@ class PushTemplate implements \JsonSerializable
]; ];
} }
public function jsonSerialize() public function jsonSerialize(): mixed
{ {
return $this->toArray(); return $this->toArray();
} }