PHP Class Mmoreram\PHPFormatter\Sorter\UseSorter

Inheritance: implements Mmoreram\PHPFormatter\Sorter\Interfaces\SorterInterface
Mostrar archivo Open project: mmoreram/php-formatter Class Usage Examples

Protected Properties

Property Type Description
$groupSkipEmpty boolean Skip empty groups
$groupType integer Group type
$groups array Groups
$sortDirection integer Sort direction
$sortType integer Sort type

Public Methods

Method Description
setGroupSkipEmpty ( boolean $groupSkipEmpty ) : UseSorter Sets GroupSkipEmpty.
setGroupType ( integer $groupType ) : UseSorter Sets GroupType.
setGroups ( array $groups ) : UseSorter Sets Groups.
setSortDirection ( mixed $sortDirection ) : UseSorter Sets SortDirection.
setSortType ( mixed $sortType ) : UseSorter Sets SortType.
sort ( string $data ) : false | string Sort any piece of code given as parameter.

Private Methods

Method Description
createGroups ( array $namespaces ) : array Create blocks.
renderGroup ( array $group ) : string Render a group.
sortGroup ( array $group ) : array Sort a group.

Method Details

setGroupSkipEmpty() public method

Sets GroupSkipEmpty.
public setGroupSkipEmpty ( boolean $groupSkipEmpty ) : UseSorter
$groupSkipEmpty boolean
return UseSorter Self object

setGroupType() public method

Sets GroupType.
public setGroupType ( integer $groupType ) : UseSorter
$groupType integer GroupType
return UseSorter Self object

setGroups() public method

Sets Groups.
public setGroups ( array $groups ) : UseSorter
$groups array Groups
return UseSorter Self object

setSortDirection() public method

Sets SortDirection.
public setSortDirection ( mixed $sortDirection ) : UseSorter
$sortDirection mixed SortDirection
return UseSorter Self object

setSortType() public method

Sets SortType.
public setSortType ( mixed $sortType ) : UseSorter
$sortType mixed SortType
return UseSorter Self object

sort() public method

Sort any piece of code given as parameter.
public sort ( string $data ) : false | string
$data string Data
return false | string Data processed or false if no use block has been found

Property Details

$groupSkipEmpty protected_oe property

Skip empty groups
protected bool $groupSkipEmpty
return boolean

$groupType protected_oe property

Group type
protected int $groupType
return integer

$groups protected_oe property

Groups
protected array $groups
return array

$sortDirection protected_oe property

Sort direction
protected int $sortDirection
return integer

$sortType protected_oe property

Sort type
protected int $sortType
return integer