deprecation-warning

How can I fix a deprecated user in Symfony 4?

给你一囗甜甜゛ 提交于 2019-12-08 09:38:40
问题 I get the following error message: User Deprecated: Passing configuration options directly to the constructor is deprecated since Symfony 4.2, use the default context instead. This is the code Symfony is giving as trace for the problem: $serializer = new Serializer(array(new DateTimeNormalizer('d.m.Y'), new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); But I do not understand how to use a default context 回答1: You have to use directly the service. class DefaultController

Replace deprecated sdk/widget, without using toolbar from Australis

允我心安 提交于 2019-12-08 03:40:11
问题 Since some time sdk/widget is deprecated and according to https://blog.mozilla.org/addons/2014/03/13/new-add-on-sdk-australis-ui-features-in-firefox-29/ sdk/ui/ should be used instead. Unfortunately sdk/ui/frame places itself on sdk/ui/toolbar and it may be not moved to main menu. Toolbar is unacceptable for me, but sdk/widget support will be dropped in future - so I need some solution. For reference - sdk/widget frame (with purple, fully filled progress bars) and a sdk/ui abomination with

Preg replace deprecated, attempting to fix

偶尔善良 提交于 2019-12-07 18:31:26
I've just upgraded to PHP 7 and have been hammering out errors associated with deprecated functions, with much success. Sadly, I've been having trouble fixing the new preg replace methodology for my "view php array in a interactive collapsable javascript thing" code. The following code: function print_r_tree($data) { // capture the output of $this->print_r_tree $out = print_r($data, true); // replace something like '[element] => <newline> (' with <a href="javascript:toggleDisplay('...');">...</a><div id="..." style="display: none;"> $out = preg_replace('/([ \t]*)(\[[^\]]+\][ \t]*\=\>[ \t]*[a

Scala Postfix operator warning contradicts with Scaladoc

落爺英雄遲暮 提交于 2019-12-06 12:29:17
问题 My code: val exitStatus = url #> outfile ! scala.sys.process: new URL("http://www.scala-lang.org/") #> new File("scala-lang.html") ! Warning: postfix operator ! should be enabled [warn] by making the implicit value scala.language.postfixOps visible. [warn] This can be achieved by adding the import clause 'import scala.language.postfixOps' [warn] or by setting the compiler option -language:postfixOps. [warn] See the Scaladoc for value scala.language.postfixOps for a discussion [warn] why the

How to replace find by readonly on newer Rails?

你。 提交于 2019-12-06 07:49:55
问题 I had this legacy code in my project: Model.find(id, :readonly => false) Apparently, it searched by id and only the objects that were not readonly. But readonly is not an attribute of the Model, this should be checking the actual ActiveRecord property that defines whether that instance is a read only instance or not. I don't know if that is what this code actually does, maybe that :readonly => false is useless there. But I get the expected warning: DEPRECATION WARNING: Passing options to

Scala Postfix operator warning contradicts with Scaladoc

蓝咒 提交于 2019-12-04 21:51:38
My code: val exitStatus = url #> outfile ! scala.sys.process : new URL("http://www.scala-lang.org/") #> new File("scala-lang.html") ! Warning: postfix operator ! should be enabled [warn] by making the implicit value scala.language.postfixOps visible. [warn] This can be achieved by adding the import clause 'import scala.language.postfixOps' [warn] or by setting the compiler option -language:postfixOps. [warn] See the Scaladoc for value scala.language.postfixOps for a discussion [warn] why the feature should be explicitly enabled. [warn] val exitStatus = url #> outfile ! [warn] ^ [warn] one

How to replace find by readonly on newer Rails?

空扰寡人 提交于 2019-12-04 14:53:30
I had this legacy code in my project: Model.find(id, :readonly => false) Apparently, it searched by id and only the objects that were not readonly. But readonly is not an attribute of the Model, this should be checking the actual ActiveRecord property that defines whether that instance is a read only instance or not. I don't know if that is what this code actually does, maybe that :readonly => false is useless there. But I get the expected warning: DEPRECATION WARNING: Passing options to #find is deprecated. Please build a scope and then call #find on it. And I can't replace it with a where,

Swift 3 warning for dispatch async

早过忘川 提交于 2019-12-03 10:34:17
问题 I have this code: DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async { let url = URL(string: itemImageURL ) let data = try? Data(contentsOf: url!) if data != nil { DispatchQueue.main.async{ cell.advImage!.image = UIImage(data: data!) } } } I get this warning in Swift 3: 'default' was deprecated in iOS 8.0: Use qos attributes instead on the first line. Haven't found yet a solution. Has anybody? 回答1: try qos: DispatchQoS.QoSClass.default instead of priority:

How to suppress specific Lint warning for deprecated Android function?

自古美人都是妖i 提交于 2019-12-03 05:22:30
I use a version switch to support older Android versions. int sdk = Build.VERSION.SDK_INT; if (sdk < Build.VERSION_CODES.HONEYCOMB) { ColorDrawable colorDrawable = new ColorDrawable(shapeColor); //noinspection deprecation viewHolder.shape.setBackgroundDrawable(colorDrawable); } else { viewHolder.shape.setColor(shapeColor); } When build the project with Gradle from the command line the following warning is output by Lint: app/src/main/java/com/example/MyApp/CustomListAdapter.java:92: warning: [deprecation] setBackgroundDrawable(Drawable) in View has been deprecated viewHolder.shape

Swift 3 warning for dispatch async

帅比萌擦擦* 提交于 2019-12-03 02:06:56
I have this code: DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async { let url = URL(string: itemImageURL ) let data = try? Data(contentsOf: url!) if data != nil { DispatchQueue.main.async{ cell.advImage!.image = UIImage(data: data!) } } } I get this warning in Swift 3: 'default' was deprecated in iOS 8.0: Use qos attributes instead on the first line. Haven't found yet a solution. Has anybody? try qos: DispatchQoS.QoSClass.default instead of priority: DispatchQueue.GlobalQueuePriority.default DispatchQueue.global(qos: DispatchQoS.QoSClass.default).async { let url =