Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace BookStack\Translation; class LocaleDefinition { public function __co..

Decoded Output download

<?php

namespace BookStack\Translation;

class LocaleDefinition
{
    public function __construct(
        protected string $appName,
        protected string $isoName,
        protected bool $isRtl
    ) {
    }

    /**
     * Provide the BookStack-specific locale name.
     */
    public function appLocale(): string
    {
        return $this->appName;
    }

    /**
     * Provide the ISO-aligned locale name.
     */
    public function isoLocale(): string
    {
        return $this->isoName;
    }

    /**
     * Returns a string suitable for the HTML "lang" attribute.
     */
    public function htmlLang(): string
    {
        return str_replace('_', '-', $this->isoName);
    }

    /**
     * Returns a string suitable for the HTML "dir" attribute.
     */
    public function htmlDirection(): string
    {
        return $this->isRtl ? 'rtl' : 'ltr';
    }

    /**
     * Translate using this locate.
     */
    public function trans(string $key, array $replace = []): string
    {
        return trans($key, $replace, $this->appLocale());
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace BookStack\Translation;

class LocaleDefinition
{
    public function __construct(
        protected string $appName,
        protected string $isoName,
        protected bool $isRtl
    ) {
    }

    /**
     * Provide the BookStack-specific locale name.
     */
    public function appLocale(): string
    {
        return $this->appName;
    }

    /**
     * Provide the ISO-aligned locale name.
     */
    public function isoLocale(): string
    {
        return $this->isoName;
    }

    /**
     * Returns a string suitable for the HTML "lang" attribute.
     */
    public function htmlLang(): string
    {
        return str_replace('_', '-', $this->isoName);
    }

    /**
     * Returns a string suitable for the HTML "dir" attribute.
     */
    public function htmlDirection(): string
    {
        return $this->isRtl ? 'rtl' : 'ltr';
    }

    /**
     * Translate using this locate.
     */
    public function trans(string $key, array $replace = []): string
    {
        return trans($key, $replace, $this->appLocale());
    }
}

Function Calls

None

Variables

None

Stats

MD5 f46d9c0bc2e7ccc1145d1b745378f393
Eval Count 0
Decode Time 97 ms