Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename interface Hooker => HookManager #587

Merged
merged 1 commit into from
Nov 5, 2021
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
2 changes: 1 addition & 1 deletion docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class names.
|-----------|----------------------------------------------|-------------------------------------------------------------------------|
| class | `Requests` | `WpOrg\Requests\Requests` <strong><sup>1</sup></strong> |
| interface | `Requests_Auth` | `WpOrg\Requests\Auth` |
| interface | `Requests_Hooker` | `WpOrg\Requests\Hooker` |
| interface | `Requests_Hooker` | `WpOrg\Requests\HookManager` |
| interface | `Requests_Transport` | `WpOrg\Requests\Transport` |
| interface | `Requests_Proxy` | `WpOrg\Requests\Proxy` |
| class | `Requests_Cookie` | `WpOrg\Requests\Cookie` |
Expand Down
2 changes: 1 addition & 1 deletion src/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class Autoload {
private static $deprecated_classes = array(
// Interfaces.
'requests_auth' => '\WpOrg\Requests\Auth',
'requests_hooker' => '\WpOrg\Requests\Hooker',
'requests_hooker' => '\WpOrg\Requests\HookManager',
'requests_proxy' => '\WpOrg\Requests\Proxy',
'requests_transport' => '\WpOrg\Requests\Transport',

Expand Down
6 changes: 3 additions & 3 deletions src/Cookie/Jar.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use ReturnTypeWillChange;
use WpOrg\Requests\Cookie;
use WpOrg\Requests\Exception;
use WpOrg\Requests\Hooker;
use WpOrg\Requests\HookManager;
use WpOrg\Requests\Iri;
use WpOrg\Requests\Response;

Expand Down Expand Up @@ -121,9 +121,9 @@ public function getIterator() {
/**
* Register the cookie handler with the request's hooking system
*
* @param \WpOrg\Requests\Hooker $hooks Hooking system
* @param \WpOrg\Requests\HookManager $hooks Hooking system
*/
public function register(Hooker $hooks) {
public function register(HookManager $hooks) {
$hooks->register('requests.before_request', array($this, 'before_request'));
$hooks->register('requests.before_redirect_check', array($this, 'before_redirect_check'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Hooker.php → src/HookManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @package Requests
* @subpackage Utilities
*/
interface Hooker {
interface HookManager {
/**
* Register a callback for a hook
*
Expand Down
4 changes: 2 additions & 2 deletions src/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace WpOrg\Requests;

use WpOrg\Requests\Exception\InvalidArgument;
use WpOrg\Requests\Hooker;
use WpOrg\Requests\HookManager;
use WpOrg\Requests\Utility\InputValidator;

/**
Expand All @@ -18,7 +18,7 @@
* @package Requests
* @subpackage Utilities
*/
class Hooks implements Hooker {
class Hooks implements HookManager {
/**
* Registered callbacks for each hook
*
Expand Down
2 changes: 1 addition & 1 deletion src/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public static function patch($url, $headers, $data = array(), $options = array()
* {@see \WpOrg\Requests\Requests::getTransport()}
* (string|\WpOrg\Requests\Transport, default: {@see \WpOrg\Requests\Requests::getTransport()})
* - `hooks`: Hooks handler.
* (\WpOrg\Requests\Hooker, default: new WpOrg\Requests\Hooks())
* (\WpOrg\Requests\HookManager, default: new WpOrg\Requests\Hooks())
* - `verify`: Should we verify SSL certificates? Allows passing in a custom
* certificate file as a string. (Using true uses the system-wide root
* certificate store instead, but this may have different behaviour
Expand Down