Skip to content

Path from environment #124

@thekid

Description

@thekid

Scenario: I have a path for my app's content, which defaults to /path/to/webroot/content by default, but can be overridden via an environment variable:

$content= new Path($this->environment->variable('APP_CONTENT') ?? $this->environment->path('content'));

Small glitches here:

  • We create an io.Path element when the environment variable is unset although Environment::path() already returns one
  • We need an import of io.Path

Is there a more concise way of writing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions