public function changeKeyCase(int $case = \CASE_LOWER): self
    {
        if (
            $case !== \CASE_LOWER
            &&
            $case !== \CASE_UPPER
        ) {
            $case = \CASE_LOWER;
        }

        $return = [];
        foreach ($this->getGenerator() as $key => $value) {
            if ($case === \CASE_LOWER) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                $key = \mb_strtolower((string) $key);
            } else {
                /** @noinspection PhpComposerExtensionStubsInspection */
                $key = \mb_strtoupper((string) $key);
            }

            $return[$key] = $value;
        }

        return static::create(
            $return,
            $this->iteratorClass,
            false
        );
    }
public function changeKeyCase(int $case = \CASE_LOWER): self
    {
        if (
            $case !== \CASE_LOWER
            &&
            $case !== \CASE_UPPER
        ) {
            $case = \CASE_LOWER;
        }

        $return = [];
        foreach ($this->getGenerator() as $key => $value) {
            if ($case === \CASE_LOWER) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                $key = \mb_strtolower((string) $key);
            } else {
                /** @noinspection PhpComposerExtensionStubsInspection */
                $key = \mb_strtoupper((string) $key);
            }

            $return[$key] = $value;
        }

        return static::create(
            $return,
            $this->iteratorClass,
            false
        );
    }
public function changeKeyCase ( int $ case = \ CASE_LOWER ) : self { if ( $ case !== \ CASE_LOWER && $ case !== \ CASE_UPPER ) { $ case = \ CASE_LOWER ; } $ return = [ ] ; foreach ( $ this -> getGenerator ( ) as $ key => $ value ) { if ( $ case === \ CASE_LOWER ) { /** @noinspection PhpComposerExtensionStubsInspection */ $ key = \ mb_strtolower ( ( string ) $ key ) ; } else { /** @noinspection PhpComposerExtensionStubsInspection */ $ key = \ mb_strtoupper ( ( string ) $ key ) ; } $ return [ $ key ] = $ value ; } return static :: create ( $ return , $ this -> iteratorClass , false ) ; }
Changes all keys in an array.

@param int $case [optional] <p> Either <strong>CASE_UPPER</strong><br />
or <strong>CASE_LOWER</strong> (default)</p>

@return static
<p>(Immutable)</p>
Changes all keys in an array .