PackageCreator

class PackageCreator (View source)

Properties

protected Filesystem $files The filesystem instance.
protected $basicBlocks The basic building blocks of the package.
protected $blocks The building blocks of the package.

Methods

void __construct(Filesystem $files)

Create a new package creator instance.

string create(Package $package, string $path, bool $plain = true)

Create a new package stub.

void createWithResources(Package $package, string $path)

Create a package with all resource directories.

array getBlocks(bool $plain)

Get the blocks for a given package.

void writeSupportFiles(Package $package, string $directory, bool $plain)

Write the support files to the package root.

void writePhpUnitFile(Package $package, string $directory)

Write the PHPUnit stub file.

void writeTravisFile(Package $package, string $directory)

Write the Travis stub file.

void writeComposerFile(Package $package, string $directory, bool $plain)

Write the Composer.json stub file.

string getComposerStub(bool $plain)

Get the Composer.json stub file contents.

void writeIgnoreFile(Package $package, string $directory, bool $plain)

Write the stub .gitignore file for the package.

void writeSupportDirectories(Package $package, string $directory)

Create the support directories for a package.

void writeSupportDirectory(Package $package, string $support, string $directory)

Write a specific support directory for the package.

void writePublicDirectory(Package $package, string $directory, bool $plain)

Create the public directory for the package.

void writeTestDirectory(Package $package, string $directory)

Create the test directory for the package.

void writeServiceProvider(Package $package, string $directory, bool $plain)

Write the stub ServiceProvider for the package.

void writeProviderStub(Package $package, string $directory, string $stub)

Write the service provider stub for the package.

string getProviderStub(Package $package, bool $plain)

Get the stub for a ServiceProvider.

string getProviderFile(bool $plain)

Load the raw service provider file.

string createClassDirectory(Package $package, string $directory)

Create the main source directory for the package.

string formatPackageStub(Package $package, string $stub)

Format a generic package stub file.

string createDirectory(Package $package, string $path)

Create a workbench directory for the package.

Details

void __construct(Filesystem $files)

Create a new package creator instance.

Parameters

Filesystem $files

Return Value

void

string create(Package $package, string $path, bool $plain = true)

Create a new package stub.

Parameters

Package $package
string $path
bool $plain

Return Value

string

void createWithResources(Package $package, string $path)

Create a package with all resource directories.

Parameters

Package $package
string $path

Return Value

void

protected array getBlocks(bool $plain)

Get the blocks for a given package.

Parameters

bool $plain

Return Value

array

void writeSupportFiles(Package $package, string $directory, bool $plain)

Write the support files to the package root.

Parameters

Package $package
string $directory
bool $plain

Return Value

void

protected void writePhpUnitFile(Package $package, string $directory)

Write the PHPUnit stub file.

Parameters

Package $package
string $directory

Return Value

void

protected void writeTravisFile(Package $package, string $directory)

Write the Travis stub file.

Parameters

Package $package
string $directory

Return Value

void

protected void writeComposerFile(Package $package, string $directory, bool $plain)

Write the Composer.json stub file.

Parameters

Package $package
string $directory
bool $plain

Return Value

void

protected string getComposerStub(bool $plain)

Get the Composer.json stub file contents.

Parameters

bool $plain

Return Value

string

void writeIgnoreFile(Package $package, string $directory, bool $plain)

Write the stub .gitignore file for the package.

Parameters

Package $package
string $directory
bool $plain

Return Value

void

void writeSupportDirectories(Package $package, string $directory)

Create the support directories for a package.

Parameters

Package $package
string $directory

Return Value

void

protected void writeSupportDirectory(Package $package, string $support, string $directory)

Write a specific support directory for the package.

Parameters

Package $package
string $support
string $directory

Return Value

void

void writePublicDirectory(Package $package, string $directory, bool $plain)

Create the public directory for the package.

Parameters

Package $package
string $directory
bool $plain

Return Value

void

void writeTestDirectory(Package $package, string $directory)

Create the test directory for the package.

Parameters

Package $package
string $directory

Return Value

void

void writeServiceProvider(Package $package, string $directory, bool $plain)

Write the stub ServiceProvider for the package.

Parameters

Package $package
string $directory
bool $plain

Return Value

void

protected void writeProviderStub(Package $package, string $directory, string $stub)

Write the service provider stub for the package.

Parameters

Package $package
string $directory
string $stub

Return Value

void

protected string getProviderStub(Package $package, bool $plain)

Get the stub for a ServiceProvider.

Parameters

Package $package
bool $plain

Return Value

string

protected string getProviderFile(bool $plain)

Load the raw service provider file.

Parameters

bool $plain

Return Value

string

protected string createClassDirectory(Package $package, string $directory)

Create the main source directory for the package.

Parameters

Package $package
string $directory

Return Value

string

protected string formatPackageStub(Package $package, string $stub)

Format a generic package stub file.

Parameters

Package $package
string $stub

Return Value

string

protected string createDirectory(Package $package, string $path)

Create a workbench directory for the package.

Parameters

Package $package
string $path

Return Value

string

Exceptions

InvalidArgumentException

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Workbench/PackageCreator.html