Closed clarknelson closed 2 years ago
The error shows there cannot be type here:
-public string $schemaVersion = '1.0.0';
+public $schemaVersion = '1.0.0';
What is your version?
composer show craftcms/cms
Here's the output of that command:
name : craftcms/cms
descrip. : Craft CMS
keywords : cms, craftcms, yii2
versions : * 3.7.43
type : library
license : proprietary
homepage : https://craftcms.com
source : [git] https://github.com/craftcms/cms.git 7c58e9774db289725803c60f32b0d862a6e6e36c
dist : [zip] https://api.github.com/repos/craftcms/cms/zipball/7c58e9774db289725803c60f32b0d862a6e6e36c 7c58e9774db289725803c60f32b0d862a6e6e36c
path : /Users/clark/Documents/Websites/clarknelson.com/craft-recaptcha-3/vendor/craftcms/cms
names : craftcms/cms, bower-asset/inputmask, bower-asset/jquery, bower-asset/punycode, bower-asset/yii2-pjax, yii2tech/ar-softdelete
support
docs : https://craftcms.com/docs/3.x/
email : support@craftcms.com
forum : https://craftcms.stackexchange.com/
issues : https://github.com/craftcms/cms/issues?state=open
rss : https://github.com/craftcms/cms/releases.atom
source : https://github.com/craftcms/cms
autoload
psr-4
craft\ => src/
yii2tech\ar\softdelete\ => lib/ar-softdelete/src/
requires
composer/composer 2.2.12
craftcms/oauth2-craftid ~1.0.0
craftcms/plugin-installer ~1.5.6
craftcms/server-check ~1.2.0
creocoder/yii2-nested-sets ~0.9.0
elvanto/litemoji ^3.0.1
enshrined/svg-sanitize ~0.15.2
ext-curl *
ext-dom *
ext-json *
ext-mbstring *
ext-openssl *
ext-pcre *
ext-pdo *
ext-zip *
guzzlehttp/guzzle ^6.5.5|^7.2.0
laminas/laminas-feed ~2.12.3|^2.13.1
league/flysystem ^1.1.4
league/oauth2-client ^2.6.0
mikehaertl/php-shellcommand ^1.6.3
php >=7.2.5
pixelandtonic/imagine ~1.2.4.1
seld/cli-prompt ^1.0.4
symfony/yaml ^5.2.1
true/punycode ^2.1.1
twig/twig ~2.14.3
voku/stringy ^6.4.0
webonyx/graphql-php ~14.11.5
yiisoft/yii2 ~2.0.45.0
yiisoft/yii2-debug ^2.1.16
yiisoft/yii2-queue ~2.3.2
yiisoft/yii2-swiftmailer ^2.1.2
requires (dev)
codeception/codeception ^4.0.0
codeception/module-asserts ^1.0.0
codeception/module-datafactory ^1.0.0
codeception/module-phpbrowser ^1.0.0
codeception/module-rest ^1.0.0
codeception/module-yii2 ^1.0.0
craftcms/ecs dev-main
fzaninotto/faker ^1.8
league/factory-muffin ^3.0
vlucas/phpdotenv ^3.0
suggests
ext-iconv Adds support for more character encodings than PHP’s built-in mb_convert_encoding() function, which Craft will take advantage of when converting strings to UTF-8.
ext-imagick Adds support for more image processing formats and options.
ext-intl Adds rich internationalization support.
provides
bower-asset/inputmask ~3.2.2 | ~3.3.5
bower-asset/jquery 3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable
bower-asset/punycode 1.3.*
bower-asset/yii2-pjax ~2.0.1
yii2tech/ar-softdelete 1.0.4
conflicts
league/oauth2-client 2.4.0
I removed the "string" type declaration, ran the script again, and it looks like it worked fine!
@clarknelson That's good news :+1: I wonder if we can fix it in an automated way here. Could you share the PR where you've run the Rector upgrade?
I've made a few commits to the plugin today on the master branch: https://github.com/clarknelson/craft-recaptcha-3
It seems like Craft 3 does not allow the "string" type declaration and Craft 4 requires the "string" type declaration, so I am going to release a 4.0.0 version for Craft 4 users. Craft 3 users can continue to use 1.2.2. Does this sound correct? It's a very simple plugin so I would like to have one version that supports both but I'm okay with the solution as listed.
I see. You've run Craft 4 upgrade set - https://github.com/craftcms/rector/tree/main/sets, but want to upgrade to Craft 3. In that case it's expected :)
Craft 4 requires the "string" type declaration, so I am going to release a 4.0.0 version for Craft 4 users
Sounds good :+1:
It's a very simple plugin so I would like to have one version that supports both but I'm okay with the solution as listed.
I don't think that's possible, as there are BC breaks. That's why it's mayor release. Yet new tags don't delete the new ones. So old users will simply use your version 3, that will still run on Craft 3.
Description
This is what I see when I run the script:
and my main plugin class:
Any advice would be appreciated, I ran the scripts just how they are described in the documentation.