= UML class diagrams
:description: Architecture of main components
include::revision.txt[]
include::attributes.txt[]


.Main System
[scaledwidth="100%"]
["plantuml", "images/PHPCompatInfo_01.png"]
---------------------------------------------------------------------
skinparam classAttributeIconSize 0

interface SplSubject {
    {abstract} void +attach ( SplObserver $observer )
    {abstract} void +detach ( SplObserver $observer )
    {abstract} void +notify ( void )
}

interface IteratorAggregate {
    {abstract} Traversable +getIterator ( void )
}

interface Countable {
    {abstract} int +count ( void )
}

abstract class PHP_CompatInfo_Filter {
    static string #filterVersion
    static string #filterOperator

    static void #applyFilter( array &$results, string $category = null)
}

class PHP_CompatInfo {
    array #warnings
    array #options
    array #excludes
    array #includes
    array #versions
    array #extensions
    array #namespaces
    array #traits
    array #interfaces
    array #classes
    array #functions
    array #constants
    array #globals
    array #tokens
    array #results

    SplObjectStorage -_observers
    array -_observersId
    array -_namespaces
    array -_versionsRef
    object -_event

    object +__construct ( array $options = null )

    void +attach ( SplObserver $observer )
    void +detach ( SplObserver $observer )
    void +notify ( void )

    Traversable +getIterator ( void )

    int +count ( void )

    array +getOptions ( void )
    array static +getDefaultOptions( void )

    object +getEvent ( void )

    bool +hasWarnings ( void )
    array +getWarnings ( bool $purge = false )
    void +addWarning ( string $warn )

    array +getFilelist ( mixed $dataSource, bool $recursive, array $excludesPattern )
    bool +parse ( mixed $dataSource )
    array +toArray ( string $source = null )
    array +__call ( string $name, array $args )
    array +getConditions ( string $category = null, string $source = null )
    array +getVersions ( void )

    void #scan ( string $source )
    string #searchNamespace ( string $typeHint )
    void #loadReference ( string $name, array $options = null )
    mixed #searchReference ( string $category, string $name )
    bool #isValid ( string $category, string $key )
    void #updateVersion ( string $current, string &$base )
    void #getInfo ( string $category, string $defaultVersion, array $haystack, string $source, string $ns )
    void #fireStartScanSource ( mxied $source )
    void #fireEndScanSource ( void )
    void #fireStartScanFile ( string $file, int $currentIndex, int $maxIndex )
    void #fireEndScanFile ( string $file, int $currentIndex, int $maxIndex )
    void #fireStartLoadReference ( string $reference, array $extensions )
    void #fireEndLoadReference ( string $reference, int $successful, int $failures )
    void #fireFailLoadReference ( string $warn )
    void #firePushWarning ( string $warn )

    void -excludeCodeConditions( string $key, array $data, string $source, string $ns)
}

class PHP_CompatInfo_Reference_PHP5 {
}

class PHP_Reflect {
}

SplSubject <|.. PHP_CompatInfo
IteratorAggregate <|.. PHP_CompatInfo
Countable <|.. PHP_CompatInfo
PHP_CompatInfo_Filter <|-- PHP_CompatInfo

PHP_Reflect - PHP_CompatInfo : < use parser engine
PHP_CompatInfo_Reference_ALL - PHP_CompatInfo : < load
---------------------------------------------------------------------

.Reference Plugins System
[scaledwidth="100%"]
["plantuml", "images/PHPCompatInfo_02.png"]
---------------------------------------------------------------------
interface PHP_CompatInfo_Reference {
    array +getAll ( string $extension = null, string $version = null, string $condition = null )
    array +getExtensions ( string $extension = null, string $version = null, string $condition = null )
    array +getInterfaces ( string $extension = null, string $version = null, string $condition = null )
    array +getClasses ( string $extension = null, string $version = null, string $condition = null )
    array +getFunctions ( string $extension = null, string $version = null, string $condition = null )
    array +getConstants ( string $extension = null, string $version = null, string $condition = null )
}

