Download the PHP package gcdtech/usecases without Composer

On this page you can find all versions of the php package gcdtech/usecases. 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 usecases

PHP Use Case Pattern.

Base classes and interfaces for implementing the Use Case pattern along with entities and entity emitting iterators.

UseCases

A UseCase is a single class, implementing one 'use case' of the application business logic. It co-ordinates the manipulation of application state to acheive it's purpose.

Key objectives

1. Be portable

By using only simple objects and primitive types as parameters and return types the use cases of your application are a permanent representation of your business logic and moving to a new language or framework should not require any significant recoding.

2. Integrate with framework as a plugin

Where use cases need to interact with external layers (for example to persist changes in state) this should always be acheived by wrapping the framework functionality as a service and injecting it as a dependancy. This ensures that the UseCases can always be moved to a new framework and the interop with the framework is easily assessed, rewritten and replaced with no changes to the UseCase code or tests.

3. Be testable

As UseCases only deal with pure and simple PHP classes they should be 100% testable and so TDD should be the favoured approach to development.

4. Do one thing

A UseCase should be focused on completing one business goal - for example creation of an invoice. Where the action requires a concert of other changes this can be acheived by calling other UserCases.

Signature of a UseCase

Generally a UseCase has a single method 'execute' which takes arguments and returns a response value. It may also have a constructor through which service dependancies are injected.

Calling a UseCase

A UseCase should not be instantiated directly except in unit tests. In production code the static create() method ensure dependancies are injected using the DI container.

Entities

An entity is a simple POPO (Plain Old PHP Object) with no frills that represents the data passed into and out of UseCases. Generally an entity can be regarded as a model for a business object.

This library defines a base Entity class only to allow for basic type recognition (e.g. $arg instanceof Entity)

EntityEmittingIterator

ORMs generally support representing collections as iterable objects creating objects lazily as required. This is good practice to keep memory usage to the minimum possible. To represent a list we've provided an EntityEmittingIterator that extends the base Iterator PHP interface and can be used to classify parameter and return types.


All versions of usecases with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.0
psr/container Version ^1.0.0
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 gcdtech/usecases contains the following files

Loading the files please wait ....