Skip to content

Commit

Permalink
Big 💥
Browse files Browse the repository at this point in the history
  • Loading branch information
bmitch committed Jun 10, 2017
0 parents commit acf3696
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
build
composer.lock
docs
vendor
23 changes: 23 additions & 0 deletions .travis.yml
@@ -0,0 +1,23 @@
language: php

php:
- 7.0
- 7.1
- nightly

before_script:
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-source --dev

script:
- vendor/bin/phpcs --standard=psr2 src
- vendor/bin/phpcs --standard=phpcs.xml src tests
- vendor/bin/phpcs --standard=codor.xml src -spn
- vendor/bin/phpunit --debug --coverage-clover=coverage.xml
- vendor/bin/phpmd src text codesize,unusedcode,naming
- vendor/bin/phploc src
- vendor/bin/phpcpd src


after_success:
# - bash <(curl -s https://codecov.io/bash)
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -0,0 +1 @@
# Changelog
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,5 @@
# Contributing #

Please feel free to contribute by reporting bugs, suggesting features etc... by opening an issue.

Also please don't hesitate to send any pull requests. If you do submit a pull request please write tests if you are adding a new feature or fixing a bug. Please be sure that all tests pass by running `composer test`.
9 changes: 9 additions & 0 deletions LICENSE.md
@@ -0,0 +1,9 @@
# The MIT License (MIT)

Copyright 2017 Bill Mitchell

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 changes: 36 additions & 0 deletions README.md
@@ -0,0 +1,36 @@
# Churn
Help discover good candidates for refactoring

[![Build Status](https://travis-ci.org/bmitch/Churn.svg?branch=master)](https://travis-ci.org/bmitch/Churn) [![codecov](https://codecov.io/gh/bmitch/Churn/branch/master/graph/badge.svg)](https://codecov.io/gh/bmitch/Churn) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bmitch/Churn/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/bmitch/Churn/?branch=master) [![Code Climate](https://codeclimate.com/github/bmitch/Churn/badges/gpa.svg)](https://codeclimate.com/github/bmitch/Churn) [![Packagist](https://img.shields.io/packagist/v/bmitch/codor.svg)]() [![Packagist](https://img.shields.io/packagist/l/bmitch/codor.svg)]()
----------

* [What Is it?](#what-is-it)
* [Compatiblity](#compatibility)
* [How to Install?](#how-to-install)
* [How to Use?](#how-to-use)
* [Similar Packages](#similar-packages)
* [Contributing](#contributing)
* [License](#license)

## What is it? ##
## Compatiblity ##

## How to Install? ##

Install via Composer:
```
composer require bmitch/churn --dev
```

## How to Use? ##

## Similar Packages
* https://github.com/object-calisthenics/phpcs-calisthenics-rules
* https://github.com/slevomat/coding-standard

## Contributing ##
Please see [CONTRIBUTING.md](CONTRIBUTING.md)

## License ##

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
6 changes: 6 additions & 0 deletions codor.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Project">
<description>Project Coding Standard</description>

<rule ref="vendor/bmitch/codor/src/Codor/ruleset.xml"/>
</ruleset>
54 changes: 54 additions & 0 deletions composer.json
@@ -0,0 +1,54 @@
{
"name": "bmitch/Churn",
"description": "Discover files in need of refactoring.",
"keywords": [
"bmitch",
"Churn"
],
"homepage": "https://github.com/bmitch/Churn",
"license": "MIT",
"authors": [
{
"name": "Bill Mitchell",
"email": "wkmitch@gmail.com"
}
],
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"phpmd/phpmd": "^2.5",
"phploc/phploc": "^3.0",
"sebastian/phpcpd": "^2.0",
"sensiolabs/security-checker": "^4.0",
"slevomat/coding-standard": "^2.0",
"jakub-onderka/php-console-highlighter": "^0.3.2",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"larapack/dd": "^1.1",
"bmitch/codor": "^1.0"
},
"autoload": {
"psr-4": {
"bmitch\\Churn\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"bmitch\\Churn\\Test\\": "tests"
}
},
"scripts": {
"test": [
"vendor/bin/parallel-lint src tests",
"vendor/bin/phpcs --standard=psr2 src -spn",
"vendor/bin/phpcs --standard=phpcs.xml src -spn",
"vendor/bin/phpcs --standard=codor.xml src -spn",
"vendor/bin/phpunit --debug --coverage-clover=coverage.xml",
"vendor/bin/phpmd src text codesize,unusedcode,naming",
"vendor/bin/phploc src --progress",
"vendor/bin/phpcpd src",
"vendor/bin/phpunit"
]
}
}
Empty file added config/.gitkeep
Empty file.
14 changes: 14 additions & 0 deletions coverage.xml
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1497110796">
<project timestamp="1497110796">
<package name="Churn">
<file name="/home/bmitch/Code/Churn/src/Class.php">
<class name="ClassLengthSniff" namespace="Churn">
<metrics complexity="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</class>
<metrics loc="8" ncloc="8" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</file>
</package>
<metrics files="1" loc="8" ncloc="8" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</project>
</coverage>
33 changes: 33 additions & 0 deletions phpcs.xml
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>My custom coding standard.</description>

<!-- Dock Blocks -->
<rule ref="Squiz.Commenting.FunctionComment" />
<rule ref="Squiz.Commenting.FunctionCommentThrowTag" />
<rule ref="Squiz.Commenting.VariableComment" />

<!-- Forbid some functions -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" value="mysql_fetch_assoc=>null,mysql_query=>null,mysql_connect=>null,dd=>null,die=>null,var_dump=>null,sizeof=>count,delete=>unset,create_function=>null"/>
</properties>
</rule>

<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml">
<exclude name="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<exclude name="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
<exclude name="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces"/>
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators.DisallowedEqualOperator"/>
<exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint"/>
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>
</rule>
</ruleset>
16 changes: 16 additions & 0 deletions phpunit.xml.dist
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
Empty file added src/.gitkeep
Empty file.
8 changes: 8 additions & 0 deletions src/Class.php
@@ -0,0 +1,8 @@
<?php declare(strict_types = 1);

namespace Churn;

class ClassLengthSniff
{

}
14 changes: 14 additions & 0 deletions tests/ExampleTest.php
@@ -0,0 +1,14 @@
<?php declare(strict_types = 1);

namespace Bmitch\Churn\Test;

use PHPUnit\Framework\TestCase;

class ExampleTest extends TestCase
{
/** @test */
public function true_is_true()
{
$this->assertTrue(true);
}
}

0 comments on commit acf3696

Please sign in to comment.