src/Phpro/SoapClient/Console/Command/GenerateTypesCommand.php
/**
     * This method tries to patch an existing type class.
     *
     * @param TypeGenerator $generator
     * @param Type $type
     * @param SplFileInfo $fileInfo
     * @return bool
     */
This method tries to patch an existing type class.
@param TypeGenerator $generator
@param Type $type
@param SplFileInfo $fileInfo
@return bool
This method tries to patch an existing type class . @param TypeGenerator $generator @param Type $type @param SplFileInfo $fileInfo @return bool
protected function patchExistingFile(TypeGenerator $generator, Type $type, SplFileInfo $fileInfo): bool
    {
        try {
            $this->filesystem->createBackup($fileInfo->getPathname());
            $file = FileGenerator::fromReflectedFileName($fileInfo->getPathname());
            $this->generateType($file, $generator, $type, $fileInfo);
        } catch (\Exception $e) {
            $this->output->writeln('<fg=red>'.$e->getMessage().'</fg=red>');
            $this->filesystem->removeBackup($fileInfo->getPathname());
            return false;
        }
        return true;
    }
protected function patchExistingFile ( TypeGenerator $ generator , Type $ type , SplFileInfo $ fileInfo ) : bool { try { $ this -> filesystem -> createBackup ( $ fileInfo -> getPathname ( ) ) ; $ file = FileGenerator :: fromReflectedFileName ( $ fileInfo -> getPathname ( ) ) ; $ this -> generateType ( $ file , $ generator , $ type , $ fileInfo ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( '<fg=red>' . $ e -> getMessage ( ) . '</fg=red>' ) ; $ this -> filesystem -> removeBackup ( $ fileInfo -> getPathname ( ) ) ; return false ; } return true ; }
This method tries to patch an existing type class.
This method tries to patch an existing type class .