From f9fc266a8cb9369d7853fdcee91ea68c02fef1d2 Mon Sep 17 00:00:00 2001 From: Kevin Klein Date: Tue, 2 Dec 2025 15:11:05 -0800 Subject: [PATCH] Update guzzle version --- .gitignore | 1 + LICENSE.md | 2 +- README.md | 12 ++++++------ composer.json | 18 ++++++++---------- src/ActionConfirmation.php | 2 +- src/Attachment.php | 6 +++--- src/AttachmentAction.php | 4 ++-- src/AttachmentField.php | 2 +- src/Client.php | 12 ++++++------ src/Message.php | 27 ++++++++++++--------------- tests/AttachmentUnitTest.php | 6 +++--- tests/ClientFunctionalTest.php | 4 ++-- tests/ClientUnitTest.php | 8 ++++---- tests/MessageUnitTest.php | 8 ++++---- 14 files changed, 54 insertions(+), 58 deletions(-) diff --git a/.gitignore b/.gitignore index 5826402..9c10d38 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.phar composer.lock .DS_Store +.idea diff --git a/LICENSE.md b/LICENSE.md index 4fa569b..91132fc 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2014, Regan McEntyre (maknz) +Copyright (c) 2014, Regan McEntyre (passwd) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 9d8b4cb..0c80f7c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Slack for PHP -[![Build Status](https://travis-ci.org/maknz/slack.svg?branch=master)](https://travis-ci.org/maknz/slack) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/maknz/slack/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/maknz/slack/?branch=master) +[![Build Status](https://travis-ci.org/passwd/slack.svg?branch=master)](https://travis-ci.org/passwd/slack) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/passwd/slack/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/passwd/slack/?branch=master) [![StyleCI](https://styleci.io/repos/19448330/shield)](https://styleci.io/repos/19448330) A simple PHP package for sending messages to [Slack](https://slack.com) with [incoming webhooks](https://my.slack.com/services/new/incoming-webhook), focussed on ease-of-use and elegant syntax. **Note: this package is no longer being actively maintained.** -* Laravel integration: [Slack for Laravel](https://github.com/maknz/slack-laravel) +* Laravel integration: [Slack for Laravel](https://github.com/passwd/slack-laravel) * Symfony integration: [NexySlackBundle](https://github.com/nexylan/NexySlackBundle) ## Requirements @@ -18,7 +18,7 @@ A simple PHP package for sending messages to [Slack](https://slack.com) with [in You can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root: ```sh -composer require maknz/slack +composer require passwd/slack ``` Then [create an incoming webhook](https://my.slack.com/services/new/incoming-webhook) on your Slack account for the package to use. You'll need the webhook URL to instantiate the client (or for the configuration file if using Laravel). @@ -29,7 +29,7 @@ Then [create an incoming webhook](https://my.slack.com/services/new/incoming-web ```php // Instantiate without defaults -$client = new Maknz\Slack\Client('https://hooks.slack.com/...'); +$client = new Passwd\Slack\Client('https://hooks.slack.com/...'); // Instantiate with defaults, so all messages created // will be sent from 'Cyril' and to the #accounting channel @@ -40,7 +40,7 @@ $settings = [ 'link_names' => true ]; -$client = new Maknz\Slack\Client('https://hooks.slack.com/...', $settings); +$client = new Passwd\Slack\Client('https://hooks.slack.com/...', $settings); ``` #### Settings diff --git a/composer.json b/composer.json index b50c9bc..2c7e262 100644 --- a/composer.json +++ b/composer.json @@ -1,30 +1,28 @@ { - "name": "maknz/slack", + "name": "passwd/slack", "description": "A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.", - "keywords": ["laravel", "slack"], "license": "BSD-2-Clause", "authors": [ { - "name": "maknz", + "name": "passwd", "email": "github@mak.geek.nz" - } + }, + { + "name": "passwd" + } ], "require": { "php": ">=5.5.0", - "guzzlehttp/guzzle": "~6.0|~5.0|~4.0", + "guzzlehttp/guzzle": "~7.0", "ext-mbstring": "*" }, "require-dev": { "phpunit/phpunit": "4.2.*", "mockery/mockery": "0.9.*" }, - "suggest": { - "maknz/slack-laravel": "Required for Laravel support", - "nexylan/slack-bundle": "Required for Symfony bundle support" - }, "autoload": { "psr-4": { - "Maknz\\Slack\\": "src/" + "Passwd\\Slack\\": "src/" } }, "minimum-stability": "stable" diff --git a/src/ActionConfirmation.php b/src/ActionConfirmation.php index 4926d51..d70ad09 100644 --- a/src/ActionConfirmation.php +++ b/src/ActionConfirmation.php @@ -1,6 +1,6 @@ icon = $this->iconType = null; - - return; + return $this; } if (mb_substr($icon, 0, 1) == ':' && mb_substr($icon, mb_strlen($icon) - 1, 1) == ':') { @@ -193,7 +192,6 @@ public function setIcon($icon) } $this->icon = $icon; - return $this; } @@ -223,11 +221,11 @@ public function getAllowMarkdown() * Slack's Markdown-like language. * * @param bool $value - * @return void + * @return $this */ public function setAllowMarkdown($value) { - $this->allow_markdown = (bool) $value; + $this->allow_markdown = (bool)$value; return $this; } @@ -235,7 +233,7 @@ public function setAllowMarkdown($value) /** * Enable Markdown formatting for the message. * - * @return void + * @return $this */ public function enableMarkdown() { @@ -247,7 +245,7 @@ public function enableMarkdown() /** * Disable Markdown formatting for the message. * - * @return void + * @return $this */ public function disableMarkdown() { @@ -272,7 +270,7 @@ public function getMarkdownInAttachments() * in Slack's Markdown-like language. * * @param array $fields - * @return void + * @return $this */ public function setMarkdownInAttachments(array $fields) { @@ -335,7 +333,7 @@ public function attach($attachment) } elseif (is_array($attachment)) { $attachmentObject = new Attachment($attachment); - if (! isset($attachment['mrkdwn_in'])) { + if (!isset($attachment['mrkdwn_in'])) { $attachmentObject->setMarkdownFields($this->getMarkdownInAttachments()); } @@ -344,7 +342,7 @@ public function attach($attachment) return $this; } - throw new InvalidArgumentException('Attachment must be an instance of Maknz\\Slack\\Attachment or a keyed array'); + throw new InvalidArgumentException('Attachment must be an instance of Passwd\\Slack\\Attachment or a keyed array'); } /** @@ -390,7 +388,7 @@ public function clearAttachments() * Send the message. * * @param string $text The text to send - * @return void + * @return $this */ public function send($text = null) { @@ -399,7 +397,6 @@ public function send($text = null) } $this->client->sendMessage($this); - return $this; } } diff --git a/tests/AttachmentUnitTest.php b/tests/AttachmentUnitTest.php index e5c5bdd..6a3c297 100644 --- a/tests/AttachmentUnitTest.php +++ b/tests/AttachmentUnitTest.php @@ -1,8 +1,8 @@ assertInstanceOf('Maknz\Slack\Client', $client); + $this->assertInstanceOf('Passwd\Slack\Client', $client); $this->assertSame('http://fake.endpoint', $client->getEndpoint()); } @@ -57,7 +57,7 @@ public function testCreateMessage() $message = $client->createMessage(); - $this->assertInstanceOf('Maknz\Slack\Message', $message); + $this->assertInstanceOf('Passwd\Slack\Message', $message); $this->assertSame($client->getDefaultChannel(), $message->getChannel()); @@ -72,7 +72,7 @@ public function testWildcardCallToMessage() $message = $client->to('@regan'); - $this->assertInstanceOf('Maknz\Slack\Message', $message); + $this->assertInstanceOf('Passwd\Slack\Message', $message); $this->assertSame('@regan', $message->getChannel()); } diff --git a/tests/MessageUnitTest.php b/tests/MessageUnitTest.php index bfb57ab..c1f731a 100644 --- a/tests/MessageUnitTest.php +++ b/tests/MessageUnitTest.php @@ -1,13 +1,13 @@ assertInstanceOf('Maknz\Slack\Message', $this->getMessage()); + $this->assertInstanceOf('Passwd\Slack\Message', $this->getMessage()); } public function testSetText() @@ -182,6 +182,6 @@ public function testSetIconToUrl() protected function getMessage() { - return new Message(Mockery::mock('Maknz\Slack\Client')); + return new Message(Mockery::mock('Passwd\Slack\Client')); } }