{"id":2638,"date":"2017-01-18T19:11:06","date_gmt":"2017-01-18T17:11:06","guid":{"rendered":"http:\/\/nyamsprod.com\/blog\/?p=2638"},"modified":"2017-01-18T22:44:00","modified_gmt":"2017-01-18T20:44:00","slug":"how-many-psr-7-implementations-exist-no-really","status":"publish","type":"post","link":"https:\/\/nyamsprod.com\/blog\/how-many-psr-7-implementations-exist-no-really\/","title":{"rendered":"How Many PSR-7 Implementations Exist? No really"},"content":{"rendered":"<div class=\"message warning\">\n<p><strong>Attention:<\/strong> Les informations de ce billet sont susceptibles d'&ecirc;tre obsol&egrave;tes car vieux de plus 2 ans.<\/p>\n<p><strong>Warning: <\/strong> The information you are reading may be obsolete, this post was published more than 2 years ago.<\/p>\n<\/div><p><a href=\"http:\/\/paul-m-jones.com\/archives\/6510\">Paul M Jones<\/a> wrote a blog post around <a href=\"http:\/\/www.php-fig.org\/psr\/psr-7\/\">PSR-7<\/a> implementations and even though his response was zero I was intrigued by <a href=\"https:\/\/packagist.org\/providers\/psr\/http-message-implementation\">packagist results<\/a>. Since I am maintaining an implementation of<a href=\"http:\/\/uri.thephpleague.com\/5.0\/uri\/schemes\/http\/\"> PSR-7 <code>UriInterface<\/code><\/a>, I was curious to see despite his opinion how many different implementations really exists and their <em>quality<\/em>.<!--more--><\/p>\n<p>So looking a the numbers of implementations, I thought it would take me hours to go through the list but I was wrong. The packages found can be quickly divided in 4 categories:<\/p>\n<ul>\n<li>The first category represents <strong>cheating developers. <\/strong>The package maintainer just copy\/paste a famous implementations (usually <em>Diactoros<\/em>) and just changed the namespace or aliased it and claimed that it is a complete implementation. Without going into copyright or infringement I&#8217;m baffled at how someone could do that, publish it and claim it as his\/her work or think that he\/she could benefit from it.<\/li>\n<li>The second category represents <strong>cheating packages<\/strong> that advertise themselves as implementing PSR-7 while in reality they just don&#8217;t. When you look at the code source you will found\u00a0 no traces whatsoever of PSR-7 except that they claim to provide such feature. Again another strange technique to promote, someone package.<\/li>\n<li>In the third category you&#8217;ll find packages which are really badly written. They do require the PHP-FIG interfaces and implement them. But the code quality is so bad anyone downloading or using them are really doing themselves a bad service.<\/li>\n<li>Last but not least their are the good, quality tested package like <em>Slim<\/em>, <em>Diactoros<\/em> or <em>Guzzle<\/em> and packages that just require them to work. This does not mean that those packages do not contain bugs or shortcoming but by reading the code and looking at the test suite you directly spot the code quality.<\/li>\n<\/ul>\n<h3>TL;DR<\/h3>\n<p>The sheer number of PSR-7 implementations is a false promise. Don&#8217;t believe a book by its cover. Whatever a library or a package advertises, first look at its code and try to measure the package quality before using it. Using <em>Composer<\/em> and being on <em>Packagist<\/em> is so common nowadays that it should <strong>never<\/strong> be taken as a quality measure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finding a good PSR-7 implementation on Packagist, is not as easy as it seems<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[588,5],"tags":[759,811,800,810],"class_list":["post-2638","post","type-post","status-publish","format-standard","hentry","category-humeurs","category-web","tag-composer","tag-packagist","tag-psr-7","tag-psr7"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/comments?post=2638"}],"version-history":[{"count":5,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2638\/revisions"}],"predecessor-version":[{"id":2647,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/posts\/2638\/revisions\/2647"}],"wp:attachment":[{"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/media?parent=2638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/categories?post=2638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nyamsprod.com\/blog\/wp-json\/wp\/v2\/tags?post=2638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}