gitpab icon indicating copy to clipboard operation
gitpab copied to clipboard

I got error when running all "php artisan" commands

Open KeldNielsen86 opened this issue 3 years ago • 5 comments

root@server:/path/to/project/gitpab# php artisan key:generate


In FindCommand.php line 113:

  Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

root@server:/path/to/project/gitpab# php artisan migrate


In FindCommand.php line 113:

  Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

root@server:/path/to/project/gitpab# php artisan db:seed


In FindCommand.php line 113:

  Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

root@server:/path/to/project/gitpab# php artisan make:user


In FindCommand.php line 113:

  Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`


KeldNielsen86 avatar Nov 16 '22 16:11 KeldNielsen86

it seems that the error can be fixed by changing this file (around Line 111) - but I'm not sure if this will break something else or if it's a good solution, but it seems to be a workaround

nano /path/to/project/gitpab/vendor/themsaid/laravel-langman/src/Commands/FindCommand.php

FROM


foreach ($allLanguages as $languageKey) {
   $original[$languageKey] = isset($values[$languageKey]) ? $values[$languageKey] : isset($filesContent[$fileName][$languageKey][$key]) ? $filesContent[$fileName][$languageKey][$key] : ''; }

TO

foreach ($allLanguages as $languageKey) {
    $original[$languageKey] = (isset($values[$languageKey]) ? $values[$languageKey] : isset($filesContent[$fileName][$languageKey][$key])) ? $filesContent[$fileName][$languageKey][$key] : ''; }

KeldNielsen86 avatar Nov 16 '22 16:11 KeldNielsen86

Need to use php7.1 like in docker

On Wed, Nov 16, 2022, 19:47 KeldNielsen86 @.***> wrote:

@.***:/path/to/project/gitpab# php artisan key:generate

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

@.***:/path/to/project/gitpab# php artisan migrate

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

@.***:/path/to/project/gitpab# php artisan db:seed

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

@.***:/path/to/project/gitpab# php artisan make:user

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

— Reply to this email directly, view it on GitHub https://github.com/zubroide/gitpab/issues/107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGKTOBAZQIEPVZX4J5XHPDWIUFZDANCNFSM6AAAAAASCOBSBI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mnvx avatar Nov 16 '22 17:11 mnvx

Update to actual php version requires to update Laravel, I plan to do it much later

On Wed, Nov 16, 2022, 19:47 KeldNielsen86 @.***> wrote:

@.***:/path/to/project/gitpab# php artisan key:generate

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

@.***:/path/to/project/gitpab# php artisan migrate

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

@.***:/path/to/project/gitpab# php artisan db:seed

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

@.***:/path/to/project/gitpab# php artisan make:user

In FindCommand.php line 113:

Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

— Reply to this email directly, view it on GitHub https://github.com/zubroide/gitpab/issues/107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGKTOBAZQIEPVZX4J5XHPDWIUFZDANCNFSM6AAAAAASCOBSBI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mnvx avatar Nov 16 '22 17:11 mnvx

ahh okay, I am using php 7.4 . :)

KeldNielsen86 avatar Nov 16 '22 17:11 KeldNielsen86

it seems that the error can be fixed by changing this file (around Line 111) - but I'm not sure if this will break something else or if it's a good solution, but it seems to be a workaround

nano /path/to/project/gitpab/vendor/themsaid/laravel-langman/src/Commands/FindCommand.php

FROM


foreach ($allLanguages as $languageKey) {
   $original[$languageKey] = isset($values[$languageKey]) ? $values[$languageKey] : isset($filesContent[$fileName][$languageKey][$key]) ? $filesContent[$fileName][$languageKey][$key] : ''; }

TO

foreach ($allLanguages as $languageKey) {
    $original[$languageKey] = (isset($values[$languageKey]) ? $values[$languageKey] : isset($filesContent[$fileName][$languageKey][$key])) ? $filesContent[$fileName][$languageKey][$key] : ''; }

the workaround works for me, so I managed to install gitpab successfully

KeldNielsen86 avatar Nov 16 '22 22:11 KeldNielsen86