<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 23 May 2013 06:09:26 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jake Bell: PHP Annotations Are a Horrible Idea]]></title>
      <guid>http://www.phpdeveloper.org/news/18623</guid>
      <link>http://www.phpdeveloper.org/news/18623</link>
      <description><![CDATA[<p>
In his latest post <i>Jake Bell</i> talks about why he thinks <a href="http://theunraveler.com/blog/2012/php-annotations-are-a-horrible-idea/">annotations in PHP are a bad idea</a> (not the concept of them, but how developers are currently using them. He's in favor of <a href="https://wiki.php.net/rfc/annotations">officil support</a> though).
</p>
<blockquote>
Both the Symfony 2 and Doctrine 2 libraries and components make liberal use of what have come to be called annotations - special code comments, usually prefixed with an @ that are actually interpreted by the application and affect its functionality. [...] This trend needs to die.
</blockquote>
<p>
He points out that the use of code comments like this isn't a good practice and applications should never have to rely on them for functionality. He mentions issues with syntax/language functionality (can't use "php -l" on them, can't var_dump an annotation) and that it makes it more difficult to read and interpret the code. He includes an example from Ruby of an alternative and a possible solution in PHP involving a static "mapping" variable.
</p>]]></description>
      <pubDate>Thu, 18 Oct 2012 09:45:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Karsten Deubert's Blog: Zend_MVC, Controller Plugins and Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/17178</guid>
      <link>http://www.phpdeveloper.org/news/17178</link>
      <description><![CDATA[<p>
<i>Karsten Deubert</i> has a recent post to his blog looking at <a href="http://www.logaholic.de/2011/11/25/zend_mvc-controller-plugins-and-annotations/">annotations in Zend Framework applications</a> to enhance functionality already in the framework.
</p>
<blockquote>
Recently I had the idea to influence Controller Actions with annotations but discarded it with thoughts like "In PHP I will have to use reflection and some black magic to get this working which will have insane performance hits for my applications"... until I set everything up to see that it costs just 1-2ms in average per request without any form of caching.
</blockquote>
<p>
He includes a few bits of code to show a simple annotation example (setting a layout) and the controller plugin that performs the translation. In his case, it's hard-coded to look for the "@layout" annotation in the docblock comment, but it'd be relatively trivial to extend it to a more full-featured version.
</p>]]></description>
      <pubDate>Mon, 28 Nov 2011 12:02:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rafael Dohms' Blog: Filtering objects using annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/16710</guid>
      <link>http://www.phpdeveloper.org/news/16710</link>
      <description><![CDATA[<p>
<i>Rafael Dohms</i> has an interesting new post to his site today looking at a library he's developed (inspired by the Symfony Validation library) to help <a href="http://blog.rafaeldohms.com.br/2011/08/11/filtering-objects-using-annotations/">filtering values with rules defined in annotations</a>.
</p>
<blockquote>
PHP does not have native Annotations support, however many projects have been using doc blocks to add value and semantics to code, like PHPUnit, Doctrine and Symfony. The Doctrine did a really good job in making available a Annotation parser kit, which allows you to bring the power of annotations into you own project. This opens up a few possibilities.
</blockquote>
<p>
He shows the current use of the Validation library with a sample check of a $name variable for "not blank". <a href="https://github.com/rdohms/DMS">His tool, DMS,</a> extends this functionality and gives you access to both custom filtering methods and standard PHP functions to filter the resulting variable value. He includes an example showing two variables with filters StripTags, StripNewlines and Trim as well as the code to execute the filtering. You can get the library either ready to <a href="https://github.com/rdohms/DMS">integrate with Symfony/Doctrine</a> or as <a href="https://github.com/rdohms/DMS-Filter">a standalone tool</a>.
</p>]]></description>
      <pubDate>Fri, 12 Aug 2011 10:04:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Symfony Blog: Symfony2: Annotations gets better]]></title>
      <guid>http://www.phpdeveloper.org/news/16372</guid>
      <link>http://www.phpdeveloper.org/news/16372</link>
      <description><![CDATA[<p>
<i>Fabien Potencier</i> has posted another in his "getting better" series looking at the features that are included in the Symfony2 framework. In <a href="http://symfony.com/blog/symfony2-annotations-gets-better">this new post</a> he talks about the improvement annotation support.
</p>
<blockquote>
Later today, I will release Symfony2 beta2. But first, I wanted to talk about a big change that landed into master yesterday. As you might know, Symfony2 uses annotations for Doctrine mapping information and validation configuration. Of course, it is entirely optional, and the same can be done with XML, YAML, or even PHP. But using annotations is convenient and allows you to define everything in the same file.
</blockquote>
<p>
Two new bundles were added, SensioFrameworkExtraBundle and JMSSecurityExtraBundle, that let you use annotations in the controller for configuration. Examples of this new feature are included in the post giving the configuration settings a more "native" feel.
</p>]]></description>
      <pubDate>Mon, 23 May 2011 11:08:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Function decorators in PHP with PHPDoc and Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/15841</guid>
      <link>http://www.phpdeveloper.org/news/15841</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog looking at some of the recent work he's done with <a href="http://gonzalo123.wordpress.com/2011/02/01/function-decorators-in-php-with-phpdoc-and-annotations/">PHPDoc and annotations</a> to create "function decorators" in his code.
