private function executeFileExecutor(string $sourcePath, string $targetPath, string $filePath): void
    {
        try {
            $name       = pathinfo($filePath)['filename'] . 'Test';
            $targetPath = str_replace($sourcePath, $targetPath, $filePath);
            $targetPath = preg_replace('/(.php|.phtml)/', 'Test.php', $targetPath);
            // Execute file executor
            $this->fileExecutor->invoke($filePath, $targetPath, $name);
        } catch (Exception $exception) {
            $this->exceptionCatcher->catch($exception, $filePath);
        }
    }
private function executeFileExecutor(string $sourcePath, string $targetPath, string $filePath): void
    {
        try {
            $name       = pathinfo($filePath)['filename'] . 'Test';
            $targetPath = str_replace($sourcePath, $targetPath, $filePath);
            $targetPath = preg_replace('/(.php|.phtml)/', 'Test.php', $targetPath);
            // Execute file executor
            $this->fileExecutor->invoke($filePath, $targetPath, $name);
        } catch (Exception $exception) {
            $this->exceptionCatcher->catch($exception, $filePath);
        }
    }
private function executeFileExecutor ( string $ sourcePath , string $ targetPath , string $ filePath ) : void { try { $ name = pathinfo ( $ filePath ) [ 'filename' ] . 'Test' ; $ targetPath = str_replace ( $ sourcePath , $ targetPath , $ filePath ) ; $ targetPath = preg_replace ( '/(.php|.phtml)/' , 'Test.php' , $ targetPath ) ; // Execute file executor $ this -> fileExecutor -> invoke ( $ filePath , $ targetPath , $ name ) ; } catch ( Exception $ exception ) { $ this -> exceptionCatcher -> catch ( $ exception , $ filePath ) ; } }
Execute the file executor for a file in a directory.

@param string $sourcePath The directory source path.
@param string $targetPath The directory target path.
@param string $filePath   The file path.

@throws Exception If there was an error during the process.
Execute the file executor for a file in a directory .