createAliasStmt($originalName, $stmt);'; $replace = '/* @var FullyQualified $originalName */ $aliasStmt = $this->createAliasStmt($originalName, $stmt); $stmts[] = new If_( new FuncCall( new FullyQualified(\'class_exists\'), [ new Node\Arg( new Node\Expr\ClassConstFetch( $originalName, \'class\' ) ), new Node\Arg( new Node\Expr\ConstFetch( new Node\Name(\'false\') ) ) ] ), [\'stmts\' => [$aliasStmt]] );'; $contents = file_get_contents($vendor_path); $contents = str_replace($search, $replace, $contents); file_put_contents($vendor_path, $contents);