private function contents(): array
    {
        if (! $this->contents) {
            if (! file_exists($this->path)) {
                throw new \LogicException(
                    vsprintf('The PHP configuration file does not exist (%s)', [
                        realpath($this->path),
                    ])
                );
            }

            $contents = require $this->path;

            if (! is_array($contents)) {
                throw new \UnexpectedValueException(
                    vsprintf('The PHP configuration file must return an array, %s returned (%s)', [
                        gettype($contents),
                        realpath($this->path),
                    ])
                );
            }

            $this->contents = [
                'parameters' => $contents['parameters'] ?? [],
                'aliases' => $contents['aliases'] ?? [],
                'invokables' => $contents['invokables'] ?? [],
                'factories' => $contents['factories'] ?? [],
                'tags' => $contents['tags'] ?? [],
                'mappers' => $contents['mappers'] ?? [],
                'extensions' => $contents['extensions'] ?? [],
            ];
        }

        return $this->contents;
    }
private function contents(): array
    {
        if (! $this->contents) {
            if (! file_exists($this->path)) {
                throw new \LogicException(
                    vsprintf('The PHP configuration file does not exist (%s)', [
                        realpath($this->path),
                    ])
                );
            }

            $contents = require $this->path;

            if (! is_array($contents)) {
                throw new \UnexpectedValueException(
                    vsprintf('The PHP configuration file must return an array, %s returned (%s)', [
                        gettype($contents),
                        realpath($this->path),
                    ])
                );
            }

            $this->contents = [
                'parameters' => $contents['parameters'] ?? [],
                'aliases' => $contents['aliases'] ?? [],
                'invokables' => $contents['invokables'] ?? [],
                'factories' => $contents['factories'] ?? [],
                'tags' => $contents['tags'] ?? [],
                'mappers' => $contents['mappers'] ?? [],
                'extensions' => $contents['extensions'] ?? [],
            ];
        }

        return $this->contents;
    }
private function contents ( ) : array { if ( ! $ this -> contents ) { if ( ! file_exists ( $ this -> path ) ) { throw new \ LogicException ( vsprintf ( 'The PHP configuration file does not exist (%s)' , [ realpath ( $ this -> path ) , ] ) ) ; } $ contents = require $ this -> path ; if ( ! is_array ( $ contents ) ) { throw new \ UnexpectedValueException ( vsprintf ( 'The PHP configuration file must return an array, %s returned (%s)' , [ gettype ( $ contents ) , realpath ( $ this -> path ) , ] ) ) ; } $ this -> contents = [ 'parameters' => $ contents [ 'parameters' ] ?? [ ] , 'aliases' => $ contents [ 'aliases' ] ?? [ ] , 'invokables' => $ contents [ 'invokables' ] ?? [ ] , 'factories' => $ contents [ 'factories' ] ?? [ ] , 'tags' => $ contents [ 'tags' ] ?? [ ] , 'mappers' => $ contents [ 'mappers' ] ?? [ ] , 'extensions' => $ contents [ 'extensions' ] ?? [ ] , ] ; } return $ this -> contents ; }
Return the content of the file and cache it.

@return array[];
@throws \LogicException
@throws \UnexpectedValueException
Return the content of the file and cache it .