Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning and end of a string
<?php trim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php         $name = str_replace('/', '\\', $name);



        return $this->qualifyClass(

            trim($rootNamespace, '\\') . '\\' . $name

        );

    }
<?php         $contents = str_replace('{{ factoryNamespace }}', $factoryNamespace, $contents);

        $contents = str_replace('{{ namespacedModel }}', $modelClass, $contents);

        $contents = str_replace('{{ model }}', class_basename($modelClass), $contents);

        $contents = str_replace('            //', trim($definition, PHP_EOL), $contents);



        File::put($path, $contents);

    }