Skip to content

Commit

Permalink
Rename interface Hooker => HookManager
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Nov 5, 2021
1 parent ee658fb commit d8db9fb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
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
4 changes: 2 additions & 2 deletions library/Deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
if (interface_exists('Requests_Auth') === false && interface_exists('WpOrg\Requests\Auth') === true) {
interface Requests_Auth extends WpOrg\Requests\Auth {}
}
if (interface_exists('Requests_Hooker') === false && interface_exists('WpOrg\Requests\Hooker') === true) {
interface Requests_Hooker extends WpOrg\Requests\Hooker {}
if (interface_exists('Requests_Hooker') === false && interface_exists('WpOrg\Requests\HookManager') === true) {
interface Requests_Hooker extends WpOrg\Requests\HookManager {}
}
if (interface_exists('Requests_Proxy') === false && interface_exists('WpOrg\Requests\Proxy') === true) {
interface Requests_Proxy extends WpOrg\Requests\Proxy {}
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

0 comments on commit d8db9fb

Please sign in to comment.