mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Added type hinting
This commit is contained in:
parent
0e0f521a10
commit
a9bbfd80c7
5 changed files with 5 additions and 5 deletions
|
@ -151,7 +151,7 @@ abstract class BaseAuthenticate {
|
||||||
* @param CakeRequest $request Request object.
|
* @param CakeRequest $request Request object.
|
||||||
* @return mixed Either false or an array of user information
|
* @return mixed Either false or an array of user information
|
||||||
*/
|
*/
|
||||||
public function getUser($request) {
|
public function getUser(CakeRequest $request) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ abstract class BaseAuthorize {
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return string the action path for the given request.
|
* @return string the action path for the given request.
|
||||||
*/
|
*/
|
||||||
public function action($request, $path = '/:plugin/:controller/:action') {
|
public function action(CakeRequest $request, $path = '/:plugin/:controller/:action') {
|
||||||
$plugin = empty($request['plugin']) ? null : Inflector::camelize($request['plugin']) . '/';
|
$plugin = empty($request['plugin']) ? null : Inflector::camelize($request['plugin']) . '/';
|
||||||
$path = str_replace(
|
$path = str_replace(
|
||||||
array(':controller', ':action', ':plugin/'),
|
array(':controller', ':action', ':plugin/'),
|
||||||
|
|
|
@ -107,7 +107,7 @@ class BasicAuthenticate extends BaseAuthenticate {
|
||||||
* @param CakeRequest $request Request object.
|
* @param CakeRequest $request Request object.
|
||||||
* @return mixed Either false or an array of user information
|
* @return mixed Either false or an array of user information
|
||||||
*/
|
*/
|
||||||
public function getUser($request) {
|
public function getUser(CakeRequest $request) {
|
||||||
$username = env('PHP_AUTH_USER');
|
$username = env('PHP_AUTH_USER');
|
||||||
$pass = env('PHP_AUTH_PW');
|
$pass = env('PHP_AUTH_PW');
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ class DigestAuthenticate extends BaseAuthenticate {
|
||||||
* @param CakeRequest $request Request object.
|
* @param CakeRequest $request Request object.
|
||||||
* @return mixed Either false or an array of user information
|
* @return mixed Either false or an array of user information
|
||||||
*/
|
*/
|
||||||
public function getUser($request) {
|
public function getUser(CakeRequest $request) {
|
||||||
$digest = $this->_getDigest();
|
$digest = $this->_getDigest();
|
||||||
if (empty($digest)) {
|
if (empty($digest)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -393,7 +393,7 @@ class AuthComponent extends Component {
|
||||||
* @param CakeRequest $request The request to authenticate for. If empty, the current request will be used.
|
* @param CakeRequest $request The request to authenticate for. If empty, the current request will be used.
|
||||||
* @return boolean True if $user is authorized, otherwise false
|
* @return boolean True if $user is authorized, otherwise false
|
||||||
*/
|
*/
|
||||||
public function isAuthorized($user = null, $request = null) {
|
public function isAuthorized($user = null, CakeRequest $request = null) {
|
||||||
if (empty($user) && !$this->user()) {
|
if (empty($user) && !$this->user()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue