# classes/phing/types/PatternSet.php

## \PatternSet
jump to top

The patternset storage component. Carries all necessary data and methods for the patternset stuff.

This class handles the common description attribute and provides a default implementation for reference handling and checking for circular references that is appropriate for types that can not be nested inside elements of the same type (i.e. patternset but not path)

Extends from
  \DataType
author
  Andreas Aderhold, andi@binarycloud.com
package
  phing.types
version
  $Revision: 1097 $

### Properties

`$excludeList= 'array'`
Default value `array` Details

Type

`$excludesFileList= 'array'`
Default value `array` Details

Type

`$includeList= 'array'`
Default value `array` Details

Type

`$includesFileList= 'array'`
Default value `array` Details

Type

### Methods

`addPatternToList( array $list ) : \PatternSetNameEntry`
add a name entry to the given list
Parameters

Name | Type | Description
--- | --- | ---
$list | array | List onto which the nameentry should be added

Returns

Type | Description
--- | ---
\PatternSetNameEntry |

`append( $other, $p ) :`
Adds the patterns of the other instance to this set.
Parameters

Name | Type | Description
--- | --- | ---
$other |  |
$p |  |

`createExclude( ) : \PatternSetNameEntry`
Add a name entry on the exclude list
Returns

Type | Description
--- | ---
\PatternSetNameEntry |

Details

throws

`createExcludesFile( ) : \PatternSetNameEntry`
add a name entry on the exclude files list
Returns

Type | Description
--- | ---
\PatternSetNameEntry |

Details

throws

`createInclude( ) : \PatternSetNameEntry`
Add a name entry on the include list
Returns

Type | Description
--- | ---
\PatternSetNameEntry |

Details

throws

`createIncludesFile( ) : \PatternSetNameEntry`
Add a name entry on the include files list
Returns

Type | Description
--- | ---
\PatternSetNameEntry |

Details

throws

`getExcludePatterns( $p ) :`
Returns the filtered exclude patterns.
Parameters

Name | Type | Description
--- | --- | ---
$p |  |

`getIncludePatterns( $p ) :`
Returns the filtered include patterns.
Parameters

Name | Type | Description
--- | --- | ---
$p |  |

`getRef( $p ) :`
Performs the check for circular references and returns the referenced PatternSet.
Parameters

Name | Type | Description
--- | --- | ---
$p |  |

`hasPatterns( ) :`
helper for FileSet.
`makeArray( $list, $p ) :`
Convert a array of PatternSetNameEntry elements into an array of Strings.
Parameters

Name | Type | Description
--- | --- | ---
$list |  |
$p |  |

`readFiles( $p ) :`
Read includesfile or excludesfile if not already done so.
Parameters

Name | Type | Description
--- | --- | ---
$p |  |

`readPatterns( $patternfile, $patternlist, $p ) :`
Reads path matching patterns from a file and adds them to the includes or excludes list
Parameters

Name | Type | Description
--- | --- | ---
$patternfile |  |
$patternlist |  |
$p |  |

`setExcludes( string $excludes ) : void`
Sets the set of exclude patterns. Patterns may be separated by a comma or a space.
Parameters

Name | Type | Description
--- | --- | ---
$excludes | string | the string containing the exclude patterns

Details

throws

`setExcludesFile( \excludesFile $excludesFile ) :`
Sets the name of the file containing the excludes patterns.
Parameters

Name | Type | Description
--- | --- | ---
$excludesFile | \excludesFile | The file to fetch the exclude patterns from.

`setIncludes( string $includes ) : void`
Sets the set of include patterns. Patterns may be separated by a comma or a space.
Parameters

Name | Type | Description
--- | --- | ---
$includes | string | the string containing the include patterns

Details

throws

`setIncludesFile( \includesFile $includesFile ) :`
Sets the name of the file containing the includes patterns.
Parameters

Name | Type | Description
--- | --- | ---
$includesFile | \includesFile | The file to fetch the include patterns from.

`setRefid( $r ) :`
Makes this instance in effect a reference to another PatternSet instance.

You must not set another attribute or nest elements inside this element if you make it a reference.

Parameters

Name | Type | Description
--- | --- | ---
$r |  |

`toString( ) :`

## \PatternSetNameEntry
jump to top

"Internal" class for holding an include/exclude pattern.

package
  phing.types

### Properties

`string $ifCond= ''`

The if-condition property for this pattern to be applied.

Details

Type
  string

`string $name= ''`

The pattern.

Details

Type
  string

`string $unlessCond= ''`

The unless-condition property for this pattern to be applied.

Details

Type
  string

### Methods

`evalName( $project ) : string`
Evaluates the pattern.
Parameters

Name | Type | Description
--- | --- | ---
$project |  |

Returns

Type | Description
--- | ---
string |

`getName( ) : string`
Get the pattern text.
Returns

Type | Description
--- | ---
string |

`setIf( string $cond ) :`
Sets an if-condition property for this pattern to match.
Parameters

Name | Type | Description
--- | --- | ---
$cond | string |

`setName( string $name ) :`
Set the pattern text.
Parameters

Name | Type | Description
--- | --- | ---
$name | string | The pattern

`setPattern( string $pattern ) :`
An alias for the setName() method.
Parameters

Name | Type | Description
--- | --- | ---
$pattern | string |

Details

see
  \setName()

`setUnless( string $cond ) :`
Sets an unless-condition property for this pattern to match.
Parameters

Name | Type | Description
--- | --- | ---
$cond | string |

`toString( ) : string`
Gets a string representation of this pattern.
Returns

Type | Description
--- | ---
string |

`valid( \Project $project ) : boolean`
Checks whether pattern should be applied based on whether the if and unless properties are set in project.
Parameters

Name | Type | Description
--- | --- | ---
$project | \Project |

Returns

Type | Description
--- | ---
boolean |

Documentation was generated by DocBlox 0.13.1.