src/Phpro/SoapClient/Console/Command/GenerateTypesCommand.php
/**
     * Try to create a class for a type.
     * When a class exists: try to patch
     * If patching the old class does not work: ask for an overwrite
     * Create a class from an empty file
     *
     * @param TypeGenerator $generator
     * @param Type $type
     * @param SplFileInfo $fileInfo
     * @return bool
     */
Try to create a class for a type.
When a class exists: try to patch
If patching the old class does not work: ask for an overwrite
Create a class from an empty file

@param TypeGenerator $generator
@param Type $type
@param SplFileInfo $fileInfo
@return bool
Try to create a class for a type . When a class exists : try to patch If patching the old class does not work : ask for an overwrite Create a class from an empty file @param TypeGenerator $generator @param Type $type @param SplFileInfo $fileInfo @return bool
protected function handleType(TypeGenerator $generator, Type $type, SplFileInfo $fileInfo): bool
    {
        $this->filesystem->ensureDirectoryExists($fileInfo->getPath());
        if ($fileInfo->isFile()) {
            if ($this->handleExistingFile($generator, $type, $fileInfo)) {
                return true;
            }
            if (!$this->askForOverwrite()) {
                $this->output->writeln(sprintf('Skipping %s', $type->getName()));
                return false;
            }
        }
        try {
            $file = new FileGenerator();
            $this->generateType($file, $generator, $type, $fileInfo);
        } catch (\Exception $e) {
            $this->output->writeln('<fg=red>'.$e->getMessage().'</fg=red>');
            return false;
        }
        return true;
    }
protected function handleType ( TypeGenerator $ generator , Type $ type , SplFileInfo $ fileInfo ) : bool { $ this -> filesystem -> ensureDirectoryExists ( $ fileInfo -> getPath ( ) ) ; if ( $ fileInfo -> isFile ( ) ) { if ( $ this -> handleExistingFile ( $ generator , $ type , $ fileInfo ) ) { return true ; } if ( ! $ this -> askForOverwrite ( ) ) { $ this -> output -> writeln ( sprintf ( 'Skipping %s' , $ type -> getName ( ) ) ) ; return false ; } } try { $ file = new FileGenerator ( ) ; $ this -> generateType ( $ file , $ generator , $ type , $ fileInfo ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( '<fg=red>' . $ e -> getMessage ( ) . '</fg=red>' ) ; return false ; } return true ; }
Try to create a class for a type.
Try to create a class for a type .
// Generate type sub folders if needed // Handle existing class: // Ask if a class can be overwritten if it contains errors // Try to create a blanco class: