Skip to content

Commit

Permalink
change "Cake\Network\Response" to "Cake\Http\Response"
Browse files Browse the repository at this point in the history
  • Loading branch information
saeideng committed Feb 27, 2017
1 parent 6e7dcfa commit b4212c7
Show file tree
Hide file tree
Showing 43 changed files with 116 additions and 116 deletions.
8 changes: 4 additions & 4 deletions src/Auth/BaseAuthenticate.php
Expand Up @@ -16,8 +16,8 @@
use Cake\Controller\ComponentRegistry;
use Cake\Core\InstanceConfigTrait;
use Cake\Event\EventListenerInterface;
use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\Network\Response;
use Cake\ORM\TableRegistry;

/**
Expand Down Expand Up @@ -194,7 +194,7 @@ public function needsPasswordRehash()
* Authenticate a user based on the request information.
*
* @param \Cake\Http\ServerRequest $request Request to get authentication information from.
* @param \Cake\Network\Response $response A response object that can have headers added.
* @param \Cake\Http\Response $response A response object that can have headers added.
* @return mixed Either false on failure, or an array of user data on success.
*/
abstract public function authenticate(ServerRequest $request, Response $response);
Expand All @@ -216,11 +216,11 @@ public function getUser(ServerRequest $request)
* can be:
*
* - Null - No action taken, AuthComponent should return appropriate response.
* - Cake\Network\Response - A response object, which will cause AuthComponent to
* - Cake\Http\Response - A response object, which will cause AuthComponent to
* simply return that response.
*
* @param \Cake\Http\ServerRequest $request A request object.
* @param \Cake\Network\Response $response A response object.
* @param \Cake\Http\Response $response A response object.
* @return void
*/
public function unauthenticated(ServerRequest $request, Response $response)
Expand Down
6 changes: 3 additions & 3 deletions src/Auth/BasicAuthenticate.php
Expand Up @@ -14,9 +14,9 @@
*/
namespace Cake\Auth;

use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\Network\Exception\UnauthorizedException;
use Cake\Network\Response;

/**
* Basic Authentication adapter for AuthComponent.
Expand Down Expand Up @@ -57,7 +57,7 @@ class BasicAuthenticate extends BaseAuthenticate
* login using HTTP auth.
*
* @param \Cake\Http\ServerRequest $request The request to authenticate with.
* @param \Cake\Network\Response $response The response to add headers to.
* @param \Cake\Http\Response $response The response to add headers to.
* @return mixed Either false on failure, or an array of user data on success.
*/
public function authenticate(ServerRequest $request, Response $response)
Expand Down Expand Up @@ -87,7 +87,7 @@ public function getUser(ServerRequest $request)
* Handles an unauthenticated access attempt by sending appropriate login headers
*
* @param \Cake\Http\ServerRequest $request A request object.
* @param \Cake\Network\Response $response A response object.
* @param \Cake\Http\Response $response A response object.
* @return void
* @throws \Cake\Network\Exception\UnauthorizedException
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Auth/FormAuthenticate.php
Expand Up @@ -15,8 +15,8 @@
*/
namespace Cake\Auth;

use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\Network\Response;

/**
* An authentication adapter for AuthComponent. Provides the ability to authenticate using POST
Expand Down Expand Up @@ -63,7 +63,7 @@ protected function _checkFields(ServerRequest $request, array $fields)
* there is no post data, either username or password is missing, or if the scope conditions have not been met.
*
* @param \Cake\Http\ServerRequest $request The request that contains login information.
* @param \Cake\Network\Response $response Unused response object.
* @param \Cake\Http\Response $response Unused response object.
* @return mixed False on login failure. An array of User data on success.
*/
public function authenticate(ServerRequest $request, Response $response)
Expand Down
4 changes: 2 additions & 2 deletions src/Auth/Storage/SessionStorage.php
Expand Up @@ -15,8 +15,8 @@
namespace Cake\Auth\Storage;

use Cake\Core\InstanceConfigTrait;
use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\Network\Response;

