<?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>Wed, 22 May 2013 21:41:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: ZF2 Forms in Beta5]]></title>
      <guid>http://www.phpdeveloper.org/news/18198</guid>
      <link>http://www.phpdeveloper.org/news/18198</link>
      <description><![CDATA[<p>
In <a href="http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html">this new post</a> to his blog, <i>Matthew Weier O'Phinney</i> about some of the recent updates in the latest beta (beta5) of the Zend Framework 2's "Forms" component.
</p>
<blockquote>
Forms are a nightmare for web development. They break the concept of separation of concerns: they have a display aspect (the actual HTML form), they have a validation aspect and the two mix, as you need to display validation error messages. On top of that, the submitted data is often directly related to your domain models, causing more issues. [...] Add to this that the validation logic may be re-usable outside of a forms context, and you've got a rather complex problem.
</blockquote>
<p>
He talks about the newly-rewritten form component along with the new InputFilter to accompany it. He includes an example of using this new component - making a User form that, based off of some annotation rules, does some validation on the property values and things like "required" and custom types. He also talks about some of the other features included in the new package like hydration, complex annotation support and tools to work with collections.
</p>
<p>
You can download this latest beta release <a href="http://packages.zendframework.com/">from the packages.zendframework.com</a> site.
</p>]]></description>
      <pubDate>Mon, 09 Jul 2012 09:34:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: On Visibility in OOP]]></title>
      <guid>http://www.phpdeveloper.org/news/18156</guid>
      <link>http://www.phpdeveloper.org/news/18156</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has a new post to his blog today looking at <a href="http://mwop.net/blog/2012-06-28-oop-visibility.html">visibility in OOP in PHP</a> - less about the features the language offers and more about the theory of their use.
</p>
<blockquote>
I'm a big proponent of object oriented programming. OOP done right helps ease code maintenance and enables code re-use. Starting in PHP, OOP enthusiasts got a whole bunch of new tools, and new tools keep coming into the language for us with each minor release. One feature that has had a huge impact on frameworks and libraries has been available since the earliest PHP 5 versions: visibility.
</blockquote>
<p>
He covers a bit of the syntax and features of public, private and protected and mentions a keyword not often seen in PHP applications - <a href="http://us2.php.net/manual/en/language.oop5.final.php">final</a>. The reason all of this came up was work on annotation support in Zend Framework 2 and some difficulty in integrating it with Doctrine support. The "final" status of the class was part of the problem, and after a a lot of copy & pasting he decided on a different tactic - using its public API to try to work around the problem.
</p>
<blockquote>
In sum: because the class in question was marked final and had private members, I found myself forced to think critically about what I wanted to accomplish, and then thoroughly understand the public API to see how I might accomplish that task without the ability to extend.
</blockquote>]]></description>
      <pubDate>Fri, 29 Jun 2012 09:52:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Purcell's Blog: PHPUnit - How to Run PHPUnit Against a Specific Test]]></title>
      <guid>http://www.phpdeveloper.org/news/17476</guid>
      <link>http://www.phpdeveloper.org/news/17476</link>
      <description><![CDATA[<p>
<i>Mike Purcell</i> has a quick new post to his blog showing how you can <a href="http://melikedev.com/2012/01/30/phpunit-how-to-run-phpunit-against-a-specific-test/">run PHPUnit on one specific test</a> using handy grouping functionality already built into the tool.
</p>
<blockquote>
The other day I was debugging an error in one of my unit tests, and found it hard to track down because when I ran PHPUnit, it ran all the tests contained in the file where my problem unit test was located. After some Googling and reading the PHPUnit Api Docs, I found that you can specify a test, among other tests, by adding a comment with the @group annotation.
</blockquote>
<p>
Using this "@group" annotation tells PHPUnit to combine these tests and allows you you specify a "--group" setting on the command line to only run those. He includes some sample code showing how it can be used. This can be very useful for combining results for certain kinds of tests (say, all related to bugfixes) without having to run everything all over again.
</p>]]></description>
      <pubDate>Wed, 01 Feb 2012 08:37:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrew Eddie's Blog: Making the most out of Code Assist in Eclipse/PDT and Zend Studio for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17198</guid>
      <link>http://www.phpdeveloper.org/news/17198</link>
      <description><![CDATA[<p>
<i>Andrew Eddie</i> has posted a helpful tutorial for Eclipse users out there showing how to <a href="http://www.theartofjoomla.com/home/9-developer/136-making-the-most-out-of-code-assist-in-eclipsepdt-and-zend-studio-for-php.html">get the most our of code assist</a> in Eclipse PDT/Zend Studio.
</p>
<blockquote>
One of the powerful features of an IDE like Eclipse is the ability for it to "read" your code and give you some assistance about your API as you type. This could include things like class property or methods names, constants, functions, argument lists, and so on. Eclipse/PDT and ZendStudio do this by parsing a PHP class directly, but they also look at your docblocks and some other special comments where the raw PHP is not enough. This article is a bag of tricks that help you get the most out of code assistance using Eclipse/PDT or Zend Studio in those awkward corners of your code that you might have through previously inaccessible.
</blockquote>
<p>
Among his tips are things like adding "@var" declarations to help with code completion, type hinting on methods/functions, using the "@property" annotation and using a "this" trick to override what class the IDE sees as the local object.
,/p>]]></description>
      <pubDate>Thu, 01 Dec 2011 12:55:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Volker Dusch's Blog: An introduction to PHPUnits @covers annotation]]></title>
      <guid>http://www.phpdeveloper.org/news/17085</guid>
      <link>http://www.phpdeveloper.org/news/17085</link>
      <description><![CDATA[<p>
<a href="http://phpunit.de">PHPUnit</a> is one of the most widely used unit testing tools for PHP applications. It comes packed with features, some that are commonly used and some not so much. In <a href="http://edorian.posterous.com/an-introduction-to-phpunits-covers-annotation">a new post to his blog</a> today <i>Volker Dusch</i> looks at one specific feature - the "@covers" annotation you can use in your tests' comments to specify which functionality you're actually testing.
</p>
<blockquote>
One of the goals of your test suite and the coverage report is to make you trust in your code base and to remove the fear of changing something that needs to be changed. [...] You shouldn't think "Well yes that a 100% but a lot of that just comes from that big integration test and I don't know if the class is really tested!". [...] Thankfully PHPUnit offers a way to drastically increase your confidence in what you actually have tested.
</blockquote>
<p>
Using the "@covers" annotation on your test method docblocks gives you one more level of confidence in what's being tested and can help make for clearer updating down the road. He also mentions using them to provide extra insight into protected methods in your code and where the test coverage for them really lies.
</p>]]></description>
      <pubDate>Fri, 04 Nov 2011 09:55:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint.com: Advanced PHPUnit Testing: Annotations and Mocking]]></title>
      <guid>http://www.phpdeveloper.org/news/15920</guid>
      <link>http://www.phpdeveloper.org/news/15920</link>
      <description><![CDATA[<p>
On SitePoint.com today there's a new article in their unit testing series posted today - a look at <a href="http://blogs.sitepoint.com/2011/02/17/advanced-phpunit-testing-annotations-and-mocking/">annotations and mocking</a> in advanced unit testing with <a href="http://phpunit.de">PHPUnit</a>. (Disclaimer: I am the author of this article series.)
</p>
<blockquote>
PHPUnit has lots of advanced features that can be amazingly helpful when that special case comes around. This includes extending the framework itself, making test suites, building static datasets, and the focus of this article: annotations and mocking. Don't worry if you're unsure what either of these are; I'm here to help. I trust by the end that you'll see how these two features can be useful to both you and your tests.
</blockquote>
<p>
The article starts with annotations showing how they can be used both on the class side to help with test generation and on the test side to help in evaluation (like expectedException). In the mocking section, it shows you how create simple and complex mock objects to replace a sample database query.
</p>]]></description>
      <pubDate>Thu, 17 Feb 2011 09:33:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: On annotations and logic]]></title>
      <guid>http://www.phpdeveloper.org/news/15826</guid>
      <link>http://www.phpdeveloper.org/news/15826</link>
      <description><![CDATA[<p>
On the Stubbles blog there's <a href="http://www.stubbles.org/archives/91-On-annotations-and-logic.html">a recent post</a> that talks about a feature they introduced into the framework - annotations - with high hopes it would give them more flexibility in how things worked. As <i>Frank Keline</i> says, though, "it's not such a good idea at all".
</p>
<blockquote>
The most simplest reason for this is the idea that annotations are markup. They mark (or, to keep the notion, annotate) code as being special or to be treated in some special kind of way, depending on the scenario where the code is used in. [...] From a design point of view this makes it clear why annotations should not contain logic. If annotations contain parts of such logic, it becomes splitted and possibly cluttered throughout different classes.
</blockquote>
<p>
He goes on to talk about a second reason why he doesn't think they should be considered first-class in an application - it doesn't promote code reuse. For example, if you define them on a method, there's no way to use that method without them. He puts this into the perspective of the <a href="http://stubbles.net/">Stubbles</a> framework that currently uses them and how he's changed the logic to live in special classes instead. He considers other changes like places annotations can be used and having different annotation classes.</p>]]></description>
      <pubDate>Fri, 28 Jan 2011 12:29:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Change Garcia's Blog: expected exceptions annotations, mocked object calls, oh my.]]></title>
      <guid>http://www.phpdeveloper.org/news/15646</guid>
      <link>http://www.phpdeveloper.org/news/15646</link>
      <description><![CDATA[<p>
<i>Chance Gracia</i> came across an interesting feature/bug when writing up unit tests for his application with <a href="http://phpunit.de">PHPUnit</a>. He was throwing an exception from a mock object and based on his annotation <a href="http://phpprotip.com/2010/12/expected-exceptions-annotations-mocked-object-calls-oh-my/">the exception is caught no matter the type</a>.
</p>
<blockquote>
Anyone who has worked with PHPUnit has most likely worked with expected exceptions and mock objects. The nice thing about working with expected exceptions is that we have access to a handy @expectedException annotation. I've gotten into the habit of using this for exceptions my fixtures should throw but also for when I'm using a mock object to verify a method call. 
</blockquote>
<p>
Some sample code is included to show his problem - a mock object is created for the "foo" class and a test to see if an Exception type is thrown is included on it. The problem is that the exception thrown isn't of type Exception, but of type "foo_exception" and the @expectedException annotation tells it to look for the Exception type. Because of this unpredictable behavior, he suggests not using annotations for these sort of tests or it could lead to false positives. 
</p>]]></description>
      <pubDate>Tue, 28 Dec 2010 11:42:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: Lately in PHP Ep. 6 - Unusual Site Speedup Techniques, Named params & Annotations]]></title>
      <guid>http://www.phpdeveloper.org/news/15359</guid>
      <link>http://www.phpdeveloper.org/news/15359</link>
      <description><![CDATA[<p>
On the PHPClasses.org site today they've posted the <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">latest episode</a> in their "Lately in PHP" podcast series - "Unusual Site Speedup Techniques debate, Named parameters and Annotations".
</p>
<blockquote>
In this episode, Manuel Lemos and Ernani Joppert discuss several unusual site speedup techniques presented in recent articles of the PHPClasses site blog. They also discuss the (non-)inclusion of new PHP features discussed by PHP core developers like having named parameters in function calls and the support of Java-like annotations in PHP code.
</blockquote>
<p>
To listen you can either use the <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">in-page player</a>, grab it <a href="http://itunes.apple.com/podcast/lately-in-php-podcast/id373016482">from iTunes</a> or just download <a href="http://www.phpclasses.org/blog/post/134/file/27/name/Lately-In-PHP-6.mp3">the mp3</a>. Complete show notes and transcript are also included in <a href="http://www.phpclasses.org/blog/post/134-Unusual-Site-Speedup-Techniques-debate-Named-parameters-and-Annotations--Lately-in-PHP-podcast-episode-6.html">the post</a>.
</p>]]></description>
      <pubDate>Mon, 01 Nov 2010 08:29:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: State of annotations in the PHP world]]></title>
      <guid>http://www.phpdeveloper.org/news/11380</guid>
      <link>http://www.phpdeveloper.org/news/11380</link>
      <description><![CDATA[<p>
In <A href="http://www.stubbles.org/archives/54-State-of-annotations-in-the-PHP-world.html">this new post</a> to the Stubbles blog <i>Frank Kleine</i> looks at the current state of annotations in the PHP language and applications.
</p>
<blockquote>
Annotations are a really helpful feature in present-day development. An annotation is a special form of syntactic metadata that can be added to source code elements such as classes, methods, properties and parameters. They do not affect the program semantic directly, but can be used by tools and libraries to handle such annotated code in a certain way.
</blockquote>
<p>
He notes that, as of right now, PHP doesn't naively support anything like this but that there are additional libraries that can be used to augment the standard PHP performance and use them (like a feature in <a href="http://www.phpunit.de">PHPUnit</a> with @assert and @test). He also go through several of the other libraries that make it possible including <a href="http://www.stubbles.org/exit.php?url_id=358&entry_id=54">Addendum</a>, <a href="http://www.stubbles.org/exit.php?url_id=363&entry_id=54">FLOW3</a> and the <a href="http://www.stubbles.org/exit.php?url_id=368&entry_id=54">XP-Framework</a>.
</p>]]></description>
      <pubDate>Mon, 10 Nov 2008 13:32:59 -0600</pubDate>
    </item>
  </channel>
</rss>
