Version compatible? - retrofit

Whether retrofit 2.9.0 can compatible okhttp3 version higher than 3.14.9 or not?
retrofit 2.9.0 -> okhttp3:3.14.9
sentry 5.7.3 -> okhttp3:4.9.2
last input okhttp3:4.9.2 + sentry 5.7.3 + retrofit 2.9.0

Related

Replacement for deprecated Shopware EntityRepositoryInterface is also deprecated

According to Shopware 6.4.13.0 upgrade instructions, EntityRepositoryInterface has been deprecated and should be replaced by EntityRepository. But EntityRepository is also marked as deprecated in my IDE, using the recommended development setup all upgraded to the latest versions:
PhpStorm (2022.1.3 Build #PS-221.5921.28)
Symfony Support plugin 2022.1.230
Shopware plugin 4.4.3
Shopware development setup cloned from github.com/shopware/development
Shopware platform "6.4.9999999.9999999 Developer Version"
loaded and upgraded by psh according to composer.json in development setup:
"require": {
"shopware/platform": "6.4.x#dev || dev-trunk"
Deprecation note in my PhpStorm IDE:
Class 'EntityRepository' is deprecated
class EntityRepository implements EntityRepositoryInterface \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository
Deprecated: 5.6.0
Namespace:
\Shopware\Core\Framework\DataAbstractionLayer\
Source:
development/vendor/shopware/platform/src/Core/Framework/DataAbstractionLayer/EntityRepository.php
How to handle the deprecation and what to use instead of EntityRepositoryInterface that will not be deprecated as well?
How to know if the IDE's deprecation notice can be safely ignored? I suppose that it can be ignored, as the mentioned version number "5.6.0" does not match any current or upcoming Shopware 6 release.
How to turn off misleading deprecation notices in my IDE?
Has been fixed with commit https://github.com/shopware/platform/commit/99cf9093464d679f6abcb91bb68cc4205bc6ccf0
it has now only #final https://github.com/shopware/platform/blob/trunk/src/Core/Framework/DataAbstractionLayer/EntityRepository.php#L29

Symfony Messenger 4.3 - Consuming messages from doctrine transport fails (exception thrown)

Symfony version: 4.3.2
PHP: 7.2.20
I am trying to use the messenger component with the doctrine transport asynchronously. I have installed the messenger via composer require messenger with the help of Symfony Flex.
I have activated the doctrine transport by MESSENGER_TRANSPORT_DSN=doctrine://default in the .env.local.
In the messenger config the transport is configured as well:
framework:
messenger:
transports:
async: '%env(MESSENGER_TRANSPORT_DSN)%'
routing:
'App\Message\SomeNotification': async
When dispatching the message in the controller with $this->dispatchMessage(new SomeNotification('some content')); everything is fine. The table messenger_messages of the doctrine transport gets created automatically and the message is saved in the table correctly.
When trying to consume the message with ./bin/console messenger:consume async I'm getting the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Argument 2 passed to Symfony\Component\Messenger\Worker::__construct() must implement interface Symfony\Component\Messenger\MessageBusInterface, string given, called in ..../vendor/symfony/messenger/
Command/ConsumeMessagesCommand.php on line 190
So the $routableBus in the Symfony\Component\Messenger\Command\ConsumeMessagesCommand is empty which leads to the crash when instantiating the Worker.
The answer for the question is to update symfony/framework-bundle to 4.3.2 as well. Due to a bug in the composer.json of the messenger component version 4.3.2 of the framework bundle is not enforced. This leads to the default misconfiguration when using an older version of the symfony/framework-bundle in combination with 4.3.2 of the messenger component. This explained my error since I had 4.3.0 of the framework bundle installed.
More about it can be found on the GitHub issue tracker right here:
https://github.com/symfony/symfony/issues/32738
After updating the symfony/framework-bundle everything works as expected.

Symfony - FOSUserBundle Profile view does not work after update to Symfony 2.8

I have upgraded my Symfony project from version 2.6 to 2.8 and after that, I receive an error 500 when I request the profile view. The error is:
Error: Call to a member function has() on null
Stack Trace in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php at line 350 -
*/
public function getUser()
{
if (!$this->container->has('security.token_storage')) {
throw new \LogicException('The SecurityBundle is not registered in your application.');
}
When I run composer show -i, I see the next list:
You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
doctrine/annotations v1.4.0 Docblock Annotations Parser
doctrine/cache v1.6.2 Caching library offering a...
doctrine/collections v1.4.0 Collections Abstraction li...
doctrine/common v2.7.3 Common Library for Doctrin...
doctrine/dbal v2.5.13 Database Abstraction Layer
doctrine/doctrine-bundle 1.8.1 Symfony DoctrineBundle
doctrine/doctrine-cache-bundle 1.3.2 Symfony Bundle for Doctrin...
doctrine/inflector v1.1.0 Common String Manipulation...
doctrine/instantiator 1.0.5 A small, lightweight utili...
doctrine/lexer v1.0.1 Base library for a lexer t...
doctrine/orm v2.5.14 Object-Relational-Mapper f...
friendsofsymfony/jsrouting-bundle 1.5.3 A pretty nice way to expos...
friendsofsymfony/oauth-server-bundle 1.5.0 Symfony2 OAuth Server Bundle
friendsofsymfony/oauth2-php 1.2.2 OAuth2 library
friendsofsymfony/user-bundle dev-master 9b3be01 Symfony FOSUserBundle
incenteev/composer-parameter-handler v2.1.2 Composer script handling y...
ircmaxell/password-compat v1.0.4 A compatibility library fo...
jdorn/sql-formatter v1.2.17 a PHP SQL highlighting lib...
jms/aop-bundle 1.3.0 Adds AOP capabilities to S...
jms/cg 1.2.0 Toolset for generating PHP...
jms/di-extra-bundle 1.9.1 Allows to configure depend...
jms/metadata 1.6.0 Class/method/property meta...
jms/parser-lib 1.0.0 A library for easily creat...
jms/security-extra-bundle dev-master c4a5dda Enhances the Symfony2 Secu...
knplabs/knp-snappy v1.0.4 PHP5 library allowing thum...
knplabs/knp-snappy-bundle v1.5 Easily create PDF and imag...
kriswallsmith/assetic v1.4.0 Asset Management for PHP
liuggio/ExcelBundle v2.1.0 This is a Symfony2 Bundle ...
monolog/monolog 1.23.0 Sends your logs to files, ...
paragonie/random_compat v2.0.11 PHP 5.x polyfill for rando...
phpoffice/phpexcel 1.8.1 PHPExcel - OpenXML - Read,...
phpoption/phpoption 1.5.0 Option Type for PHP
phpunit/php-code-coverage 1.2.18 Library that provides coll...
phpunit/php-file-iterator 1.4.5 FilterIterator implementat...
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 1.2.2 Wrapper around PHP's token...
phpunit/phpunit 3.7.38 The PHP Unit Testing frame...
phpunit/phpunit-mock-objects 1.2.3 Mock Object library for PH...
psr/log 1.0.2 Common interface for loggi...
sensio/distribution-bundle v2.3.22 The base bundle for the Sy...
sensio/framework-extra-bundle v3.0.29 This bundle provides a way...
sensio/generator-bundle v2.5.3 This bundle generates code...
stripe/stripe-php v3.23.0 Stripe PHP Library
swiftmailer/swiftmailer v5.4.9 Swiftmailer, free feature-...
symfony/assetic-bundle v2.8.2 Integrates Assetic into Sy...
symfony/monolog-bundle v2.12.1 Symfony MonologBundle
symfony/polyfill-intl-icu v1.7.0 Symfony polyfill for intl'...
symfony/polyfill-mbstring v1.7.0 Symfony polyfill for the M...
symfony/polyfill-php54 v1.7.0 Symfony polyfill backporti...
symfony/polyfill-php55 v1.7.0 Symfony polyfill backporti...
symfony/polyfill-php56 v1.7.0 Symfony polyfill backporti...
symfony/polyfill-php70 v1.7.0 Symfony polyfill backporti...
symfony/polyfill-util v1.7.0 Symfony utilities for port...
symfony/security-acl v2.8.0 Symfony Security Component...
symfony/swiftmailer-bundle v2.6.7 Symfony SwiftmailerBundle
symfony/symfony v2.8.0 The Symfony PHP framework
twig/extensions v1.5.1 Common additional features...
twig/twig v1.35.0 Twig, the flexible, fast, ...
willdurand/jsonp-callback-validator v1.1.0 JSONP callback validator.
I have been researching for hours and I havenĀ“t found useful information about this error.
Thanks in advance.
The issue is in your Controllers. Probably they extend Symfony\Component\ DependencyInjection\ContainerAware that is deprecated since version 2.8. Remove this and use Symfony\ Component\DependencyInjection\ ContainerAwareTrait.
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
class MyBundleController implements ContainerAwareInterface {
use ContainerAwareTrait;
/**
* #Route("/", name="_index")
* #Template()
*/
public function indexAction() {
var_dump($this->container);
return array();
}
}
Edit: Cerad was right in the comments:
there is is not need to rewrite your existing controllers that extend from Controller. The problem is in third party bundles like the FOSUserBundle which do not extend from Controller. However, even they should still work under 2.8 or at least give different errors.
It should work in either case.
References:
ref 1
Symfony 2.8 upgrade -> ContainerAwareTrait

Error while installing package in ASP.NET core app

I am using VS 2017 to create ASP.NET Core Web app. While installing Sendgrid package, I am getting following error.
Package Sendgrid 8.0.5 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Sendgrid 8.0.5 supports: net (.NETFramework,Version=v0.0)
Package Microsoft.AspNet.WebApi.Client 5.2.3 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNet.WebApi.Client 5.2.3 supports:
net45 (.NETFramework,Version=v4.5)
portable-net45+netcore45+wp8+wp81+wpa81 (.NETPortable,Version=v0.0,Profile=wp8+netcore45+net45+wp81+wpa81)
Package SendGrid.CSharp.HTTP.Client 3.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package SendGrid.CSharp.HTTP.Client 3.0.0 supports: net (.NETFramework,Version=v0.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.`
Any solution for this error?
You might need to use the pre-release version.
https://www.nuget.org/packages/SendGrid.NetCore/
The error gives you this support matrix for SendGrid 8.0.5 and its dependencies.
net net45 portable-net45+netcore45+wp8+wp81+wpa81
SendGrid 1
Microsoft.AspNet.WebApi.Client 1 1
SendGrid.CSharp.HTTP.Client 1
You can see that none of them support the Core Framework (netcoreapp) and instead require the Full Framework (net).
If you require your app to run on the Core Framework, you cannot use SendGrid 8.0.5. Your options include (but are not limited to) using SendGrid.NetCore or using MailKit.
If you do not require your app to run on the Core Framework and are okay supporting only the Full Framework (net), then you can use SendGrid 8.0.5.
For our own apps, we've elected to use MailKit version 1.10.0, because it is more mature than SendGrid.NetCore is and it supports the Core Framework. We use it as follows:
project.json
"dependencies": {
"MailKit": "1.10.0"
},
"frameworks": {
"netcoreapp1.1": {}
}
Send an email using SendGrid with MailKit.
var mimeMessage = new MimeMessage();
mimeMessage.From.Add(new MailboxAddress("Admin", "admin#mailbox.com"));
mimeMessage.To.Add(new MailboxAddress("Jon Doe", "jon#doe.com"));
mimeMessage.Subject = "An Email for You!";
mimeMessage.Body = new TextPart("html")
{
Text = "This is the message.";
};
using (var client = new SmtpClient())
{
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect("smtp.sendgrid.net", 587);
await client.AuthenticateAsync("myuser#foobar.com", "ASD43234GDX");
await client.SendAsync(mimeMessage);
client.Disconnect(true);
}

FOSRestBundle & JMSSerializerBundle with symfony 2.7 and PHP 5.5.12

I'd like to add the 2 libraries FOSRestBundle & JMSSerializerBundle to my application built with symfony 2.7 but i encountred this response
Problem 1
- Installation request for friendsofsymfony/rest-bundle dev-master -> satisfiable by friendsofsymfony/rest-bundle[dev-master].
- friendsofsymfony/rest-bundle dev-master requires php ^5.5.9|~7.0 -> your PHP version (5.5.12) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
Problem 2
- Installation request for jms/serializer-bundle dev-master -> satisfiable by jms/serializer-bundle[dev-master].
- jms/serializer-bundle dev-master requires php >=5.4.0 -> your PHP version (5.5.12) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
Notice that PHP version is 5.5.12
I think the problem is the version of this 2 libraries. If yes, What are the versions of FOSRestBundle & JMSSerializerBundle ?
dev-master should never be used as version bound when requiring a package as dependency, except in some specific cases.
Go to https://packagist.org/ then search for the packages you are looking for and use their respective current stable version as version bound for your composer.json's requirement.
Also, in your composer.json, you have a config key containing a platform.php key with 5.3.9 as value. Remove or override this block according to your real PHP version. See Symfony2, composer, your PHP version (5.6.18) overriden by "config.platform.php" version (5.3.9) does not satisfy requirement.
Of course, if the last stable version of one of them isn't compatible with your environment (PHP >= 5.5.9 for friendsofsymfony/rest-bundle), you need to look for an older version supporting your environment (all is available on packagist, and surely on the official documentation of these packages).

Resources