/**
* Session based persistent storage for authenticated user record.
Expand Down Expand Up @@ -62,7 +62,7 @@ class SessionStorage implements StorageInterface
* Constructor.
*
* @param \Cake\Http\ServerRequest $request Request instance.
* @param \Cake\Network\Response $response Response instance.
* @param \Cake\Http\Response $response Response instance.
* @param array $config Configuration list.
*/
public function __construct(ServerRequest $request, Response $response, array $config = [])
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Component.php
Expand Up @@ -74,7 +74,7 @@ class Component implements EventListenerInterface
/**
* Response object
*
* @var \Cake\Network\Response
* @var \Cake\Http\Response
* @deprecated 3.4.0 Storing references to the response is deprecated. Use Component::getController()
* or callback $event->getSubject() to access the controller & response instead.
*/
Expand Down
12 changes: 6 additions & 6 deletions src/Controller/Component/AuthComponent.php
Expand Up @@ -21,9 +21,9 @@
use Cake\Core\Exception\Exception;
use Cake\Event\Event;
use Cake\Event\EventDispatcherTrait;
use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\Network\Exception\ForbiddenException;
use Cake\Network\Response;
use Cake\Routing\Router;
use Cake\Utility\Hash;

Expand Down Expand Up @@ -214,7 +214,7 @@ class AuthComponent extends Component
/**
* Response object
*
* @var \Cake\Network\Response
* @var \Cake\Http\Response
*/
public $response;

