From c732468af2a174c20fbfa911c0785371af3c64cc Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Wed, 23 Dec 2020 13:53:46 +0100 Subject: [PATCH 1/4] fixed deprecation --- src/Controller/UsersController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index a680837fc..e8fcfffce 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -87,7 +87,7 @@ protected function sendActivationMail(User $user): bool $token = $this->Token->create($user->get('email'), ['type' => 'signup', 'user_id' => $user->get('id')]); return (bool)$this->getMailer('MeCms.User') - ->set('url', Router::url(['_name' => 'activation', (string)$user->get('id'), $token], true)) + ->setViewVars('url', Router::url(['_name' => 'activation', (string)$user->get('id'), $token], true)) ->send('activation', [$user]); } @@ -286,7 +286,7 @@ public function passwordForgot() if ($user) { $token = $this->Token->create($email, ['type' => 'password_forgot', 'user_id' => $user->get('id')]); $this->getMailer('MeCms.User') - ->set('url', Router::url(['_name' => 'passwordReset', (string)$user->get('id'), $token], true)) + ->setViewVars('url', Router::url(['_name' => 'passwordReset', (string)$user->get('id'), $token], true)) ->send('passwordForgot', [$user]); $this->Flash->success(__d('me_cms', 'We have sent you an email to reset your password')); From 2b56b885469b8aa947f165f4efe5857474ed1e58 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Wed, 23 Dec 2020 13:57:38 +0100 Subject: [PATCH 2/4] updated --- .gitignore | 2 ++ bin/cake | 75 ---------------------------------------------------- bin/cake.bat | 27 ------------------- bin/cake.php | 16 ----------- 4 files changed, 2 insertions(+), 118 deletions(-) delete mode 100755 bin/cake delete mode 100644 bin/cake.bat delete mode 100644 bin/cake.php diff --git a/.gitignore b/.gitignore index 0bc2b5361..9a98b2da1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ .directory +.idea .phpunit.result.cache *_old *.lock *.old.* +bin/ composer.lock coverage/ plugins/ diff --git a/bin/cake b/bin/cake deleted file mode 100755 index 4b696c883..000000000 --- a/bin/cake +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env sh -################################################################################ -# -# Cake is a shell script for invoking CakePHP shell commands -# -# CakePHP(tm) : Rapid Development Framework (https://cakephp.org) -# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) -# -# Licensed under The MIT License -# For full copyright and license information, please see the LICENSE.txt -# Redistributions of files must retain the above copyright notice. -# -# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) -# @link https://cakephp.org CakePHP(tm) Project -# @since 1.2.0 -# @license https://opensource.org/licenses/mit-license.php MIT License -# -################################################################################ - -# Canonicalize by following every symlink of the given name recursively -canonicalize() { - NAME="$1" - if [ -f "$NAME" ] - then - DIR=$(dirname -- "$NAME") - NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME") - fi - while [ -h "$NAME" ]; do - DIR=$(dirname -- "$NAME") - SYM=$(readlink "$NAME") - NAME=$(cd "$DIR" > /dev/null && cd "$(dirname -- "$SYM")" > /dev/null && pwd)/$(basename -- "$SYM") - done - echo "$NAME" -} - -# Find a CLI version of PHP -findCliPhp() { - for TESTEXEC in php php-cli /usr/local/bin/php - do - SAPI=$(echo "" | $TESTEXEC 2>/dev/null) - if [ "$SAPI" = "cli" ] - then - echo $TESTEXEC - return - fi - done - echo "Failed to find a CLI version of PHP; falling back to system standard php executable" >&2 - echo "php"; -} - -# If current path is a symlink, resolve to real path -realname="$0" -if [ -L "$realname" ] -then - realname=$(readlink -f "$0") -fi - -CONSOLE=$(dirname -- "$(canonicalize "$realname")") -APP=$(dirname "$CONSOLE") - -# If your CLI PHP is somewhere that this doesn't find, you can define a PHP environment -# variable with the correct path in it. -if [ -z "$PHP" ] -then - PHP=$(findCliPhp) -fi - -if [ "$(basename "$realname")" != 'cake' ] -then - exec "$PHP" "$CONSOLE"/cake.php "$(basename "$realname")" "$@" -else - exec "$PHP" "$CONSOLE"/cake.php "$@" -fi - -exit diff --git a/bin/cake.bat b/bin/cake.bat deleted file mode 100644 index ad1378229..000000000 --- a/bin/cake.bat +++ /dev/null @@ -1,27 +0,0 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Cake is a Windows batch script for invoking CakePHP shell commands -:: -:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org) -:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) -:: -:: Licensed under The MIT License -:: Redistributions of files must retain the above copyright notice. -:: -:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) -:: @link https://cakephp.org CakePHP(tm) Project -:: @since 2.0.0 -:: @license https://opensource.org/licenses/mit-license.php MIT License -:: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -@echo off - -SET app=%0 -SET lib=%~dp0 - -php "%lib%cake.php" %* - -echo. - -exit /B %ERRORLEVEL% diff --git a/bin/cake.php b/bin/cake.php deleted file mode 100644 index 97ee683d9..000000000 --- a/bin/cake.php +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/php -q -run($argv)); From f7a039b9ed26a2b25ad9b1d0bf968e2bf54e07b7 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Wed, 23 Dec 2020 14:19:20 +0100 Subject: [PATCH 3/4] fixed --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c121683cd..966c30754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ to use with other plugins; * fixed old bug on loading theme plugins; * fixed little bug for the `description` field for `Banner` and `Photo` entities; -* added `cake` binaries and fixed composer script to extract POT files; +* fixed composer script to extract POT files; * updated for `php-tools` 1.4.5; * removed redundant code in routes; * added `phpstan`, so fixed some code and descriptions. From 7bbaad464d4b161cdb8e473bc2e73eedb9c0a0f5 Mon Sep 17 00:00:00 2001 From: mirko-pagliai Date: Wed, 23 Dec 2020 14:20:11 +0100 Subject: [PATCH 4/4] fixed for stan --- phpstan.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 1666c089d..eecc16e05 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -95,5 +95,5 @@ parameters: path: tests/TestCase/Mailer - - message: '#^Property [\w\\]+::\$Posts \(MeCms\\Model\\Table\\PostsTable\|PHPUnit\\Framework\\MockObject\\MockObject\) does not accept Cake\\ORM\\Table\.#' - path: tests/TestCase/Model/Table/Traits + message: '#^Property [\w\\]+::\$\w+ \([\w\\\|]*PHPUnit\\Framework\\MockObject\\MockObject\) does not accept Cake\\ORM\\Table\.#' + path: tests/TestCase/Model