</p>
<blockquote>
The idea is to solve the same problem I had when I wrote the previous article. I want to protect the execution of certain functions in a class to only being executed if the user is logged on. [...] The solution with interfaces is clean and simple (no extra libraries need and no reflection need too). The problem is that I can use it only for all the functions of the class.
</blockquote>
<p>
He gives an example class with four different methods (one with annotations) and his annotation parsing class that runs the predispatch and postdispatch methods based on those annotations. He also shows another examples using an abstract class.
</p>]]></description>
      <pubDate>Tue, 01 Feb 2011 13:13:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Genius Blog: Advanced PHPUnit: Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/13071</guid>
      <link>http://www.phpdeveloper.org/news/13071</link>
      <description><![CDATA[<p>
On the Genius.com blog today there's <a href="http://eng.genius.com/blog/2009/08/18/phpunit-annotations/">a new post</a> from <i>Bill Hewett</i> looking at some of the advanced notations you can use in your unit testing (directives in comments starting with "@").
</p>
<blockquote>
PHPUnit, borrowing a handy feature from <A href="http://www.ibm.com/developerworks/java/library/j-junit4.html">Java's JUnit testing library</a> allows you to use certain directives beginning with "@" in comments of your test or application code to access test-related functionality. These directives, known as annotations, even expose features not otherwise accessible to PHPUnit users.
</blockquote>
<p>
He looks at a list of eight including <a href="http://eng.genius.com/blog/2009/08/18/phpunit-annotations/#assert">@assert</a>, <a href="http://eng.genius.com/blog/2009/08/18/phpunit-annotations/#dataProvider">@dataProvider</a> and <a href="http://eng.genius.com/blog/2009/08/18/phpunit-annotations/#test">@test</a> as well as some of the new ones <a href="http://eng.genius.com/blog/2009/08/18/phpunit-annotations/#newIn34">coming in PHPUnit 3.4</a>.
</p>]]></description>
      <pubDate>Wed, 19 Aug 2009 12:20:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImpact Blog: Using Annotations in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10652</guid>
      <link>http://www.phpdeveloper.org/news/10652</link>
      <description><![CDATA[<p>
On the PHP::Impact blog today there's a <a href="http://phpimpact.wordpress.com/2008/07/19/using-annotations-in-php/">new post</a> showing how to use annotations in your application's code that can be used by the <a href="http://code.google.com/p/addendum/">Addendum</a> library.
</p>
<blockquote>
Annotations provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate. In PHP, annotations can only be read reflectively at run time.
</blockquote>
<p>
They allow you to document, with meta-data, information about the classes, methods and variables inside the script. They show three of the annotation types - a marker, a single-value and a multi-value.
</p>]]></description>
      <pubDate>Tue, 22 Jul 2008 07:55:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Extended Reflection API for PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/6324</guid>
      <link>http://www.phpdeveloper.org/news/6324</link>
      <description><![CDATA[<p>
In his <a href="http://www.sebastian-bergmann.de/blog/archives/627-Extended-Reflection-API-for-PHP-5.html">latest post</a>, <i>Sebastian Bergmann</i> shares some information about <a href="http://instantsvc.toolslave.net/wiki/ExtendedReflectionAPI">an extension</a> for the Reflection API included in PHP 5.
</p>
<blockquote>
<p>
The <a href="http://instantsvc.toolslave.net/wiki/ExtendedReflectionAPI">Extended Reflection API</a> enhances <a href="http://www.php.net">PHP 5</a> by providing access to type information and <a href="http://en.wikipedia.org/wiki/Annotation">annotations</a> that are embedded as doc-comments into the sourcecode.
</p>
<p>
Processable additions to the source code enable a wide range of new applications in general, and <a href="http://en.wikipedia.org/wiki/Web_service">Web Services</a> and <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect-Oriented Programming</a> in particular.
</p>
</blockquote>
<p>
<a href="http://instantsvc.toolslave.net/wiki/ExtendedReflectionAPI">The wiki page</a> for the project shares the difference between the two, including graphics to help show how they tie in together. There's even some pseudo code to get you started with the different class types, a mapping out of the API.
</p>]]></description>
      <pubDate>Thu, 21 Sep 2006 07:15:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kristian Kohntopp's Blog: Annotations to "Five Common PHP database problems"]]></title>
      <guid>http://www.phpdeveloper.org/news/6010</guid>
      <link>http://www.phpdeveloper.org/news/6010</link>
      <description><![CDATA[<p>
Building on <a href="http://www.phpdeveloper.org/news/5933">this article</a> from the IBM developerWorks site talking about "Five Common Database Problems", <i>Kristian Kohntopp</i> adds in <a href="http://mysqldump.azundris.com/archives/57-Annotations-to-Five-Common-PHP-database-problems.html">some of his own comments</a> for the five common problems from his perspective.
</p>
<blockquote>
My experience in the field differs slightly from his observations, and so I thought a few annotations may be in order.
</blockquote>
<p>
Each of <a href="http://mysqldump.azundris.com/archives/57-Annotations-to-Five-Common-PHP-database-problems.html">the five in the list</a> have large explainations following them, with slightly different takes on what was said before on the subject and sometimes even a few agreements here and there.
</p>]]></description>
      <pubDate>Fri, 11 Aug 2006 07:49:33 -0500</pubDate>
    </item>
  </channel>
</rss>
