classes/phing/types/selectors/TypeSelector.php

Selector that selects a certain kind of file: directory or regular file.

author
Hans Lellelid (Phing)
author
Jeff Turner (Ant)
package
phing.types.selectors
version
$Revision: 526 $

\TypeSelector

Selector that selects a certain kind of file: directory or regular file.

It provides support for gathering the parameters together as well as for assigning an error message and throwing a build exception if an error is detected.

Extends from
\BaseExtendSelector
author
Hans Lellelid (Phing)
author
Jeff Turner (Ant)
package
phing.types.selectors
version
$Revision: 526 $

Constants

Constant  TYPE_KEY = 'type'

Key to used for parameterized custom selector

Properties

Propertyprivate  $type= ''
Details
Type
Propertyprivate  $types= 'array'
static

Valid types

Default valuearrayDetails
Type

Methods

methodpublic  isSelected( \PhingFile $basedir, string $filename, \PhingFile $file ) : boolean
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 \PhingFile the base directory the scan is being done from
$filename string is the name of the file to check
$file \PhingFile is a PhingFile object the selector can use
Returns
Type Description
boolean
methodpublic  setParameters( array $parameters ) :
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
methodpublic  setType( string $type ) :
Set the type of file to require.
Parameters
Name Type Description
$type string

The type of file - 'file' or 'dir'

methodpublic  toString( ) : string
Returns
Type Description
string
methodpublic  verifySettings( ) :
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.13.1.