# types/selectors/ContainsSelector.php

Selector that filters files based on whether they contain a particular string.

Author
  Hans Lellelid (Phing)
Author
  Bruce Atherton (Ant)
Package
  phing.types.selectors

## \ContainsSelector
jump to top

Package: phing\types\selectors

Selector that filters files based on whether they contain a particular string.

Parent(s)
  \BaseExtendSelector < \BaseSelector < \DataType < \ProjectComponent
Author
  Hans Lellelid (Phing)
Author
  Bruce Atherton (Ant)

### Constants

`CONTAINS_KEY = "text"`

`CASE_KEY = "casesensitive"`

### Properties

`$casesensitive= 'true'`
Default value `true` Details

Type
  n/a

`$contains= 'null'`
Default value `null` Details

Type
  n/a

### Methods

`circularReference( ) : void`

`dieOnCircularReference( ) : void`

`getCheckedRef( ) : void`

`getDescription( ) : void`

`getError( ) : void`

`getParameters( ) : void`

`getProject( ) : void`

`isReference( ) : void`

`isSelected( \basedir $basedir, \filename $filename, \file $file ) : \whether`

The heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset.

Parameters

Name | Type | Description
--- | --- | ---
$basedir | \basedir | the base directory the scan is being done from
$filename | \filename | is the name of the file to check
$file | \file | a PhingFile object the selector can use

Returns

Type | Description
--- | ---
\whether | the file should be selected or not

`log( ) : void`

`noChildrenAllowed( ) : void`

`parsingComplete( ) : void`

`setCasesensitive( boolean $casesensitive ) : void`

Whether to ignore case in the string being searched.

Parameters

Name | Type | Description
--- | --- | ---
$casesensitive | boolean | whether to pay attention to case sensitivity

`setDescription( ) : void`

`setError( ) : void`

`setParameters( array $parameters ) : void`

When using this as a custom selector, this method will be called.

It translates each parameter into the appropriate setXXX() call.

Parameters

Name | Type | Description
--- | --- | ---
$parameters | array | the complete set of parameters for this selector

`setProject( ) : void`

`setRefid( ) : void`

`setText( string $contains ) : void`

The string to search for within a file.

Parameters

Name | Type | Description
--- | --- | ---
$contains | string | the string that a file must contain to be selected.

`toString( ) : void`

`tooManyAttributes( ) : void`

`validate( ) : void`

`verifySettings( ) : void`

Checks to make sure all settings are kosher. In this case, it means that the pattern attribute has been set.

Documentation was generated by DocBlox 0.17.1.