zanysoft / laravel-zip

MIT License
300 stars 95 forks source link

Unparenthesized `a ? b : c ? d : e` is deprecated. #16

Closed nothingatalldotnet closed 3 years ago

nothingatalldotnet commented 4 years ago

Unparenthesizeda ? b : c ? d : eis deprecated. Use either(a ? b : c) ? d : eora ? b : (c ? d : e){"exception":"[object] (ErrorException(code: 0): Unparenthesizeda ? b : c ? d : eis deprecated. Use either(a ? b : c) ? d : eora ? b : (c ? d : e)at /home/vagrant/tyrepress-api/vendor/zanysoft/laravel-zip/src/Zip.php:405)

Updated Laravel to 6.6 and PHP7.4

See stacktrace below

[stacktrace]
#0 /home/vagrant/api/vendor/composer/ClassLoader.php(444): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /home/vagrant/api/vendor/composer/ClassLoader.php(444): include()
#2 /home/vagrant/api/vendor/composer/ClassLoader.php(322): Composer\\Autoload\\includeFile()
#3 [internal function]: Composer\\Autoload\\ClassLoader->loadClass()
#4 /home/vagrant/api/vendor/zanysoft/laravel-zip/src/ZipServiceProvider.php(30): spl_autoload_call()
#5 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): ZanySoft\\Zip\\ZipServiceProvider->ZanySoft\\Zip\\{closure}()
#6 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\\Container\\Container->build()
#7 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\\Container\\Container->resolve()
#8 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(768): Illuminate\\Container\\Container->make()
#9 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(1245): Illuminate\\Foundation\\Application->make()
#10 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(182): Illuminate\\Container\\Container->offsetGet()
#11 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(150): Illuminate\\Support\\Facades\\Facade::resolveFacadeInstance()
#12 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(239): Illuminate\\Support\\Facades\\Facade::getFacadeRoot()
#13 /home/vagrant/api/app/Repositories/FeedRepository.php(1949): Illuminate\\Support\\Facades\\Facade::__callStatic()
#14 /home/vagrant/api/app/Jobs/ProcessReviews.php(36): App\\Repositories\\FeedRepository->importFromUpload()
#15 [internal function]: App\\Jobs\\ProcessReviews->handle()
#16 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#17 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Util.php(34): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#18 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\Util::unwrapIfClosure()
#19 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#20 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\\Container\\BoundMethod::call()
#21 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\\Container\\Container->call()
#22 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#23 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\\Pipeline\\Pipeline->then()
#25 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(83): Illuminate\\Bus\\Dispatcher->dispatchNow()
#26 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#27 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(85): Illuminate\\Pipeline\\Pipeline->then()
#29 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(59): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#30 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(88): Illuminate\\Queue\\CallQueuedHandler->call()
#31 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(348): Illuminate\\Queue\\Jobs\\Job->fire()
#32 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(294): Illuminate\\Queue\\Worker->process()
#33 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(247): Illuminate\\Queue\\Worker->runJob()
#34 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(112): Illuminate\\Queue\\Worker->runNextJob()
#35 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(96): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#36 [internal function]: Illuminate\\Queue\\Console\\WorkCommand->handle()
#37 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array()
#38 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Util.php(34): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#39 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\Util::unwrapIfClosure()
#40 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod()
#41 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\\Container\\BoundMethod::call()
#42 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Console/Command.php(202): Illuminate\\Container\\Container->call()
#43 /home/vagrant/api/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute()
#44 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Console/Command.php(189): Symfony\\Component\\Console\\Command\\Command->run()
#45 /home/vagrant/api/vendor/symfony/console/Application.php(1011): Illuminate\\Console\\Command->run()
#46 /home/vagrant/api/vendor/symfony/console/Application.php(272): Symfony\\Component\\Console\\Application->doRunCommand()
#47 /home/vagrant/api/vendor/symfony/console/Application.php(148): Symfony\\Component\\Console\\Application->doRun()
#48 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\\Component\\Console\\Application->run()
#49 /home/vagrant/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\\Console\\Application->run()
#50 /home/vagrant/api/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#51 {main}
"} 
nothingatalldotnet commented 4 years ago

This appears to be a PHP 7.4 issue

DougThwaites commented 4 years ago

I assume by the fact that you are using both vagrant and Laravel that you are using Homestead :)

I just came across the same issue, whilst you wait for an update you can run

php73

In your Homestead VM to downgrade the default PHP CLI to 7.3

nothingatalldotnet commented 4 years ago

Yep Homestead (sorry should have said) And yes downgrading to 7.3 resolved the issue.

mohamedFatehy commented 4 years ago

please we need fix in this issue

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

the fix is easy

replace this line (line 405) to $files = (is_array($files) ? $files : is_string($files)) ? [$files]: $files;

I'am using php 7.4

JayAhrDe commented 4 years ago

It is fixed in master-branch already, just not in the last release.

composer require zanysoft/laravel-zip:master to use the master instead of the last release.

fabiofdsantos commented 4 years ago

ping @zanysoft

SebastianMueller87 commented 4 years ago

We would also be very happy if this gets the step into a stable release. At the moment, we need to require the master branch, but as everyone can imagine, we do not want to require the master branch in our production environment. :-D

jasperf commented 4 years ago

Yeah I guess we w ill have to use composer require zanysoft/laravel-zip:master. At least until another release is tagged by @zanysoft .

juukie commented 3 years ago

Still not merged @zanysoft? Would love to see this fixed :-)

ThatProgrammerr commented 3 years ago

Can confirm, still not merged. Just spent over 40 minutes thinking it was my fault and tried to use another package, but then a friend of mine found this issue and I switched to the master instead.

cambur commented 3 years ago

anyone knows a fix for this?

cambur commented 3 years ago

wow, this is an issue since 2019...

jasperf commented 3 years ago

wow, this is an issue since 2019...

Use composer require zanysoft/laravel-zip:master for now. Either that or fork, update and add your own composer package attached to your repository. We decided to use this option and get the master branch as tag for now. May fork in the future.