["string", null, "package de base"], "path" => ["string", null, "répertoire source"], "classes" => ["array", null, "liste de classes à mettre à jour"], "allow_undefined" => ["bool", false, "autoriser les constantes non définies dans la classe?"], ]]; const MAPPINGS = []; function main() { $updater = new SrcUpdater(); $md = new Metadata(self::MAPPINGS_SCHEMA); $mappings = static::MAPPINGS; $md->ensureSchema($mappings); foreach ($mappings as $title => $mapping) { msg::section($title); [ "package" => $package, "path" => $path, "classes" => $classes, "allow_undefined" => $allowUndefined, ] = $mapping; $updater->setAllowUndefined($allowUndefined); foreach ($classes as $class) { msg::info($class); $file = $class; $file = str::without_prefix($package, $file); $file = str_replace("\\", "/", $file); $file = "$path/$file.php"; $updater->update($file); } } } }