Download the PHP package whitedigital-eu/config-pack without Composer

On this page you can find all versions of the php package whitedigital-eu/config-pack. 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 config-pack

config-pack

WARNING
When upgrading from v1 to v2, it is better to run composer update without scripts and plugins, as v2 does not require symfony/phpunit-bridge anymore and uninstalling it may change or delete test related files, like .env.test or phpunit.xml.dist:

composer update -nW --no-scripts --no-plugins whitedigital-eu/config-pack

Installation

Usage

PhpCsFixer:

In PhpStorm:

PhpUnit:

or if tests/bootstrap.php differs from one in whitedigital-eu/config-pack:

PhpStan

In PhpStorm:

Functional usage (since v2.2)

ConfigPack only works in dev and test environments, make sure you set this config only for dev and test.

/** config/bundles.php */
WhiteDigital\Config\ConfigPack::class => ['dev' => true, 'test' => true]

Faker

This package now comes with fakerphp/faker as a dependency thus making usage of fake data generation easier. If used without AbstractTestCase or AbstractFixture, you can easily use faker using FakerTrait.

As Faker is used with this library's configuration, setFaker function call is mandatory before using any faker functionality.
Faker is autowired automatically. FakerTrait primarily passes through functions from faker factory, most useful methods are defined as methods in annotation so IDE can see them.
By default Faker uses lv_LV as locale and 2022 as seed. If different values are needed, you can configure them:

AbstractTestCase

As most of tests for testing api-platform apis are somewhat similar, AbstractTestCase defines a lot of useful functions to make testing apis a lot easier.
In overall, with using AbstractTestCase usual api test should look like this:

This tests:
GET: /api/customers/{id}
GET: /api/customer/{not_existing_id}
GET: /api/customers
POST: /api/customers
PATCH: /api/customers/{id}
DELETE: /api/customers/{id}

Tests by default uses authentication, you can configure login_email and login_password in config_pack configuration:

AbstractFixture

Similarly to AbstractTestCase, AbstractFixture defines base functions for doctrine fixtures. It also uses FakerTrait to simplify data generation.

AbstractFixture defines some useful functions:

getEntity -> getEntity(Entity::class): returns entity object for given class if fixture, where this class is created, is added to dependencies and dependant fixture defines reference.

getImage and getFile: coupled with whitedigital-eu/storage-item-resource library, these functions return entity for StorageItem based on need -> image or text file.

reference: set current fixture to references to be used elsewhere where this fixture is a dependency

getClassifier: explicitly returns Classifier if project contains any classifiers and project Classifier fixture extends BaseClassifierFixture.

BaseClassifierFixture

If your project have any classifier logic, you can extend BaseClassifierFixture and it will make classifier creation easier.
You need to have an entity with at least this structure to make this work:

And you need to have a Backed enum (here called ClassifierType).
Example of ClassifierType is something like this:

With BaseClassifierFixture classifiers can be created using two ways:
simple:

with data:

dependant:


All versions of config-pack with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.0
friendsofphp/php-cs-fixer Version *
phpstan/phpstan Version *
phpstan/phpstan-doctrine Version *
phpstan/phpstan-symfony Version *
phpunit/phpunit Version >=10.0
roave/security-advisories Version dev-latest
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 whitedigital-eu/config-pack contains the following files

Loading the files please wait ....