{"id":20332597,"url":"https://github.com/socialengine/sniffer-rules","last_synced_at":"2025-04-11T21:33:01.435Z","repository":{"id":20759029,"uuid":"24043634","full_name":"SocialEngine/sniffer-rules","owner":"SocialEngine","description":"SocialEngine specific laravel-bound code sniffer package","archived":false,"fork":false,"pushed_at":"2017-09-29T21:01:30.000Z","size":59,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-25T17:23:34.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SocialEngine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-15T05:09:44.000Z","updated_at":"2023-11-10T07:20:13.000Z","dependencies_parsed_at":"2022-08-21T20:01:04.292Z","dependency_job_id":null,"html_url":"https://github.com/SocialEngine/sniffer-rules","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fsniffer-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fsniffer-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fsniffer-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialEngine%2Fsniffer-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SocialEngine","download_url":"https://codeload.github.com/SocialEngine/sniffer-rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248483396,"owners_count":21111442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T20:27:27.072Z","updated_at":"2025-04-11T21:33:01.393Z","avatar_url":"https://github.com/SocialEngine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpcs 2.0+ Laravel 5, Lumen 5 Command\n[![Build Status](https://travis-ci.org/SocialEngine/sniffer-rules.svg?branch=master)](https://travis-ci.org/SocialEngine/sniffer-rules)\n[![Latest Stable Version](https://poser.pugx.org/SocialEngine/sniffer-rules/version.png)](https://packagist.org/packages/SocialEngine/sniffer-rules)\n[![License](https://poser.pugx.org/SocialEngine/sniffer-rules/license.svg)](https://packagist.org/packages/SocialEngine/sniffer-rules)\n\nThis is a [Laravel](http://laravel.com/) 5 package that hooks up \n[SquizLabs CodeSniffer 2](https://github.com/squizlabs/PHP_CodeSniffer) \ninto Laravel-based apps. It can also be used manually, so read on.\n\nDetect violations of a defined coding standard. It helps your code remain \nclean and consistent. Available options are: **PSR2**, **PSR1**, **Zend**, \n**PEAR**, **Squiz**, **PHPCS** and **SocialEngine**.\n\n### Setup\n\nRequire this package in composer:\n\n```\n$ composer require socialengine/sniffer-rules\n```\n\n#### Laravel 5\n\nIn your `config/app.php` add `'SocialEngine\\SnifferRules\\ServiceProvider'` \nto `$providers` array:\n\n```php\n'providers' =\u003e [\n    'Illuminate\\Foundation\\Providers\\ArtisanServiceProvider',\n    'Illuminate\\Auth\\AuthServiceProvider',\n    \n    'SocialEngine\\SnifferRules\\ServiceProvider',\n\n],\n```\n#### Laravel 5: Publish the configuration file\n\n```bash\n$ php artisan vendor:publish\n```\n\n#### Manual\n\nInstall our _Standard_ by configuring **PHP_CodeSniffer** to look for it. \n\n```bash\n$ php ./vendor/bin/phpcs --config-set installed_paths ./vendor/socialengine/src/Socialengine/SnifferRules/Standard/\n```\n\n### Usage\n#### Laravel\n```bash\n$ php artisan sniff\n```\n    \nTo run the sniffer in a CI environment, the `-n` option should be set to remove\ninteraction:\n\n```\n$ php artisan sniff -n\n```\n\n#### Manual\n\n```bash\n$ php ./vendor/bin/phpcs --standard=SocialEngine path/to/code \n```\n\nIt's encouraged to add a [`Makefile`](Makefile) to your project that makes it \ntrivial for other developers. Use `Makefile` in this directory and adjust as \nneeded to fit your project requirements.\n\n### Travis\n\nIn combination with the [`Makefile`](Makefile), Travis has issues finding the\nstandard, we had to add a `before_script` to make it work. See \n[Unum](https://github.com/SocialEngine/Unum) repo for example.\n\n```yml\nbefore_script: php ./vendor/bin/phpcs --config-set installed_paths \"`pwd`/vendor/socialengine/sniffer-rules/src/SocialEngine/SnifferRules/Standard/\"\n```\n\n## SocialEngine Coding Standards\n\n### Coding standards\n\n* [PSR 2 Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)\n* [PSR 1 Coding Standards](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)\n* [PSR 0 Coding Standards](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)\n\n#### Addendum and Clarifications\n\n* `namespace` should be on the same line as opening php tag. e.g.: `\u003c?php namespace SocialEngine\\Amazing`\n* Property names should be camelCase\n* Test names should use underscores, not camelCase. e.g.: `test_cats_love_catnip`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialengine%2Fsniffer-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocialengine%2Fsniffer-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialengine%2Fsniffer-rules/lists"}