From 700af0f2acaa52ce524e9c5f7d6a0fb39eb56a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Sun, 27 Oct 2024 10:21:59 +0100 Subject: [PATCH] Code formatting --- src/php_minifier/Macro.hx | 10 ++++------ src/php_minifier/Platform.hx | 12 +++--------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/php_minifier/Macro.hx b/src/php_minifier/Macro.hx index ecc083e..dd347c3 100644 --- a/src/php_minifier/Macro.hx +++ b/src/php_minifier/Macro.hx @@ -1,22 +1,20 @@ package php_minifier; -#if macro -import haxe.macro.Compiler; -import haxe.macro.Context; import sys.io.File; import sys.ssl.Socket; /** Provides initialization macros. **/ abstract class Macro { + #if macro /** Adds a shebang to the compiled file. **/ - public static function shebang(executable: String) Context.onAfterGenerate(() -> { - final path = Compiler.getOutput(); + public static function shebang(executable: String) haxe.macro.Context.onAfterGenerate(() -> { + final path = haxe.macro.Compiler.getOutput(); File.saveContent(path, '#!/usr/bin/env $executable\n${File.getContent(path)}'); }); + #end /** Enables or disables the verification of peer certificates during SSL handshake. **/ public static function verifySslCerts(value: Bool): Void Socket.DEFAULT_VERIFY_CERT = value; } -#end diff --git a/src/php_minifier/Platform.hx b/src/php_minifier/Platform.hx index b3b47f8..9a91b30 100644 --- a/src/php_minifier/Platform.hx +++ b/src/php_minifier/Platform.hx @@ -1,11 +1,5 @@ package php_minifier; -#if macro -import haxe.Json; -import haxe.macro.Context; -import sys.io.File; -#end - /** Information about the environment in which the current program is running. **/ abstract class Platform { @@ -26,13 +20,13 @@ abstract class Platform { /** Gets the name of the Haxe compilation target. **/ macro static function getHaxeTarget() - return macro $v{Context.definedValue("target.name")}; + return macro $v{haxe.macro.Context.definedValue("target.name")}; /** Gets the version number of the Haxe compiler. **/ macro static function getHaxeVersion() - return macro $v{Context.definedValue("haxe")}; + return macro $v{haxe.macro.Context.definedValue("haxe")}; /** Gets the package version of this program. **/ macro static function getPackageVersion() - return macro $v{Json.parse(File.getContent("haxelib.json")).version}; + return macro $v{haxe.Json.parse(sys.io.File.getContent("haxelib.json")).version}; }