Login   Register  
PHP Classes
elePHPant
Icontem

Generic Array

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author  
Picture of Martin Alterisio
Name: Martin Alterisio <e-mail contact>
Packages: 5 Browse all classes by Martin Alterisio Browse all classes by
Country: Argentina Argentina - PHP jobs in Argentina
Age: 30
All time rank: 6929 in Argentina Argentina
Week rank: 417 Up5 in Argentina Argentina Up
Innovation award
Innovation award
Nominee: 5x


  Detailed description   Download .zip .tar.gz  
This class can be used to create arrays that allow members of just one type.

It implements a class loader that gives a special treatment to the creation of objects of classes with the names that start with ArrayOf.

The class assumes that it is intended to create an object of a generic class that manages an array of objects of a class named after the ArrayOf prefix.

It generates code for a new generic array handling class based on a generic class template. The generated class uses type hinting to allow only array members of the intended array element class.

This class can be used with the Type Hint class to allow other types of members besides objects and arrays.

  Classes of Martin Alterisio  >  Generic Array  >  Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Generic Array
Base name: genericarray
Description: Create arrays that allow members of just one type
Version: 1.0.0
PHP version: 5.1
License: GNU Lesser General Public License (LGPL)
All time users: 583 users
All time rank: 4509
Week users: 1 user
Week rank: 2151 Up
 
  Groups   Rate classes User ratings   Dependencies   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Data types Modeling and manipulating data types View top rated classes
Group folder image Code Generation Compilers and tools that generate code automatically View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
November 2007
Number 9
In PHP arrays may have element values of mixed types. If an application needs to store values of only one specific type, PHP does not stop eventual bugs from storing values of the wrong types in the values.

This class implements an array interface that checks the types of values before adding them to the array, thus making it possible to early detect eventual application bugs.

Manuel Lemos

  User ratings  
Ratings
Utility
Consistency
Documentation
Examples
Tests
Videos
Overall
Rank
All time:
Sufficient (75.0%)
Good (91.7%)
Sufficient (66.7%)
Good (91.7%)
-
-
Sufficient (62.5%)
657
Month:
Not yet rated by the users

  Packages needed by this class  
Class Dependency Why it is needed
Type Hint Class
Recommended
Nice addition to create arrays of native types (eg: ArrayOfInt)

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Files folder imagecache (1 file)
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file ArrayOfGenericLoader.php Class Array generic class loader
Accessible without login Plain text file ArrayOfGenericX.php Class Array generic template
Accessible without login Plain text file genericarray.lib.php Aux. Library loader script.

  Files  /  Files folder image cache  
File Role Description
  Accessible without login Plain text file MAKE_THIS_DIR_WRITABLE Doc. Make the cache dir writable or face the wrath of uppercase filenames

Download all files: genericarray.tar.gz genericarray.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.