Remove os invólucros do PHP <?php e ?>
do código especificado

@param string $code Código php sem ofuscar
@return string
343354
protected function phpWrapperRemove(string $code)
    {
        $matches = [];
        preg_match_all('/\<\?php|\<\?\=/i', $code, $matches);

        // Código misto não será ofuscado
        if(isset($matches[0]) && count($matches[0]) > 1) {
            return false;
        } else {
            return trim(str_replace(["<?php", "<?", "?>"], "", $code));
        }
    }
189632
public function uncolor($codes = array())
    {
        $nums = array();
        $result = array();
        $patts = array('/^' . chr(27) . '\[/', '/m$/');
        foreach ($codes as $code) {
            $esc = preg_replace($patts, '', $code);
            if (preg_match('/^((?:\d+;)*\d*)$/', $esc, $matches)) {
                if ($matches[0] != '') {
                    $nums = array_merge($nums, explode(';', $matches[0]));
                }
            } else {
                throw new InvalidArgumentException("Bad escape sequence $esc");
            }
        }
        foreach ($nums as $num) {
            $num += 0; // Strip leading zeroes
            if (isset($this->ATTRIBUTES_R[$num])) {
                $result[] = $this->ATTRIBUTES_R[$num];
            } else {
                throw new InvalidArgumentException("No name for escape sequence $num");
            }
        }
        return $result;
    }
1328004
public function parseCode($code)
    {
        $segments = (new NamespacedItemResolver)->parseKey($code);

        if (is_null($segments[0])) {
            $segments[0] = '*';
        }

        return $segments;
    }
707741
private function checksum($code)
	{
		$len = strlen($code);
		$sum = 0;
		for ($i = 0; $i < $len; $i += 2) {
			$sum += $code[$i];
		}
		$sum *= 3;
		for ($i = 1; $i < $len; $i += 2) {
			$sum += ($code[$i]);
		}
		$r = $sum % 10;
		if ($r > 0) {
			$r = (10 - $r);
		}
		return $r;
	}
773885
public static function getDescription($code)
    {
        if (isset(self::$codes[$code])) {
            return sprintf('%d (%s)', $code, self::$codes[$code]);
        }
        return $code;
    }
159262
function language($code) {
		$code=preg_replace('/\h+|;q=[0-9.]+/','',$code);
		$code.=($code?',':'').$this->fallback;
		$this->languages=[];
		foreach (array_reverse(explode(',',$code)) as $lang)
			if (preg_match('/^(\w{2})(?:-(\w{2}))?\b/i',$lang,$parts)) {
				// Generic language
				array_unshift($this->languages,$parts[1]);
				if (isset($parts[2])) {
					// Specific language
					$parts[0]=$parts[1].'-'.($parts[2]=strtoupper($parts[2]));
					array_unshift($this->languages,$parts[0]);
				}
			}
		$this->languages=array_unique($this->languages);
		$locales=[];
		$windows=preg_match('/^win/i',PHP_OS);
		// Work around PHP's Turkish locale bug
		foreach (preg_grep('/^(?!tr)/i',$this->languages) as $locale) {
			if ($windows) {
				$parts=explode('-',$locale);
				$locale=@constant('ISO::LC_'.$parts[0]);
				if (isset($parts[1]) &&
					$country=@constant('ISO::CC_'.strtolower($parts[1])))
					$locale.='-'.$country;
			}
			$locale=str_replace('-','_',$locale);
			$locales[]=$locale.'.'.ini_get('default_charset');
			$locales[]=$locale;
		}
		setlocale(LC_ALL,$locales);
		return $this->hive['LANGUAGE']=implode(',',$this->languages);
	}
1011557
public function checkCode($code)
    {
        $res = $this->twofactorAdapter->check($code);

        if($res)
        {
            setcookie('twofactorDir-' . $this->dir, $this->cookieCode, 0, "/");
            self::redirect();
        }

        return $res;
    }
287466
public static function getDescription($code)
    {
        if (array_key_exists($code, self::$codes_to_string_map)) {
            return self::$codes_to_string_map[$code];
        } else {
            return false;
        }
    }
1110563
public function removeCoupon($code)
    {
        $this->removeCouponFromItems($code);
        array_forget($this->cart->coupons, $code);
        $this->update();
    }
496583
public static function clearQueryArg($code)
  {
    if (StringTools::left($code, 1) == '/') {
      $code = StringTools::right($code, StringTools::len($code)-1);
    }
    if (StringTools::right($code, 1) == '/') {
      $code = StringTools::left($code, StringTools::len($code)-1);
    }

    return $code;
  }
1114030
public static function getErrText($code)
    {
        if (isset(self::$errCode[$code])) {
            return self::$errCode[$code];
        }
        return false;
    }
461810
public static function GetCodeName( $code ) : string
   {

      switch ( $code )
      {

         case \E_ERROR:
         case \E_USER_ERROR:
            return 'ERROR';

         case \E_WARNING:
         case \E_USER_WARNING:
            return 'WARNING';

         case \E_DEPRECATED:
         case \E_USER_DEPRECATED:
            return 'DEPRECATED';

         case \E_NOTICE:
         case \E_USER_NOTICE:
            return 'NOTICE';

         case \E_PARSE:
            return 'PARSE';
         case \E_RECOVERABLE_ERROR:
            return 'RECOVERABLE ERROR';

         case \E_STRICT:
            return 'STRICT';

         default:
            if ( \is_string( $code ) )
            {
               return $code;
            }
            return 'OTHER';

      }

   }
550290
public function getLanguageByCode($code)
    {
        $returnValue = null;


        $langClass = new core_kernel_classes_Class(static::CLASS_URI_LANGUAGES);
	    $langs = $langClass->searchInstances(array(
            OntologyRdf::RDF_VALUE => $code
	    ), array(
	    	'like' => false
	    ));
	    if (count($langs) == 1) {
	    	$returnValue = current($langs);
	    } else {
	    	common_Logger::w('Could not find language with code '.$code);
	    }


        return $returnValue;
    }
929723
public function getIdByCode(string $code): int
    {
        // pokud existuje kod v
        if (isset($this->locales[$code]['id'])) {
            return $this->locales[$code]['id'];
        }
        // pokud existuje kod v aliasu
        if (isset($this->aliasLocale[$code])) {
            $this->locales[$this->aliasLocale[$code]]['id'];
        }
        // jinak pouzije defaultni jazyk
        return ($this->locales[$this->defaultLocale]['id'] ?? 0);
    }
637280
function translate ($code)
    {
        if (preg_match_all("/<\?_\(\"(.*)\"\)\?>/siU", $code, $matches, PREG_SET_ORDER)) {
            foreach ($matches as $match) {
                if (isset($match[1])) {
                    $code = str_replace($match[0], gettext(stripslashes($match[1])), $code);
                }
            }
        }
        return $code;
    }
1360758
public function canDelete($code)
    {
        $code = strtoupper($code);

        if ($code == $this->getDefault()) {
            return false;
        }

        $currencies = $this->config->select('currencies', array());

        if (!isset($currencies[$code])) {
            return false;
        }

        $sql = 'SELECT NOT EXISTS (SELECT currency FROM orders WHERE currency=:code)
                AND NOT EXISTS (SELECT currency FROM price_rule WHERE currency=:code)
                AND NOT EXISTS (SELECT currency FROM product WHERE currency=:code)';

        return (bool) $this->db->fetchColumn($sql, array('code' => $code));
    }
355872
public function wrapString(string $code)
    {
        $prefix = ($this->decode_errors == false) ? '' : '@';

        $packer_method = $this->getPackerMethodName();
        $unpacker_function = $this->getPackerName();
        $argumenter  = $this->getArgumenterName();

        // Esconde o código com o desempacotador ramdômico
        $string = '';
        $string.= $this->toASCII($prefix. "eval({$unpacker_function}("); // esconde a função de descompressão
        $string.= "'" . $this->{$packer_method . "Pack"}($code) . "'";  // executa a função compactar
        $string.= $this->toASCII(",{$argumenter}()));");

        return "eval(\"{$string}\");";
    }