GithubHelp home page GithubHelp logo

folded-php / config Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 121 KB

Configuration utilities for your PHP web app.

Home Page: https://packagist.org/packages/folded/config

License: MIT License

PHP 97.86% Dockerfile 1.90% Shell 0.24%
configuration environment php

config's People

Contributors

khalyomede avatar

Watchers

 avatar  avatar

config's Issues

Upgrade to folded/exception 0.4.0

Description

This package uses an old version of folded/exception.

Proposal

Upgrade to folded/exception:0.4.*

Worarkound solutions

Notes

Missing namespace in function_exists call

Description

When the code loads functions, it should detect the existance of the function under the namespace instead of just the name of the function

Expected behavior

The call of function_exists() use the full qualified namespace.

namespace Folded;

if (!function_exists("Folded\theFunction")) {
  // load the function now
}

Actual behavior

Functions declared twice enters in collision.

Alternatives solutions

None.

Upgrade to folded/exception 0.3

Description

The package folded/exception has released version 0.3.

Expected behavior

The package uses folded/exception 0.3.

Actual behavior

The package uses folded/exception 0.1.

Alternatives solutions

None.

Notes

Mark Config and Env classes as final

Description

These classes are not meant to be extended.

Proposal

  • The Config class is marked as final
  • The Env class is marked as final

Worarkound solutions

None.

Notes

None.

Convert booleans string to bool

Description

Booleans like APP_DEBUG=true are not converted to bool by default.

Reproduce the issue

var_dump(Folded\getEnv("APP_DEBUG")); // string (4) "true"

With

APP_DEBUG=true

Expected behavior

A boolean is printed.

Actual behavior

A string is printed.

Alternatives solutions

Using filter_var(Folded\getEnv("APP_DEBUG"), FILTER_VALIDATE_BOOLEAN);

Notes

Add static analysis in the test command

Description

Static analysis helps catching bugs earlier.

Proposal

  • Using phpstan/phpstan and run the command after the test command: pest --coverage && phpstan analyse src
  • Use the level 8 for a maximum of consistency
  • Use a phpstan.neon configuration file

Worarkound solutions

None.

Notes

None.

Bug when using getEnv inside a config file will not get the value

Description

Getting an env variable inside a config file will not get the correct value when calling getConfig with correct key.

Reproduce the issue

Have a config file with an env value as value:

# .env
APP_NAME=Folded
// config/app.php
return [
  "name" => getEnv("APP_NAME"),
];

Var dumping the content will return false instead of the name of the app.

use function Folded\getConfig;

getConfig("app.name"); // false

Expected behavior

The app name is correctly dumped.

Actual behavior

False is dumped.

Alternatives solution

Setting hard coded value and not using getEnv inside the config file.

Notes

Add issues templates for both bugs and enhancements

Description

There is no templates for bugs and enhancements, which can reduce the chances someone will want to describe his issue or can make difficult to format and clarify an issue without proper templates.

Expected behavior

Enhancements issue template

For an enhancements, the following sections (using level 2 title, ##) should be shown:

  • Description
  • Proposal
  • Workaround solutions
  • Notes

The text hints, using italic, should be shown below each of these titles (without the double quotes):

  • Description: "Give some context and motivation for the proposed solution."
  • Proposal: "The detail proposition. Can include code."
  • Worarkound solutions: "Mention every existing workaround you know that will solve the issue apart from the proposed solution."
  • Notes: "Add everything that relates the proposal, like future induced issues, related issues, ..."

Bug issue template

For a bug, the following sections (using level 2 title, ##) should be shown:

  • Description
  • Steps to reproduce the issue
  • Expected behavior
  • Workaround solutions
  • Notes

The text hints, using italic, should be show below each of these titles (without the double quotes):

  • Description: "Any information that can give more understanding about how you came to this issue."
  • Steps to reproduce the issue: "Detail precisely how we can reproduce the issue from a blank new project (if possible)."
  • Expected behavior: "Describe what the output or the behavior should be instead of the issue you have."
  • Workaround solutions: "Mention every existing workaround you know that will solve the issue."
  • Notes: "Add everything that relates the proposal, like related issues, ..."

Alternatives solutions

To write by hand the issue layout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.