Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sanmai/linter

Simple PHP source code linter with zero dependencies
https://github.com/sanmai/linter

linter php

Last synced: about 1 month ago
JSON representation

Simple PHP source code linter with zero dependencies

Awesome Lists containing this project

README

        

[![Coverage Status](https://coveralls.io/repos/github/sanmai/linter/badge.svg?branch=master)](https://coveralls.io/github/sanmai/linter?branch=master)

# Simple PHP source code linter with zero dependencies

This is a very bare (really just 20 lines of code, comments included) yet very thoroughly tested (100% [MSI](https://medium.com/@maks_rafalko/infection-mutation-testing-framework-c9ccf02eefd1)) programmatic source code linter. Give it a piece of source code from a file or as a string, and it will tell you if this is a valid PHP or not. But do not forget to include the opening `foundErrors();

var_dump($result);
// bool(false)
```

```php
$linter = new \Linter\StringLinter('foundErrors();

var_dump($result);
// bool(true)
```

That's it!