Expand Down Expand Up @@ -261,7 +261,7 @@ public function initialize(array $config)
* Callback for Controller.startup event.
*
* @param \Cake\Event\Event $event Event instance.
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
*/
public function startup(Event $event)
{
Expand All @@ -276,7 +276,7 @@ public function startup(Event $event)
* `checkAuthIn` config.
*
* @param \Cake\Event\Event $event Event instance.
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
*/
public function authCheck(Event $event)
{
Expand Down Expand Up @@ -361,7 +361,7 @@ protected function _isAllowed(Controller $controller)
* is returned.
*
* @param \Cake\Controller\Controller $controller A reference to the controller object.
* @return \Cake\Network\Response|null Null if current action is login action
* @return \Cake\Http\Response|null Null if current action is login action
* else response object returned by authenticate object or Controller::redirect().
* @throws \Cake\Core\Exception\Exception
*/
Expand Down Expand Up @@ -447,7 +447,7 @@ protected function _isLoginAction(Controller $controller)
* Handle unauthorized access attempt
*
* @param \Cake\Controller\Controller $controller A reference to the controller object
* @return \Cake\Network\Response
* @return \Cake\Http\Response
* @throws \Cake\Network\Exception\ForbiddenException
*/
protected function _unauthorized(Controller $controller)
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/Component/CookieComponent.php
Expand Up @@ -15,9 +15,9 @@
namespace Cake\Controller\Component;

use Cake\Controller\Component;
use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\I18n\Time;
use Cake\Network\Response;
use Cake\Utility\CookieCryptTrait;
use Cake\Utility\Hash;
use Cake\Utility\Security;
Expand All @@ -26,7 +26,7 @@
* Cookie Component.
*
* Provides enhanced cookie handling features for use in the controller layer.
* In addition to the basic features offered be Cake\Network\Response, this class lets you:
* In addition to the basic features offered be Cake\Http\Response, this class lets you:
*
* - Create and read encrypted cookies.
* - Store non-scalar data.
Expand Down Expand Up @@ -101,10 +101,10 @@ class CookieComponent extends Component
protected $_loaded = [];

/**
* A reference to the Controller's Cake\Network\Response object.
* A reference to the Controller's Cake\Http\Response object.
* Currently unused.
*
* @var \Cake\Network\Response|null
* @var \Cake\Http\Response|null
* @deprecated 3.4.0 Will be removed in 4.0.0
*/
protected $_response = null;
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Component/CsrfComponent.php
Expand Up @@ -16,10 +16,10 @@

use Cake\Controller\Component;
use Cake\Event\Event;
use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\I18n\Time;
use Cake\Network\Exception\InvalidCsrfTokenException;
use Cake\Network\Response;
use Cake\Utility\Security;

/**
Expand Down Expand Up @@ -119,7 +119,7 @@ public function implementedEvents()
* token is available in the request data.
*
* @param \Cake\Http\ServerRequest $request The request object.
* @param \Cake\Network\Response $response The response object.
* @param \Cake\Http\Response $response The response object.
* @return void
*/
protected function _setCookie(ServerRequest $request, Response $response)
Expand Down
14 changes: 7 additions & 7 deletions src/Controller/Component/RequestHandlerComponent.php
Expand Up @@ -21,7 +21,7 @@
use Cake\Core\Configure;
use Cake\Core\Exception\Exception;
use Cake\Event\Event;
use Cake\Network\Response;
use Cake\Http\Response;
use Cake\Routing\Router;
use Cake\Utility\Exception\XmlException;
use Cake\Utility\Inflector;
Expand Down Expand Up @@ -149,7 +149,7 @@ public function initialize(array $config)
* is to avoid issues with browsers that prefer HTML and several other content types.
*
* @param \Cake\Http\ServerRequest $request The request instance.
* @param \Cake\Network\Response $response The response instance.
* @param \Cake\Http\Response $response The response instance.
* @return void
*/
protected function _setExtension($request, $response)
Expand Down Expand Up @@ -247,8 +247,8 @@ public function convertXml($xml)
*
* @param \Cake\Event\Event $event The Controller.beforeRedirect event.
* @param string|array $url A string or array containing the redirect location
* @param \Cake\Network\Response $response The response object.
* @return \Cake\Network\Response|null The response object if the redirect is caught.
* @param \Cake\Http\Response $response The response object.
* @return \Cake\Http\Response|null The response object if the redirect is caught.
* @deprecated 3.3.5 This functionality will be removed in 4.0.0. You can disable this function
* now by setting the `enableBeforeRedirect` config option to false.
*/
Expand Down Expand Up @@ -299,9 +299,9 @@ public function beforeRedirect(Event $event, $url, Response $response)
* `app/View/Controller/xml/action.ctp`. Also if `controller/action` is
* requested with `Accept: application/xml` in the headers the view
* path will become `app/View/Controller/xml/action.ctp`. Layout and template
* types will only switch to mime-types recognized by Cake\Network\Response.
* types will only switch to mime-types recognized by Cake\Http\Response.
* If you need to declare additional mime-types, you can do so using
* Cake\Network\Response::type() in your controller's beforeFilter() method.
* Cake\Http\Response::type() in your controller's beforeFilter() method.
* - If a helper with the same name as the extension exists, it is added to
* the controller.
* - If the extension is of a type that RequestHandler understands, it will
Expand Down Expand Up @@ -607,7 +607,7 @@ public function renderAs(Controller $controller, $type, array $options = [])

/**
* Sets the response header based on type map index name. This wraps several methods
* available on Cake\Network\Response. It also allows you to use Content-Type aliases.
* available on Cake\Http\Response. It also allows you to use Content-Type aliases.
*
* @param string|array $type Friendly type name, i.e. 'html' or 'xml', or a full content-type,
* like 'application/x-shockwave'.
Expand Down
26 changes: 13 additions & 13 deletions src/Controller/Controller.php
Expand Up @@ -20,9 +20,9 @@
use Cake\Event\EventDispatcherInterface;
use Cake\Event\EventDispatcherTrait;
use Cake\Event\EventListenerInterface;
use Cake\Http\Response;
use Cake\Http\ServerRequest;
use Cake\Log\LogTrait;
use Cake\Network\Response;
use Cake\ORM\Locator\LocatorAwareTrait;
use Cake\Routing\RequestActionTrait;
use Cake\Routing\Router;
Expand Down Expand Up @@ -130,7 +130,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
/**
* An instance of a Response object that contains information about the impending response
*
* @var \Cake\Network\Response
* @var \Cake\Http\Response
* @link http://book.cakephp.org/3.0/en/controllers/request-response.html#response
*/
public $response;
Expand All @@ -140,7 +140,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
*
* @var string
*/
protected $_responseClass = 'Cake\Network\Response';
protected $_responseClass = 'Cake\Http\Response';

/**
* Settings for pagination.
Expand Down Expand Up @@ -224,7 +224,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
*
* @param \Cake\Http\ServerRequest|null $request Request object for this controller. Can be null for testing,
* but expect that features that use the request parameters will not work.
* @param \Cake\Network\Response|null $response Response object for this controller.
* @param \Cake\Http\Response|null $response Response object for this controller.
* @param string|null $name Override the name useful in testing when using mocks.
* @param \Cake\Event\EventManager|null $eventManager The event manager. Defaults to a new instance.
* @param \Cake\Controller\ComponentRegistry|null $components The component registry. Defaults to a new instance.
Expand Down Expand Up @@ -495,7 +495,7 @@ protected function _loadComponents()
* - Calls the controller `beforeFilter`.
* - triggers Component `startup` methods.
*
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
*/
public function startupProcess()
{
Expand All @@ -518,7 +518,7 @@ public function startupProcess()
* - triggers the component `shutdown` callback.
* - calls the Controller's `afterFilter` method.
*
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
*/
public function shutdownProcess()
{
Expand All @@ -536,7 +536,7 @@ public function shutdownProcess()
* @param string|array $url A string or array-based URL pointing to another location within the app,
* or an absolute URL
* @param int $status HTTP status code (eg: 301)
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
* @link http://book.cakephp.org/3.0/en/controllers.html#Controller::redirect
*/
public function redirect($url, $status = 302)
Expand Down Expand Up @@ -590,7 +590,7 @@ public function setAction($action, ...$args)
*
* @param string|null $view View to use for rendering
* @param string|null $layout Layout to use
* @return \Cake\Network\Response A response object containing the rendered view.
* @return \Cake\Http\Response A response object containing the rendered view.
* @link http://book.cakephp.org/3.0/en/controllers.html#rendering-a-view
*/
public function render($view = null, $layout = null)
Expand Down Expand Up @@ -747,7 +747,7 @@ public function isAction($action)
* or perform logic that needs to happen before each controller action.
*
* @param \Cake\Event\Event $event An Event instance
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
* @link http://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
*/
public function beforeFilter(Event $event)
Expand All @@ -760,7 +760,7 @@ public function beforeFilter(Event $event)
* to perform logic or set view variables that are required on every request.
*
* @param \Cake\Event\Event $event An Event instance
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
* @link http://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
*/
public function beforeRender(Event $event)
Expand All @@ -780,8 +780,8 @@ public function beforeRender(Event $event)
* @param \Cake\Event\Event $event An Event instance
* @param string|array $url A string or array-based URL pointing to another location within the app,
* or an absolute URL
* @param \Cake\Network\Response $response The response object.
* @return \Cake\Network\Response|null
* @param \Cake\Http\Response $response The response object.
* @return \Cake\Http\Response|null
* @link http://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
*/
public function beforeRedirect(Event $event, $url, Response $response)
Expand All @@ -793,7 +793,7 @@ public function beforeRedirect(Event $event, $url, Response $response)
* Called after the controller action is run and rendered.
*
* @param \Cake\Event\Event $event An Event instance
* @return \Cake\Network\Response|null
* @return \Cake\Http\Response|null
* @link http://book.cakephp.org/3.0/en/controllers.html#request-life-cycle-callbacks
*/
public function afterFilter(Event $event)
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Exception/Exception.php
Expand Up @@ -36,7 +36,7 @@ class Exception extends RuntimeException
protected $_messageTemplate = '';

/**
* Array of headers to be passed to Cake\Network\Response::header()
* Array of headers to be passed to Cake\Http\Response::header()
*
* @var array|null
*/
Expand Down Expand Up @@ -75,7 +75,7 @@ public function getAttributes()
/**
* Get/set the response header to be used
*
* See also Cake\Network\Response::header()
* See also Cake\Http\Response::header()
*
* @param string|array|null $header An array of header strings or a single header string
* - an associative array of "header name" => "header value"
Expand Down

0 comments on commit b4212c7

Please sign in to comment.