src/Compiler/Compiler.php
private function decorateStringValue(string $value) : string
    {
        if ($value === '@this'){
            return "\$c";
        }
    
        if (preg_match('/^@id:(.*)$/s',$value,$matches)){
            $id = trim($matches[1]);
            return "\$c['" . self::escapeSingleQuote($id) . "']";
        }
    
        if (preg_match('/^@resolve:(.*)$/s',$value,$matches)){
            $target = trim($matches[1]);
            return "\$c[\$c->resolve('" . self::escapeSingleQuote($target) . "')]";
        }
    
        if (preg_match('/^@func:(.*)$/s',$value,$matches)){
            $func = trim($matches[1]);
            $this->validateCallable($func);
            return $func;
        }
        
        if (preg_match('/^@int:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateInteger($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@float:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateFloat($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@bool:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateBool($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@json:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateJson($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@env:(.*)$/s',$value,$matches)){
            $id = trim($matches[1]);
            return "(\$_ENV['" . self::escapeSingleQuote($id) . "'] ?? null)";
        }
    
        return "'" . self::escapeSingleQuote($value) . "'";
    }
private function decorateStringValue(string $value) : string
    {
        if ($value === '@this'){
            return "\$c";
        }
    
        if (preg_match('/^@id:(.*)$/s',$value,$matches)){
            $id = trim($matches[1]);
            return "\$c['" . self::escapeSingleQuote($id) . "']";
        }
    
        if (preg_match('/^@resolve:(.*)$/s',$value,$matches)){
            $target = trim($matches[1]);
            return "\$c[\$c->resolve('" . self::escapeSingleQuote($target) . "')]";
        }
    
        if (preg_match('/^@func:(.*)$/s',$value,$matches)){
            $func = trim($matches[1]);
            $this->validateCallable($func);
            return $func;
        }
        
        if (preg_match('/^@int:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateInteger($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@float:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateFloat($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@bool:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateBool($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@json:(.*)$/s',$value,$matches)){
            $value = trim($matches[1]);
            $value = $this->validateJson($value);
            return $this->decorateValue($value);
        }
    
        if (preg_match('/^@env:(.*)$/s',$value,$matches)){
            $id = trim($matches[1]);
            return "(\$_ENV['" . self::escapeSingleQuote($id) . "'] ?? null)";
        }
    
        return "'" . self::escapeSingleQuote($value) . "'";
    }
private function decorateStringValue ( string $ value ) : string { if ( $ value === '@this' ) { return "\$c" ; } if ( preg_match ( '/^@id:(.*)$/s' , $ value , $ matches ) ) { $ id = trim ( $ matches [ 1 ] ) ; return "\$c['" . self :: escapeSingleQuote ( $ id ) . "']" ; } if ( preg_match ( '/^@resolve:(.*)$/s' , $ value , $ matches ) ) { $ target = trim ( $ matches [ 1 ] ) ; return "\$c[\$c->resolve('" . self :: escapeSingleQuote ( $ target ) . "')]" ; } if ( preg_match ( '/^@func:(.*)$/s' , $ value , $ matches ) ) { $ func = trim ( $ matches [ 1 ] ) ; $ this -> validateCallable ( $ func ) ; return $ func ; } if ( preg_match ( '/^@int:(.*)$/s' , $ value , $ matches ) ) { $ value = trim ( $ matches [ 1 ] ) ; $ value = $ this -> validateInteger ( $ value ) ; return $ this -> decorateValue ( $ value ) ; } if ( preg_match ( '/^@float:(.*)$/s' , $ value , $ matches ) ) { $ value = trim ( $ matches [ 1 ] ) ; $ value = $ this -> validateFloat ( $ value ) ; return $ this -> decorateValue ( $ value ) ; } if ( preg_match ( '/^@bool:(.*)$/s' , $ value , $ matches ) ) { $ value = trim ( $ matches [ 1 ] ) ; $ value = $ this -> validateBool ( $ value ) ; return $ this -> decorateValue ( $ value ) ; } if ( preg_match ( '/^@json:(.*)$/s' , $ value , $ matches ) ) { $ value = trim ( $ matches [ 1 ] ) ; $ value = $ this -> validateJson ( $ value ) ; return $ this -> decorateValue ( $ value ) ; } if ( preg_match ( '/^@env:(.*)$/s' , $ value , $ matches ) ) { $ id = trim ( $ matches [ 1 ] ) ; return "(\$_ENV['" . self :: escapeSingleQuote ( $ id ) . "'] ?? null)" ; } return "'" . self :: escapeSingleQuote ( $ value ) . "'" ; }
Modify string value for function call or setting property

@param string $value

@return string

@throws CompileErrorException
Modify string value for function call or setting property