Documentation

WatcherCallableFactory
in package

FinalYes
Tags
phpstan-type

WatchEventType Watch::EVENT_TYPE_FILE_CREATED|Watch::EVENT_TYPE_FILE_DELETED|Watch::EVENT_TYPE_FILE_UPDATED

Table of Contents

Constants

WATCHER_CALLABLE_TYPE_ON_ANY_CHANGE  = 'onAnyChange'
The watcher callable type for handling any change event.
WATCHER_CALLABLE_TYPE_SHOULD_CONTINUE  = 'shouldContinue'
The watcher callable type for checking if the watcher should continue.

Properties

$command  : Command
$exceptionHandler  : ExceptionHandler
$i  : int
The number of times to run the watcher. This is used only for testing.
$viewFactory  : Factory

Methods

__construct()  : mixed
Create a new instance.
fromType()  : Closure
Create a watcher callable from the type.
getMessageForEvent()  : string
Get the message for the event.
onAnyChangeCallable()  : void
Handle any change event.
shouldContinueCallable()  : bool
Check if the watcher should continue.

Constants

WATCHER_CALLABLE_TYPE_ON_ANY_CHANGE

The watcher callable type for handling any change event.

public string WATCHER_CALLABLE_TYPE_ON_ANY_CHANGE = 'onAnyChange'

WATCHER_CALLABLE_TYPE_SHOULD_CONTINUE

The watcher callable type for checking if the watcher should continue.

public string WATCHER_CALLABLE_TYPE_SHOULD_CONTINUE = 'shouldContinue'

Properties

Methods

__construct()

Create a new instance.

public __construct(ExceptionHandler $exceptionHandler, Command $command, Factory $viewFactory) : mixed
Parameters
$exceptionHandler : ExceptionHandler

The exception handler

$command : Command

The command

$viewFactory : Factory

The view factory

fromType()

Create a watcher callable from the type.

public fromType(self::WATCHER_CALLABLE_TYPE_* $type) : Closure
Parameters
$type : self::WATCHER_CALLABLE_TYPE_*

The watcher callable type

Return values
Closure

getMessageForEvent()

Get the message for the event.

private getMessageForEvent(WatchEventType $type, string $path) : string
Parameters
$type : WatchEventType

The event type

$path : string

The file path

Return values
string

The message

onAnyChangeCallable()

Handle any change event.

private onAnyChangeCallable(Watch::EVENT_TYPE_* $type, string $path) : void
Parameters
$type : Watch::EVENT_TYPE_*

The event type

$path : string

The file path

shouldContinueCallable()

Check if the watcher should continue.

private shouldContinueCallable() : bool
Return values
bool

        
On this page

Search results