abstract class PHP_CompatInfo_Reference_PluginsAbstract {
    const LATEST_PHP_5_2
    const LATEST_PHP_5_3
    const LATEST_PHP_5_4
    const LATEST_PHP_5_5

    array #warnings
    array #filter

    bool  +hasWarnings ( void )
    array +getWarnings ( void )
    array #combineExtension ( string $ext, array $arr )
    void  #setFilter( array $args )
    void  #applyFilter( string $release, array $items, arry &$elements )
    void  #setMaxExtensionVersion( string $version, string $name, array &$elements )
    void  #setExcludeVersions( mixed $versions, string $name, array &$elements )
    object +loadReference( string $element, bool $prefetch = false )

    array +getAll ( string $extension = null, string $version = null, string $condition = null )
    array +getExtensions ( string $extension = null, string $version = null, string $condition = null )
    array +getInterfaces ( string $extension = null, string $version = null, string $condition = null )
    array +getClasses ( string $extension = null, string $version = null, string $condition = null )
    array +getFunctions ( string $extension = null, string $version = null, string $condition = null )
    array +getConstants ( string $extension = null, string $version = null, string $condition = null )
}

class PHP_CompatInfo_Reference_PHP5 {
    array #extensionReferences

    object +__construct ( array $extensions = null )

    array +getAll ( string $extension = null, string $version = '4', string $condition = null )
    array +getExtensions ( string $extension = null, string $version = '4', string $condition = null )
    array +getInterfaces ( string $extension = null, string $version = '4', string $condition = null )
    array +getClasses ( string $extension = null, string $version = '4', string $condition = null )
    array +getFunctions ( string $extension = null, string $version = '4', string $condition = null )
    array +getConstants ( string $extension = null, string $version = '4', string $condition = null )

    array +getGlobals ( string $extension = null, string $version = '4', string $condition = null )
    array +getTokens ( string $extension = null, string $version = '4', string $condition = null )
}

class PHP_CompatInfo_Reference_ALL {
    object +__construct( array $extensions = null )
    array static +getDatabaseExtensions()
}

class PHP_CompatInfo_Reference_DYN {
    object +__construct( array $extensions = array(), array $rules = array() )
    object +loadReference( string $element, bool $prefetch = false )

    bool #match ( string $name, string &$extension )
}

PHP_CompatInfo_Reference <|.. PHP_CompatInfo_Reference_PluginsAbstract

PHP_CompatInfo_Reference_PluginsAbstract <|-- PHP_CompatInfo_Reference_PHP5
PHP_CompatInfo_Reference_PHP5 <|-- PHP_CompatInfo_Reference_ALL
PHP_CompatInfo_Reference_PHP5 <|-- PHP_CompatInfo_Reference_DYN
---------------------------------------------------------------------

.Cache System
[scaledwidth="100%"]
["plantuml", "images/PHPCompatInfo_03.png"]
---------------------------------------------------------------------
class PHP_CompatInfo

interface PHP_CompatInfo_Cache_Interface {
    bool +isCached ( string $source)
    array +getCache ( string $source)
    void +setCache ( string $source, array $data )
    int +deleteCache ( string $source = null )
}

class PHP_CompatInfo_Cache_File {
    object +__construct ( )
    void +__destruct ( )

    bool +isCached ( string $source)
    array +getCache ( string $source)
    void +setCache ( string $source, array $data )
    int +deleteCache ( string $source = null )
}

class PHP_CompatInfo_Cache_Null {
    bool +isCached ( string $source)
    array +getCache ( string $source)
    void +setCache ( string $source, array $data )
    int +deleteCache ( string $source = null )
}

PHP_CompatInfo_Cache_Interface <|.. PHP_CompatInfo_Cache_File
PHP_CompatInfo_Cache_Interface <|.. PHP_CompatInfo_Cache_Null

PHP_CompatInfo_Cache_File - PHP_CompatInfo : < use
PHP_CompatInfo_Cache_Null - PHP_CompatInfo : < use
---------------------------------------------------------------------
