WatcherCallableFactory
in package
FinalYes
Tags
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
$command read-only
private
Command
$command
$exceptionHandler read-only
private
ExceptionHandler
$exceptionHandler
$i
The number of times to run the watcher. This is used only for testing.
private
int
$i
= 0
$viewFactory read-only
private
Factory
$viewFactory
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
ClosuregetMessageForEvent()
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