<?php
// YAK Pro - Php Obfuscator: Config File
// Do not delete the previous line! it's a magic string for config file!

// ── SAFE for Laravel 13 ──────────────────────────────────────────────────────
// Class / namespace / interface / trait names MUST stay intact:
//   - Composer autoloader maps class name → file path
//   - routes/web.php references [ServiceController::class, 'method']
//   - config/app.php lists provider class names
$conf->obfuscate_class_name             = false;
$conf->obfuscate_namespace_name         = false;
$conf->obfuscate_interface_name         = false;
$conf->obfuscate_trait_name             = false;

// Properties MUST stay intact:
//   - Eloquent fillable/casts/table accessed by framework by name
//   - Inertia shared data keys accessed by name in JS
$conf->obfuscate_property_name          = false;

// Class constants MUST stay intact:
//   - Referenced as ClassName::CONSTANT in config/routes
$conf->obfuscate_class_constant_name    = false;

// Top-level constants: be safe
$conf->obfuscate_constant_name          = false;

// String literals: disable — some strings are class/method name references
$conf->obfuscate_string_literal         = false;

// ── SAFE to obfuscate ────────────────────────────────────────────────────────
$conf->obfuscate_variable_name          = true;
$conf->obfuscate_function_name          = false; // standalone functions: helpers like now(), broadcast() — too risky
$conf->obfuscate_method_name            = false; // cannot safely rename: framework calls Cache::put(), Window::open() etc.
                                                 // yakpro-po renames ALL occurrences incl. calls to vendor — breaks Laravel
$conf->obfuscate_label_name             = true;
$conf->obfuscate_if_statement           = false; // goto obfuscation breaks PHP 8.4 match/try-catch constructs
$conf->obfuscate_loop_statement         = false;

// ── Shuffle statements — adds goto jumps (hard to read, safe for Laravel) ───
$conf->shuffle_stmts                    = true;
$conf->shuffle_stmts_min_chunk_size     = 1;

// ── Preserve promoted constructor properties ─────────────────────────────────
// PHP promoted props derive their property NAME from the parameter variable name.
// If yakpro-po renames $service → $U0ASwIc_, the property becomes U0ASwIc_
// but all method bodies still call $this->service → undefined property → 500.
// Fix: list every promoted-property variable name here so yakpro-po skips them.
$conf->t_ignore_variables = [
    'algorithm','caPassword','caPath','decrypter','encrypter',
    'endpointType','errorPath','ftp','gateway','generation',
    'inboxPath','isActive','item','keepPath','keyPath',
    'level','log','manager','message','mirror','mover',
    'name','organization','outboxPath','outboxReader','packager',
    'password','pipeline','primary','profile','profileName','profiles',
    'request','rest','sendOption','service','signFilePath','signOption',
    'signer','signing','soap','username',
    'wsAuth','wsAuthMirror','wsAuthMirrorUrl','wsSend','wsReceive',
    'wsSendMirror','wsReceiveMirror',
];

// ── Predefined class methods ─────────────────────────────────────────────────
$conf->t_ignore_pre_defined_classes     = 'all';

// ── Output settings ──────────────────────────────────────────────────────────
$conf->scramble_mode                    = 'identifier';
$conf->scramble_length                  = 8;
$conf->strip_indentation                = true;
$conf->abort_on_error                   = false;   // skip unparseable files, don't abort
$conf->silent                           = true;

$conf->t_obfuscate_php_extension        = ['php'];
$conf->parser_mode                      = 'HOST_VERSION';
?>
