2017 © Pedro Peláez
 

library cludearg

Normalizer library for command line arguments for in- or exclude paths and files

image

fabiang/cludearg

Normalizer library for command line arguments for in- or exclude paths and files

  • Friday, July 4, 2014
  • by fabiang
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

fabiang/cludearg

Normalizer library for command line arguments for in- or exclude paths and files, (*1)

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight Dependency Status Latest Stable Version License, (*2)

When running code checks against your code (manually or automatically via continues integration) you'll have to define paths/files that should (includes) and paths/files that shouldn't (excludes) be checked by the various applications., (*3)

The problem is that all those tools define the command-line arguments in a different way. This library instead accepts only a standardized format and can return the application-format for a given application name and version., (*4)

SUPPORTED APPLICATIONS

  • php/lint (php -l)
  • squizlabs/php_codesniffer
  • phpmd/phpmd
  • phpdocumentor/phpdocumentor
  • pdepend/pdepend
  • sebastian/phpcpd

INSTALLATION

New to Composer? Read the introduction. Add the following to your composer file:, (*5)

{
    "require": {
        "fabiang/cludearg": "1.0.x-dev as 1.0.0"
    }
}

USAGE

You'll only need one method:, (*6)

Fabiang\Cludearg\Cludearg::getArgument(
    string $application,
    string $version,
    array $include,
    array $exclude,
    string $path
)

Example:, (*7)

use Fabiang\Cludearg\Cludearg;

$cludearg = new Cludearg();

$arguments = $cludearg->getArgument(
    'squizlabs/php_codesniffer',
    '1.0.1',
    array('bin/foo.php', 'src'), // files and folders to be included
    array('vendor', 'tests'), // files and folders to be excluded
    '/myproject' // path where the project can be found
);

All paths for in- and exclude must be relative to the given path. The constructor of Cludearg can optionally take an Definition object, which allows you to add your own definition of arguments., (*8)

SYSTEM REQUIREMENTS

  • PHP >=5.3
  • seld/jsonlint >= 1.1

LICENSE

BSD-2-Clause. See the LICENSE., (*9)

CONTRIBUTING

Contributing is easy, just make sure the tests are running:, (*10)

./vendor/bin/phpunit -c tests

If you change the default definition file check if the json schema validates:, (*11)

./vendor/bin/validate-json definition.json schema/cludearg.json

Also Jsonlint may help you to find errors in the definition file:, (*12)

./vendor/bin/jsonlint definition.json

The Versions

04/07 2014

dev-master

9999999-dev https://github.com/fabiang/cludearg

Normalizer library for command line arguments for in- or exclude paths and files

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires