protected function getLocaleFromInput($input = null): string
    {
        if ($input instanceof Locale) {
            $input = $input->getCode();
        }

        if (null === $input) {
            return $this->localeCode;
        }

        if ($this->sys->getLocale() && $input !== $this->sys->getLocale()) {
            throw new \InvalidArgumentException(\sprintf(
                'Entry with ID "%s" was built using locale "%s", but now access using locale "%s" is being attempted.',
                $this->sys->getId(),
                $this->sys->getLocale(),
                $input
            ));
        }

        if (!\in_array($input, $this->localeCodes, true)) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to use invalid locale "%s", available locales are "%s".',
                $input,
                \implode(', ', $this->localeCodes)
            ));
        }

        return $input;
    }
protected function getLocaleFromInput($input = null): string
    {
        if ($input instanceof Locale) {
            $input = $input->getCode();
        }

        if (null === $input) {
            return $this->localeCode;
        }

        if ($this->sys->getLocale() && $input !== $this->sys->getLocale()) {
            throw new \InvalidArgumentException(\sprintf(
                'Entry with ID "%s" was built using locale "%s", but now access using locale "%s" is being attempted.',
                $this->sys->getId(),
                $this->sys->getLocale(),
                $input
            ));
        }

        if (!\in_array($input, $this->localeCodes, true)) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to use invalid locale "%s", available locales are "%s".',
                $input,
                \implode(', ', $this->localeCodes)
            ));
        }

        return $input;
    }
protected function getLocaleFromInput ( $ input = null ) : string { if ( $ input instanceof Locale ) { $ input = $ input -> getCode ( ) ; } if ( null === $ input ) { return $ this -> localeCode ; } if ( $ this -> sys -> getLocale ( ) && $ input !== $ this -> sys -> getLocale ( ) ) { throw new \ InvalidArgumentException ( \ sprintf ( 'Entry with ID "%s" was built using locale "%s", but now access using locale "%s" is being attempted.' , $ this -> sys -> getId ( ) , $ this -> sys -> getLocale ( ) , $ input ) ) ; } if ( ! \ in_array ( $ input , $ this -> localeCodes , true ) ) { throw new \ InvalidArgumentException ( \ sprintf ( 'Trying to use invalid locale "%s", available locales are "%s".' , $ input , \ implode ( ', ' , $ this -> localeCodes ) ) ) ; } return $ input ; }
@param Locale|string|null $input

@throws \InvalidArgumentException when $locale is not one of the locales supported by the space

@return string
@param Locale|string|null $input