born05 / craft-twofactorauthentication

Craft plugin for two-factor or two-step login using Time Based OTP.
MIT License
36 stars 26 forks source link

Syntax Error in Migration Script #78

Closed brianrivet-tilt closed 1 year ago

brianrivet-tilt commented 1 year ago

Hi,

I'm trying to update the plugin from version 2.10.1 to 2.11.0 and when Craft tries to run migrations it trips the following error:

Exception 'ParseError' with message 'syntax error, unexpected '|', expecting ';' or '{'' in /storage/XXXXXX/www/staging_html/vendor/born05/craft-twofactorauthentication/src/Plugin.php:132

Can you help me resolve?

Thanks!

Brian

mattias78 commented 1 year ago

Hi I'm having the same issue trying to update from version 2.10.1 to 2.11.0.

Craft CMS 3.8.9

Status: error

Response: {"name":"Exception","message":"syntax error, unexpected '|', expecting ';' or '{'","code":0,"error":"syntax error, unexpected '|', expecting ';' or '{'","exception":"ParseError","file":"/var/www/html/vendor/born05/craft-twofactorauthentication/src/Plugin.php","line":132,"trace":[{"file":"/var/www/html/vendor/composer/ClassLoader.php","line":428,"function":"Composer\Autoload\includeFile"},{"function":"loadClass","class":"Composer\Autoload\ClassLoader","type":"->"},{"function":"spl_autoload_call"},{"file":"/var/www/html/vendor/craftcms/cms/src/services/Plugins.php","line":917,"function":"is_subclass_of"},{"file":"/var/www/html/vendor/craftcms/cms/src/services/Plugins.php","line":232,"function":"createPlugin","class":"craft\services\Plugins","type":"->"},{"file":"/var/www/html/vendor/craftcms/cms/src/base/ApplicationTrait.php","line":1520,"function":"loadPlugins","class":"craft\services\Plugins","type":"->"},{"file":"/var/www/html/vendor/craftcms/cms/src/web/Application.php","line":99,"function":"_postInit","class":"craft\web\Application","type":"->"},{"file":"/var/www/html/vendor/yiisoft/yii2/base/BaseObject.php","line":109,"function":"init","class":"craft\web\Application","type":"->"},{"file":"/var/www/html/vendor/yiisoft/yii2/base/Application.php","line":204,"function":"construct","class":"yii\base\BaseObject","type":"->"},{"function":"construct","class":"yii\base\Application","type":"->"},{"file":"/var/www/html/vendor/yiisoft/yii2/di/Container.php","line":419,"function":"newInstanceArgs","class":"ReflectionClass","type":"->"},{"file":"/var/www/html/vendor/yiisoft/yii2/di/Container.php","line":170,"function":"build","class":"yii\di\Container","type":"->"},{"file":"/var/www/html/vendor/yiisoft/yii2/BaseYii.php","line":365,"function":"get","class":"yii\di\Container","type":"->"},{"file":"/var/www/html/vendor/craftcms/cms/src/Craft.php","line":61,"function":"createObject","class":"yii\BaseYii","type":"::"},{"file":"/var/www/html/vendor/craftcms/cms/bootstrap/bootstrap.php","line":247,"function":"createObject","class":"Craft","type":"::"},{"file":"/var/www/html/vendor/craftcms/cms/bootstrap/web.php","line":51,"function":"require"},{"file":"/var/www/html/web/index.php","line":11,"function":"require"}]}

roelvanhintum commented 1 year ago

Which php version are you using? I think i accidentally added php 8.x syntax, which should just be in the Craft CMS 4 version of the plugin.

roelvanhintum commented 1 year ago

Is this solved with version 2.11.1 of the plugin?

mattias78 commented 1 year ago

Which php version are you using? I think i accidentally added php 8.x syntax, which should just be in the Craft CMS 4 version of the plugin.

I’m using PHP version 8.1.17
brianrivet-tilt commented 1 year ago

I'm running php 7.4.3, Craft 3.8.7

roelvanhintum commented 1 year ago

@mattias78 @brianrivet-tilt Does version 2.11.1 solve the errors?

brianrivet-tilt commented 1 year ago

Yes that resolved the issue. Thanks!