2017 © Pedro Peláez
 

library adviser

A CLI application that checks your project for various possible improvements.

image

bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

Adviser Build Status

Adviser is a CLI application that checks your PHP project for various possible improvements., (*1)

Heavily inspired by phppackagechecklist.com., (*2)

Motivation

  • Do I have some sort of a license file?
  • Is my composer.json valid?
  • Is my code PSR-2 compatible?
  • Are the repository tags and settings OK?

I often ask myself such questions. And I got tired of checking it all manually every time. Here comes Adviser to make things a lot easier., (*3)

Installing

Composer way

Just run in your terminal (you should be in your project's root directory):, (*4)

composer require --dev bound1ess/adviser

Or, if you don't have Composer installed globally:, (*5)

curl -sS https://getcomposer.org/installer | php
./composer.phar require --dev bound1ess/adviser

Now you should be able to run vendor/bin/adviser and see Adviser's CLI., (*6)

Building a PHAR (Box is required)

This is not very difficult to do either, just run:, (*7)

box --version
git clone https://github.com/bound1ess/adviser.git
cd adviser
composer update # Assuming that it's installed globally.
make build-phar

, (*8)

Now you can use builds/adviser.phar, or (only if you want to!) you can also do this:, (*9)

sudo mv builds/adviser.phar /usr/local/bin/adviser

Now you can use adviser (everywhere!) instead of builds/adviser.phar., (*10)

Using

analyse

This command will analyse (suggest possible improvements) the current working directory., (*11)

, (*12)

analyse --formatter="formattername"

Same, but the output will be formatted depending on the formatter you choose., (*13)

, (*14)

Available formatters:, (*15)

  • plaintext (Adviser\Output\Formatters\PlainTextFormatter).

analyse-repository name [--formatter="..."]

The name argument here is a Github repository name (e.g. bound1ess/adviser). This command will make a local clone of it, run the analyse command, then remove it (directory)., (*16)

, (*17)

Configuring

Adviser can be configured via an adviser.yml file placed in the working directory., (*18)

Adding a Formatter

# Add a new formatter.
formatters:
    - "Your\Custom\Formatter\ClassName"
    # ...

Adding a Validator

# Add a new validator.
validators:
    - "Your\Custom\Validator\ClassName"
    # ...

Configuring a Validator

ChangelogValidator

Adviser\Validators\ChangelogValidator:
    files:
        - "CHANGELOG.md"
        # ...

CIValidator

Adviser\Validators\CIValidator:
    allowedVersions:
        - "5.6"
        - "5.5"
        - "5.4"
        - "hhvm"
        # ...

ComposerValidator

Adviser\Validators\ComposerValidator:
    autoloader: "psr-4"
    source_directory: "src"

ContributingValidator

Adviser\Validators\ContributingValidator:
    files:
        - "CONTRIBUTING.md"
        # ...

FrameworkValidator

Adviser\Validators\FrameworkValidator:
    frameworks:
        - "laravel/framework"
        # ...

LicenseValidator

Adviser\Validators\LicenseValidator:
    files:
        - "LICENSE.md"
        # ...

ReadmeValidator

Adviser\Validators\ReadmeValidator:
    files:
        - "README.md"
        # ...

TestValidator

Adviser\Validators\TestValidator:
    frameworks:
        - "phpunit/phpunit"
        # ...
    frameworkToFiles:
        phpunit/phpunit:
            - "phpunit.xml"
            - "phpunit.xml.dist"
            # ...
        # ...

Extending

  1. Write the code.
  2. Don't forget to test it!
  3. Add it to the adviser.yml configuration file (see Configuring section).
  4. Done! Share your work with others if you want to.

Creating a Validator

class YourValidator extends \Adviser\Validators\AbstractValidator
{

    /**
     * @return \Adviser\Output\MessageBag
     */
    public function handle()
    {
        // @todo
    }
}

Creating a Formatter

use Adviser\Output\MessageBag;

class YourFormatter extends \Adviser\Output\Formatters\AbstractFormatter
{

    /**
     * @param MessageBag $bag
     * @return string
     */
    public function format(MessageBag $bag)
    {
        // @todo
    }
}

Contributing

  1. Fork the project and create a local clone of it.
  2. Install the dependencies: composer update or composer install --dev.
  3. Make a fix.
  4. Run the tests: make tests.

, (*19)

  1. Build the coverage report:
make code-coverage
make boot-server

Now open localhost:8000 in your browser. , (*20)

  1. Commit and pull!

Extra: building the documentation (ApiGen is required)

apigen --version
make build-docs boot-docs-server

Additional information

License and support information, as well as my thanks to everyone who made Adviser possible., (*21)

License

This project is licensed under the MIT license., (*22)

Support

Stuck? Found a bug? Feel free to create a new issue here on Github, or find me on Twitter., (*23)

Thanks!

To the creators of PHPUnit, Symfony, Guzzle, Mockery and Box projects., (*24)

The Versions

17/03 2015

dev-master

9999999-dev https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

17/03 2015

1.0.10

1.0.10.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

18/02 2015

1.0.9

1.0.9.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

17/02 2015

1.0.8

1.0.8.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

17/02 2015

0.1.3

0.1.3.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

14/02 2015

1.0.7

1.0.7.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

07/02 2015

1.0.6

1.0.6.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

06/02 2015

1.0.5

1.0.5.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

02/02 2015

1.0.4

1.0.4.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

31/01 2015

1.0.3

1.0.3.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

30/01 2015

1.0.1

1.0.1.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

30/01 2015

1.0.2

1.0.2.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

30/01 2015

1.0.0

1.0.0.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

29/01 2015

0.2.0

0.2.0.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

28/01 2015

0.1.2

0.1.2.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

28/01 2015

0.1.1

0.1.1.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

27/01 2015

0.1.0

0.1.0.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible

23/01 2015

0.0.0

0.0.0.0 https://github.com/bound1ess/adviser

A CLI application that checks your project for various possible improvements

  Sources   Download

MIT

The Requires

 

The Development Requires

cli application suggest improvements possible