2017 © Pedro Peláez
 

library ide-helper

Spiral Framework IDE helper

image

spiral/ide-helper

Spiral Framework IDE helper

  • Thursday, June 29, 2017
  • by wolfy-j
  • Repository
  • 6 Watchers
  • 3 Stars
  • 663 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

Spiral IDE Helper

Latest Stable Version Total Downloads License Scrutinizer Code Quality Coverage Status, (*1)

This module generate IDE help files for spiral framework components like Controllers, RequestsFilters, Records, Documents and etc., (*2)

Install

composer require spiral/ide-helper
./spiral register spiral/ide-helper && ./spiral console:reload

Usage

./spiral ide-helper

Configuration and Terminology

The module is configured via config/modules/ide-helper.php file., (*3)

The config has 3 sections: writers, locators, scopes., (*4)

VIEW CONFIG FILE, (*5)

locators section includes any Locators used by the module. Locator is a class that responsible for searching classes and it's [magic] members., (*6)

writers section includes any Writers used by the modules. Writers are responsible to write the stuff collected by locators to some destination., (*7)

Both locators and writers must be represented by associated array, where the key is any human reasonable name for locator or writer and the value is class string or \Spiral\Core\Container\Autowire instance (can be obtained by bind method)., (*8)

scopes section is also associated array, where the keys is any human reasonable name for the scope and the value is scope definition. Scope definition consists of number of locators and writers to execute, just check config above to understand the syntax. Each scope is executed independently., (*9)

The package includes following locators and writers: * BindingsLocator — find short bindings (SharedTrait) * ContainersLocator — find container and it's bindings * DocumentsLocator — find documents and it's fields * RecordsLocator — find records and it's fields * FilePerClassWriter — write every class to it's own file * SingleFileWriter — write everything to one file, (*10)

Extending

Custom Locators

To create your own locator you must implement \Spiral\IdeHelper\Locators\LocatorInerface:, (*11)

interface LocatorInterface
{
    /**
     * @return ClassDefinition[]
     */
    public function locate(): array;
}
 ```
and then register it in configuration file.

### Custom Writers

Same as custom locator but `\Spiral\IdeHelper\Writers\WriterInterface` interface:
```php
interface WriterInterface
{
    /**
     * @param ClassDefinition[] $classes
     */
    public function write(array $classes);
}

FilePerClassWriter and SingleFileWriter are using \Spiral\IdeHelper\Rendere\RendererInterface for rendering content, so if you want only to change the way files are looks like you can create your own implementation., (*12)

interface RendererInterface
{
    /**
     * @param ClassDefinition[] $classes
     * @return string
     */
    public function render(array $classes): string;
}

The Versions

29/06 2017

dev-master

9999999-dev

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Mironov

29/06 2017

v0.9.6

0.9.6.0

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Mironov

06/04 2017

v0.9.5

0.9.5.0

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Mironov

06/04 2017

dev-develop

dev-develop

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Mironov

06/04 2017

v0.9.4

0.9.4.0

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Mironov

17/03 2017

v0.9.3

0.9.3.0

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Mironov

07/02 2017

v0.9.2

0.9.2.0

Spiral Framework IDE helper

  Sources   Download

MIT

The Requires

 

by Dmitry Mironov

07/02 2017

v0.9.1

0.9.1.0

Spiral Framework IDE helper

  Sources   Download

The Requires

 

by Dmitry Mironov

07/02 2017

v0.9.0

0.9.0.0

Spiral Framework IDE helper

  Sources   Download

The Requires

 

by Dmitry Mironov