Download the PHP package smpita/configas without Composer

On this page you can find all versions of the php package smpita/configas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package configas

Typed Config Resolver for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Do you use Laravel and fight the mixed signatures of config() when performing static analysis?

Smpita/ConfigAs types your config calls for you.

This package wraps Smpita/TypeAs, a generalized PHP library useful on any PHP project employing static analysis or tight type enforcement.

Installation

You can install the package via composer:


Usage

Please see SIGNATURES for the list of current methods and signatures.

General Usage

SIGNATURES#resolving

Pass a key and it will throw a ConfigAsResolutionException if the key isn't of the given type.

If you want to suppress throwing exceptions, provide a default.

The Class Method

SIGNATURES#class

class() has a slightly different signature because you need to specify the class you are expecting.

You can still provide a default.


Nullables

If you would prefer to receive null instead of having an exception thrown, each type method has a nullable counterpart.


Cache

SIGNATURES#cache

To keep things performant, types are only validated once and results are cached in static arrays for the lifetime of the request. To guarantee a fresh value, you may use the fresh methods that are available for each type.

Forgetting

SIGNATURES#forgetting

For each type, you can forget any given cached value.

You can flush the cache of a type.

You can flush all keys.


Resolvers

SIGNATURES#resolver-registration

You can leverage the included Smpita\TypeAs library to create your own custom resolvers. For creation, global registration, and full instructions, see the library docs.

Single use


Helpers

SIGNATURES#helpers

There is a configAs() helper method located in the Smpita\ConfigAs namespace.

Resolver methods have an associated helper method located in the Smpita\ConfigAs namespace. The helper method names follow the ConfigAs method names, but are prepended by config and are camelCased.


Deprecations

SIGNATURES#deprecations


Testing


Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of configas with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0|^11.0
smpita/typeas Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smpita/configas contains the following files

Loading the files please wait ....