GithubHelp home page GithubHelp logo

lint's Introduction

Latest Stable Version Latest Unstable Version Build Status Scrutinizer Code Quality License Total Downloads

Lint

Lint is a wrapper to php -l command.

Composer Installation

To install Lint, you first need to install Composer, a Package Manager for PHP, following those few steps:

curl -s https://getcomposer.org/installer | php

You can run this command to easily access composer from anywhere on your system:

sudo mv composer.phar /usr/local/bin/composer

Lint Installation

Once you have installed Composer, it's easy install Lint.

  1. Edit your composer.json file, adding Lint to the require section:
{
    "require": {
        "3f/lint": "dev-master"
    },
}
  1. Run the following command in your project root dir:
composer update

Usage

Lint provides two static methods only: checkSourceFile() and checkSourceCode():

Lint::checkSourceFile("foo.php");

Methods

Lint::checkSourceFile()

public static function checkSourceFile(
    $fileName
)

Makes the syntax check of the specified file. If an error occurs, generates an exception.

Parameters

  • fileName

    The file name you want check.

Exceptions

  • RuntimeException

    In case of error it raises an exception.

Lint::checkSourceCode()

public static function checkSourceCode(
    $str,
    $addTags = TRUE
)

Makes the syntax check of the given source code. If an error occurs, generates an exception.

Parameters

  • str

    The source code.

  • addTags

    Tells if you want add PHP tags to the source code, because PHP lint needs them or it will raise an exception.

Exceptions

  • RuntimeException

    In case of error it raises an exception.

Documentation

The documentation can be generated using Doxygen. A Doxyfile is provided for your convenience.

Requirements

  • PHP 5.4.0 or above.

Authors

Filippo F. Fadda - [email protected] - http://www.linkedin.com/in/filippofadda

License

Lint is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

lint's People

Contributors

dedalozzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jennik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.