PHP Класс Cake\Upgrade\Shell\Task\AppUsesTask

Updates App::uses() calls.
Наследование: extends BaseTask, use trait ChangeTrait
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$implicitMap array A map of old => new for use statements that are missing
$rename mixed A list of classes which have had the Cake prefix removed
$tasks

Защищенные методы

Метод Описание
_addImplicitUses ( string $contents ) : string Add implicit uses
_mapClassName ( array $matches ) : array Convert old classnames to new ones.
_orderUses ( string $contents ) : string Order use statements
_process ( $path ) : void Convert App::uses() to normal use statements.
_removeDynamicAppUses ( string $contents ) : string _removeDynamicAppUses
_replaceAppUses ( string $contents ) : string Replace App::uses with use ;
_replaceReferences ( string $contents ) : string Replace references to old classes
_shouldProcess ( string $path ) : boolean _shouldProcess

Описание методов

_addImplicitUses() защищенный метод

Account for: + parent classes and interfaces are frequently just assumed to exist in useland code + also in function arguments + static class calls for basic Cake classes
protected _addImplicitUses ( string $contents ) : string
$contents string
Результат string

_mapClassName() защищенный метод

Strips the Cake prefix off of classes that no longer have it.
protected _mapClassName ( array $matches ) : array
$matches array
Результат array

_orderUses() защищенный метод

For code standards, use statements should be alphabetical but in addition, this Moves all use statements to the top of the class
protected _orderUses ( string $contents ) : string
$contents string
Результат string

_process() защищенный метод

Order App::uses statements and replace the class in the source if it appears
protected _process ( $path ) : void
Результат void

_removeDynamicAppUses() защищенный метод

_removeDynamicAppUses
protected _removeDynamicAppUses ( string $contents ) : string
$contents string
Результат string

_replaceAppUses() защищенный метод

Replace App::uses with use ;
protected _replaceAppUses ( string $contents ) : string
$contents string
Результат string

_replaceReferences() защищенный метод

Replace references to old classes
protected _replaceReferences ( string $contents ) : string
$contents string
Результат string

_shouldProcess() защищенный метод

If App::uses is nowhere - bail, otherwise use the default (php files only)
protected _shouldProcess ( string $path ) : boolean
$path string
Результат boolean

Описание свойств

$implicitMap публичное свойство

A map of old => new for use statements that are missing
public array $implicitMap
Результат array

$rename публичное свойство

A list of classes which have had the Cake prefix removed
public mixed $rename
Результат mixed

$tasks публичное свойство

public $tasks