{"id":739,"date":"2023-11-17T15:49:42","date_gmt":"2023-11-17T14:49:42","guid":{"rendered":"https:\/\/numa-bord.com\/miniblog\/?p=739"},"modified":"2023-11-17T15:49:42","modified_gmt":"2023-11-17T14:49:42","slug":"symfony-se-debarrasser-de-sensio-framework-extra-bundle","status":"publish","type":"post","link":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/","title":{"rendered":"Symfony : Se d\u00e9barrasser de \u00ab\u00a0sensio\/framework-extra-bundle\u00a0\u00bb"},"content":{"rendered":"<p>Note rapide <\/p>\n<p>remplacer les<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">use<\/span> Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\IsGranted<span class=\"sy0\">;<\/span><\/div><\/div>\n<p>par<\/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\\Security\\Http\\Attribute\\IsGranted<span class=\"sy0\">;<\/span><\/div><\/div>\n<p>et l&rsquo;utilisation<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"sy0\">*<\/span> <span class=\"sy0\">@<\/span>IsGranted<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;editProject&quot;<\/span><span class=\"sy0\">,<\/span> subject<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;entity&quot;<\/span><span class=\"br0\">&#41;<\/span><\/div><\/div>\n<p>par<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"co2\">#[IsGranted('editProject', 'entity')]<\/span><\/div><\/div>\n<hr>\n<p>remplacer les<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">use<\/span> Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Entity<span class=\"sy0\">;<\/span><\/div><\/div>\n<p>par<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">use<\/span> Symfony\\Bridge\\Doctrine\\Attribute\\MapEntity<span class=\"sy0\">;<\/span><\/div><\/div>\n<p>et l&rsquo;utilisation<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"co4\">\/**<br \/>\n* @Entity(&quot;project&quot;, expr=&quot;repository.findDetails(id)&quot;)<br \/>\n*\/<\/span><br \/>\n<span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> emptyElements<span class=\"br0\">&#40;<\/span>Project <span class=\"re0\">$entity<\/span><span class=\"br0\">&#41;<\/span><\/div><\/div>\n<p>par<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> emptyElements<span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co2\">#[MapEntity(disabled: true, expr: 'repository.findDetails(id)')] <br \/>\n<\/span> &nbsp; &nbsp; &nbsp; &nbsp;Project <span class=\"re0\">$entity<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><\/div><\/div>\n<hr>\n<p>pour les paramConverter, ce cas peut etre supprim\u00e9 directement<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"sy0\">*<\/span> <span class=\"sy0\">@<\/span>ParamConverter<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;day&quot;<\/span><span class=\"sy0\">,<\/span> options<span class=\"sy0\">=<\/span><span class=\"br0\">&#123;<\/span><span class=\"st0\">&quot;format&quot;<\/span><span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Y-m-d&quot;<\/span><span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><\/div><\/div>\n<hr>\n<p>Une fois tous les \u00e9lements de ce type supprim\u00e9\/remplacer on peux supprimer le sensio\/framework-extra-bundle du fichier composer.json et mettre \u00e0 jour<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note rapide remplacer les use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\IsGranted; par use Symfony\\Component\\Security\\Http\\Attribute\\IsGranted; et l&rsquo;utilisation * @IsGranted&#40;&quot;editProject&quot;, subject=&quot;entity&quot;&#41; par #[IsGranted(&lsquo;editProject&rsquo;, &lsquo;entity&rsquo;)] remplacer les use Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Entity; par use Symfony\\Bridge\\Doctrine\\Attribute\\MapEntity; et l&rsquo;utilisation \/** * @Entity(&quot;project&quot;, expr=&quot;repository.findDetails(id)&quot;) *\/ public function emptyElements&#40;Project $entity&#41; par public function emptyElements&#40; &nbsp; &nbsp; &nbsp; &nbsp; #[MapEntity(disabled: true, expr: &lsquo;repository.findDetails(id)&rsquo;)] &nbsp; &nbsp; &nbsp; &nbsp;Project $entity &nbsp; &nbsp; &nbsp; [&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,7,3],"tags":[],"class_list":["post-739","post","type-post","status-publish","format-standard","hentry","category-developpement","category-php","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 : Se d\u00e9barrasser de &quot;sensio\/framework-extra-bundle&quot; - 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-se-debarrasser-de-sensio-framework-extra-bundle\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Symfony : Se d\u00e9barrasser de &quot;sensio\/framework-extra-bundle&quot; - Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"og:description\" content=\"Note rapide remplacer les use SensioBundleFrameworkExtraBundleConfigurationIsGranted; par use SymfonyComponentSecurityHttpAttributeIsGranted; et l&rsquo;utilisation * @IsGranted&#040;&quot;editProject&quot;, subject=&quot;entity&quot;&#041; par #[IsGranted(&#039;editProject&#039;, &#039;entity&#039;)] remplacer les use SensioBundleFrameworkExtraBundleConfigurationEntity; par use SymfonyBridgeDoctrineAttributeMapEntity; et l&rsquo;utilisation \/** * @Entity(&quot;project&quot;, expr=&quot;repository.findDetails(id)&quot;) *\/ public function emptyElements&#040;Project $entity&#041; par public function emptyElements&#040; &nbsp; &nbsp; &nbsp; &nbsp; #[MapEntity(disabled: true, expr: &#039;repository.findDetails(id)&#039;)] &nbsp; &nbsp; &nbsp; &nbsp;Project $entity &nbsp; &nbsp; &nbsp; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/\" \/>\n<meta property=\"og:site_name\" content=\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-17T14:49:42+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-se-debarrasser-de-sensio-framework-extra-bundle\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/\"},\"author\":{\"name\":\"Numa\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"headline\":\"Symfony : Se d\u00e9barrasser de \u00ab\u00a0sensio\/framework-extra-bundle\u00a0\u00bb\",\"datePublished\":\"2023-11-17T14:49:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/\"},\"wordCount\":151,\"commentCount\":0,\"articleSection\":[\"D\u00e9veloppement\",\"PHP\",\"Symfony\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/\",\"name\":\"Symfony : Se d\u00e9barrasser de \\\"sensio\/framework-extra-bundle\\\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\"},\"datePublished\":\"2023-11-17T14:49:42+00:00\",\"author\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"breadcrumb\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/numa-bord.com\/miniblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Symfony : Se d\u00e9barrasser de \u00ab\u00a0sensio\/framework-extra-bundle\u00a0\u00bb\"}]},{\"@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 : Se d\u00e9barrasser de \"sensio\/framework-extra-bundle\" - 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-se-debarrasser-de-sensio-framework-extra-bundle\/","og_locale":"fr_FR","og_type":"article","og_title":"Symfony : Se d\u00e9barrasser de \"sensio\/framework-extra-bundle\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web","og_description":"Note rapide remplacer les use SensioBundleFrameworkExtraBundleConfigurationIsGranted; par use SymfonyComponentSecurityHttpAttributeIsGranted; et l&rsquo;utilisation * @IsGranted&#40;&quot;editProject&quot;, subject=&quot;entity&quot;&#41; par #[IsGranted('editProject', 'entity')] remplacer les use SensioBundleFrameworkExtraBundleConfigurationEntity; par use SymfonyBridgeDoctrineAttributeMapEntity; et l&rsquo;utilisation \/** * @Entity(&quot;project&quot;, expr=&quot;repository.findDetails(id)&quot;) *\/ public function emptyElements&#40;Project $entity&#41; par public function emptyElements&#40; &nbsp; &nbsp; &nbsp; &nbsp; #[MapEntity(disabled: true, expr: 'repository.findDetails(id)')] &nbsp; &nbsp; &nbsp; &nbsp;Project $entity &nbsp; &nbsp; &nbsp; [&hellip;]","og_url":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/","og_site_name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","article_published_time":"2023-11-17T14:49:42+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-se-debarrasser-de-sensio-framework-extra-bundle\/#article","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/"},"author":{"name":"Numa","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"headline":"Symfony : Se d\u00e9barrasser de \u00ab\u00a0sensio\/framework-extra-bundle\u00a0\u00bb","datePublished":"2023-11-17T14:49:42+00:00","mainEntityOfPage":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/"},"wordCount":151,"commentCount":0,"articleSection":["D\u00e9veloppement","PHP","Symfony"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/","url":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/","name":"Symfony : Se d\u00e9barrasser de \"sensio\/framework-extra-bundle\" - Pense b\u00eate d&#039;un d\u00e9veloppeur web","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/#website"},"datePublished":"2023-11-17T14:49:42+00:00","author":{"@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"breadcrumb":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-se-debarrasser-de-sensio-framework-extra-bundle\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/numa-bord.com\/miniblog\/"},{"@type":"ListItem","position":2,"name":"Symfony : Se d\u00e9barrasser de \u00ab\u00a0sensio\/framework-extra-bundle\u00a0\u00bb"}]},{"@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\/739","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=739"}],"version-history":[{"count":7,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/739\/revisions"}],"predecessor-version":[{"id":747,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/739\/revisions\/747"}],"wp:attachment":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/media?parent=739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/categories?post=739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/tags?post=739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}