Download the PHP package lucid/writer without Composer

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

Dumping strings with elegance

Author Source Code Software License

Build Status HHVM Code Coverage

Installation

The Writer

Dumping strings

Write a 2 line text block:

Behavior

By defatault, the Writer will remove trailing spaces at the end of each line.

You may override this behavior by calling the allowTrailingSpace() method.

Indentation

The default indentation level is 4 spaces.

If you require a different level using spaces, you'll have to specify this on the. constructor:

You may also change spaces to tabs using the useTabs() method.

Output indentation

Output indentation indents the whole block and is applied just before the string is being dumped. The value passed to setOutputIndentation(int $level) acts as a multiplyer.

API

Fluent methods:

Adds a line.

Adds an indentation.

Replaces a line at a line index.

Removes a line at a line index.

Removes the last line.

Appends a string to the last line.

None fluent methods:

Class, Interface, and Trait Writers

Dump PSR-2 compliant php source code.

There're three object generators, InterfaceWriter, ClassWriter, and TraitWriter. All object generators share a common API.

Shared API

This is a one time operation. Once the parent is set, you cannot change it. $parent name must be the FQN of the parent interface or class.

Adds a use statement to the php document. Naming conflicts will automatically be resolved, however you can set your own alias by declating the import like this \Acme\Foo as FooAlias. By default Acme\Lib\Foo will become LibFoo, or AcmeLibFoo, or AcmeLibFooAlias, and so on. Note that the use statement is considered to be the FQN;

Will return an instance of Lucid\Writer\Object\ImportResolver. This is useful if you need to know the aliases name of a imported string (interface, trait, parent class or usestatement), e.g.

Adds a constant to the interface.

Takes an object of type Lucid\Writer\Object\MethodInterface and adds it to the object declaration.

Returns an instance of Lucid\Writer\Object\DocBlock that represents the document level docblock.

Returns an instance of Lucid\Writer\Object\DocBlock that represents the object level docblock.

By default, the objectwriter will add a timestamp to the document level docblock. Use this if you wan't to deactivate this behavior.

InterfaceWriter

Use this for autogenerating php interfaces.

Results in:

API

Takes an object of type Lucid\Writer\Object\InterfaceMethod and adds it to the interface.

ClassWriter

Use this to generate php classes.

Results in:

API

In addition to the InterfaceWriter:

Example

Generating a class with constants, methods, properties, and traits.

Results in

TraitWriter

Behaves like the ClassWriter except there're no constants and interfaces.

Notes

Setting method bodies is up to you. However, if you rely on class base names that have been imported you can utilize the import resolver to determine the actual shortname that's used on the object writer.

Also see the Shared API section.


All versions of writer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
lucid/common Version dev-master
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 lucid/writer contains the following files

Loading the files please wait ....