svn: /pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/ Dependencies/Package.php Dependencies.php

[email protected] (Brett Bieber)
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
saltybeagle                              Thu, 17 Jun 2010 14:48:28 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=300523

Log:
Implement the countable interface for counting dependencies.

Changed paths:
    U   pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies/Package.php
    U   pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies.php

Modified: pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies/Package.php
===================================================================
--- pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies/Package.php	2010-06-17 14:23:02 UTC (rev 300522)
+++ pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies/Package.php	2010-06-17 14:48:28 UTC (rev 300523)
@@ -3,7 +3,7 @@
  * This class is used for package, subpackage, and extension deps
  */
 namespace PEAR2\Pyrus\PackageFile\v2\Dependencies;
-class Package implements \ArrayAccess, \Iterator
+class Package implements \ArrayAccess, \Iterator, \Countable
 {
     protected $info;
     protected $index = null;
@@ -595,4 +595,9 @@

         return $ret . ')';
     }
+
+    function count()
+    {
+        return count($this->info);
+    }
 }
\ No newline at end of file

Modified: pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies.php
===================================================================
--- pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies.php	2010-06-17 14:23:02 UTC (rev 300522)
+++ pear2/Pyrus/trunk/src/Pyrus/PackageFile/v2/Dependencies.php	2010-06-17 14:48:28 UTC (rev 300523)
@@ -87,7 +87,7 @@
  * @link      http://svn.php.net/viewvc/pear2/Pyrus/
  */
 namespace PEAR2\Pyrus\PackageFile\v2;
-class Dependencies implements \ArrayAccess
+class Dependencies implements \ArrayAccess, \Countable
 {
     protected $parent;
     protected $info = array();
@@ -358,4 +358,9 @@

         $this->parent->rawdependencies = $this->info;
     }
+
+    function count()
+    {
+        return count($this->info);
+    }
 }
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.