News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stuart Herbert's Blog:
ContractLib - An Introduction & Comparing it to PHP's Assert
January 17, 2012 @ 10:58:38

Stuart Herbert has two new posts to his blog showing how to use the ContractLib tool he's created to define programming "contracts". In the first he shows some sample usage of the tool and in the second he compares the functionality of ContractLib's features and PHP's own "assert" method.

ContractLib is a simple-to-use PHP component for easily enforcing programming contracts throughout your PHP components. These programming contracts can go a long way to helping you, and the users of your components, develop more robust code.

In his example tests he shows how to set a pre-condition on a method's input ensuring that it will always be the correct datatype (array). In his comparison with PHP's "assert", he lists out some of the features that either one has and notes that ContractLib allows you to be much more flexible with your checking than just simple statements.

0 comments voice your opinion now!
contractlib contract programming validate assert compare


blog comments powered by Disqus

Similar Posts

Jani Hartikainen's Blog: Doctrine vs. Propel: 2009 update

Chris Roane's Blog: PHP Programming: The Benefits of Peer Pressure

Tiobe.com: PHP Ranks Fifth in Popularity Contest in August

Hyperpolyglot.org: Syntax for Common Tasks - Side-by-side (Ruby, Perl, Python & PHP)

Job Posting: Moontoast Seeks Senior PHP Developer (Nashville, TN)


Community Events

Don't see your event here?
Let us know!


interview community laravel language extension version unittest series symfony security library voicesoftheelephpant laravel5 framework threedevsandamaybe release api podcast introduction opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework