#!/usr/bin/php 0) { $template = file_get_contents('src/templates/static_method.template'); $newOptions = ''; foreach ($methods as $method) { $updated = str_replace('METHOD_NAME_UPPERCASE', strtoupper($method), $template); $updated = str_replace('METHOD_NAME', $method, $updated); $newOptions .= $updated; } $contents = file_get_contents($file); $contents = preg_replace( '/\/\/\bSTATIC_METHODS_DEFINITION_START\b.*?\/\/\bSTATIC_METHODS_DEFINITION_END\b/s', "//STATIC_METHODS_DEFINITION_START\n" . $newOptions . "\t\t//STATIC_METHODS_DEFINITION_END", $contents ); file_put_contents($file, $contents); } } exit(0); ?>