Download the PHP package samhastings/classistant without Composer

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

Classistant

Classistant provides a fluent interface for generating PHP classes in PHP.

Why?

I needed a way of creating PHP classes on the fly, defining property and method names based on user input. Creating PHP code based on user input might sound like an awful idea, but it actually worked pretty well.

Requirements

Classistant requires PHP 7.0 or higher, both to run the code generator and to run the PHP it outputs. I’m afraid I have no plans to write a PHP 5.x version of this library.

Limitations

Currently, Classistant does not support any of the following features. I do however plan to implement these in the future.

Installation

Install via Composer:

Configuration

There’s not much this library offers in the way of configuration, apart from allowing you to customise the automatic indentation to match your personal preference.

By default, generated code is indented with four spaces. Override this as you wish with the following Config class properties.

Usage

A complete example of functionality is shown below. I’ve commented it throughout but the code will be self-explanatory.

All classes reside within the SamHastings\Classistant namespace.

A note on class resolution

The ::class constant, available on all classes, interfaces and traits as of PHP 5.5, provides a handy shortcut for fetching a fully-qualified class name. This will never contain a leading backslash, as a class name in a string is always treated by PHP as being relative to the global namespace when called with the new operator.

Whenever you’re using Classistant to generate namespaced classes, always prepend a backslash to arguments passed to ClassGenerator::extends(), ClassGenerator::implements() and ClassGenerator::use(). The same rules apply if you’re passing a class or interface name as a method parameter or return type. Otherwise, your generated code will generate a fatal error as PHP looks for said class names in the same namespace as your generated class.


All versions of classistant with dependencies

PHP Build Version
Package Version
Requires php Version ^7
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 samhastings/classistant contains the following files

Loading the files please wait ....