{"id":614,"date":"2022-08-12T22:05:19","date_gmt":"2022-08-12T20:05:19","guid":{"rendered":"https:\/\/numa-bord.com\/miniblog\/?p=614"},"modified":"2022-08-12T22:45:08","modified_gmt":"2022-08-12T20:45:08","slug":"symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final","status":"publish","type":"post","link":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/","title":{"rendered":"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \u00ab\u00a0The \u00ab\u00a0Symfony\\Component\\Console\\Command\\Command::$defaultName\u00a0\u00bb property is considered final&#8230;"},"content":{"rendered":"<p>Depuis Symfony 6.1, si vous avez des commandes sous la forme suivante :<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">class<\/span> MaCommandeCustomCommand <span class=\"kw2\">extends<\/span> Command <span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"kw2\">protected<\/span> static <span class=\"re0\">$defaultName<\/span> <span class=\"sy0\">=<\/span> <span class=\"st_h\">'app:ma-commande-custom'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sy0\">...<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Vous allez remarquer les d\u00e9pr\u00e9ciations suivantes :<br \/>\n&#8211; The \u00ab\u00a0Symfony\\Component\\Console\\Command\\Command::$defaultName\u00a0\u00bb property is considered final. You should not override it in \u00ab\u00a0&#8230;\u00a0\u00bb.<br \/>\n&#8211; Since symfony\/console 6.1: Relying on the static property \u00ab\u00a0$defaultName\u00a0\u00bb for setting a command name is deprecated. Add the \u00ab\u00a0Symfony\\Component\\Console\\Attribute\\AsCommand\u00a0\u00bb attribute to the \u00ab\u00a0&#8230;\u00a0\u00bb class instead.<\/p>\n<p>Il suffit de passer sous le format suivant pour corriger ces erreurs :<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">use<\/span> Symfony\\Component\\Console\\Attribute\\AsCommand<span class=\"sy0\">;<\/span><br \/>\n<span class=\"sy0\">...<\/span><br \/>\n<br \/>\n<span class=\"co2\">#[AsCommand(<br \/>\n<\/span> &nbsp; &nbsp;name<span class=\"sy0\">:<\/span> <span class=\"st_h\">'app:ma-commande-custom'<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"kw2\">class<\/span> MaCommandeCustomCommand <span class=\"kw2\">extends<\/span> Command <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sy0\">...<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Depuis Symfony 6.1, si vous avez des commandes sous la forme suivante : class MaCommandeCustomCommand extends Command &#123; &nbsp; &nbsp; protected static $defaultName = &lsquo;app:ma-commande-custom&rsquo;; &nbsp; &nbsp; &#8230; &#125; Vous allez remarquer les d\u00e9pr\u00e9ciations suivantes : &#8211; The \u00ab\u00a0Symfony\\Component\\Console\\Command\\Command::$defaultName\u00a0\u00bb property is considered final. You should not override it in \u00ab\u00a0&#8230;\u00a0\u00bb. &#8211; Since symfony\/console 6.1: Relying [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-614","post","type-post","status-publish","format-standard","hentry","category-developpement","category-symfony"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation &quot;The &quot;Symfony\\Component\\Console\\Command\\Command::$defaultName&quot; property is considered final... - Pense b\u00eate d&#039;un d\u00e9veloppeur web<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation &quot;The &quot;Symfony\\Component\\Console\\Command\\Command::$defaultName&quot; property is considered final... - Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"og:description\" content=\"Depuis Symfony 6.1, si vous avez des commandes sous la forme suivante : class MaCommandeCustomCommand extends Command &#123; &nbsp; &nbsp; protected static $defaultName = &#039;app:ma-commande-custom&#039;; &nbsp; &nbsp; ... &#125; Vous allez remarquer les d\u00e9pr\u00e9ciations suivantes : &#8211; The \u00ab\u00a0SymfonyComponentConsoleCommandCommand::$defaultName\u00a0\u00bb property is considered final. You should not override it in \u00ab\u00a0&#8230;\u00a0\u00bb. &#8211; Since symfony\/console 6.1: Relying [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\" \/>\n<meta property=\"og:site_name\" content=\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-12T20:05:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-12T20:45:08+00:00\" \/>\n<meta name=\"author\" content=\"Numa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Numa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\"},\"author\":{\"name\":\"Numa\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"headline\":\"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \u00ab\u00a0The \u00ab\u00a0Symfony\\\\Component\\\\Console\\\\Command\\\\Command::$defaultName\u00a0\u00bb property is considered final&#8230;\",\"datePublished\":\"2022-08-12T20:05:19+00:00\",\"dateModified\":\"2022-08-12T20:45:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\"},\"wordCount\":126,\"commentCount\":0,\"articleSection\":[\"D\u00e9veloppement\",\"Symfony\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\",\"name\":\"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \\\"The \\\"Symfony\\\\Component\\\\Console\\\\Command\\\\Command::$defaultName\\\" property is considered final... - Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\"},\"datePublished\":\"2022-08-12T20:05:19+00:00\",\"dateModified\":\"2022-08-12T20:45:08+00:00\",\"author\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"breadcrumb\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/numa-bord.com\/miniblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \u00ab\u00a0The \u00ab\u00a0Symfony\\\\Component\\\\Console\\\\Command\\\\Command::$defaultName\u00a0\u00bb property is considered final&#8230;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/\",\"name\":\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"description\":\"(php, javascript, Symfony, Wordpress....)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\",\"name\":\"Numa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"caption\":\"Numa\"},\"url\":\"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \"The \"Symfony\\Component\\Console\\Command\\Command::$defaultName\" property is considered final... - Pense b\u00eate d&#039;un d\u00e9veloppeur web","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/","og_locale":"fr_FR","og_type":"article","og_title":"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \"The \"Symfony\\Component\\Console\\Command\\Command::$defaultName\" property is considered final... - Pense b\u00eate d&#039;un d\u00e9veloppeur web","og_description":"Depuis Symfony 6.1, si vous avez des commandes sous la forme suivante : class MaCommandeCustomCommand extends Command &#123; &nbsp; &nbsp; protected static $defaultName = 'app:ma-commande-custom'; &nbsp; &nbsp; ... &#125; Vous allez remarquer les d\u00e9pr\u00e9ciations suivantes : &#8211; The \u00ab\u00a0SymfonyComponentConsoleCommandCommand::$defaultName\u00a0\u00bb property is considered final. You should not override it in \u00ab\u00a0&#8230;\u00a0\u00bb. &#8211; Since symfony\/console 6.1: Relying [&hellip;]","og_url":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/","og_site_name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","article_published_time":"2022-08-12T20:05:19+00:00","article_modified_time":"2022-08-12T20:45:08+00:00","author":"Numa","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Numa","Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#article","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/"},"author":{"name":"Numa","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"headline":"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \u00ab\u00a0The \u00ab\u00a0Symfony\\Component\\Console\\Command\\Command::$defaultName\u00a0\u00bb property is considered final&#8230;","datePublished":"2022-08-12T20:05:19+00:00","dateModified":"2022-08-12T20:45:08+00:00","mainEntityOfPage":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/"},"wordCount":126,"commentCount":0,"articleSection":["D\u00e9veloppement","Symfony"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/","url":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/","name":"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \"The \"Symfony\\Component\\Console\\Command\\Command::$defaultName\" property is considered final... - Pense b\u00eate d&#039;un d\u00e9veloppeur web","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/#website"},"datePublished":"2022-08-12T20:05:19+00:00","dateModified":"2022-08-12T20:45:08+00:00","author":{"@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"breadcrumb":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-6-1-corriger-la-depreciation-the-symfonycomponentconsolecommandcommanddefaultname-property-is-considered-final\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/numa-bord.com\/miniblog\/"},{"@type":"ListItem","position":2,"name":"Symfony 6.1 : Corriger la d\u00e9pr\u00e9ciation \u00ab\u00a0The \u00ab\u00a0Symfony\\Component\\Console\\Command\\Command::$defaultName\u00a0\u00bb property is considered final&#8230;"}]},{"@type":"WebSite","@id":"https:\/\/numa-bord.com\/miniblog\/#website","url":"https:\/\/numa-bord.com\/miniblog\/","name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","description":"(php, javascript, Symfony, Wordpress....)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Person","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e","name":"Numa","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","caption":"Numa"},"url":"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/"}]}},"_links":{"self":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/comments?post=614"}],"version-history":[{"count":3,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/614\/revisions"}],"predecessor-version":[{"id":617,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/614\/revisions\/617"}],"wp:attachment":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/media?parent=614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/categories?post=614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/tags?post=614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}