Skip to content

Commit

Permalink
start MultisiteDirectoryResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
anolilab committed Apr 30, 2015
1 parent fdfacb8 commit 9994284
Show file tree
Hide file tree
Showing 14 changed files with 750 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src_dir: src
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* text=auto

/tests export-ignore
/stubs export-ignore
/.php_cs export-ignore
/phpspec.yml export-ignore
/phpspec.hhvm.yml export-ignore
/test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/README.md export-ignore
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.phar
/vendor
/report
/build
composer.phar
composer.lock
.DS_Store
Thumbs.db
40 changes: 40 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->exclude('build')
->exclude('vendor')
->in(__DIR__)
->notName('*.phar')
->notName('LICENSE')
->notName('README.md')
->notName('composer.*')
->notName('phpunit.xml.dist')
->notName('.scrutinizer.yml')
->notName('.travis.yml')
->notName('phpcs.xml')
->notName('coveralls.yml')
->notName('.styleci.yml')
->notName('CONTRIBUTING')
->notName('.php_cs');

if (file_exists(__DIR__.'/local.php_cs')) {
require __DIR__.'/local.php_cs';
}

return Symfony\CS\Config\Config::create()
// use default SYMFONY_LEVEL and extra fixers:
->fixers(
[
'ordered_use',
'short_array_syntax',
'strict',
'strict_param',
'-no_empty_lines_after_phpdocs',
'header_comment',
'newline_after_open_tag',
'phpdoc_order',
'phpdoc_var_to_type',
'-phpdoc_to_comment',
]
)
->finder($finder);
81 changes: 81 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

filter:
paths: ['src/*']
excluded_paths: [tests/*, vendor/*]

checks:
php:
code_rating: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
no_unnecessary_function_call_in_for_loop: true
avoid_unnecessary_concatenation: true
duplication: true
prefer_sapi_constant: true
variable_existence: true
useless_calls: true
use_statement_alias_conflict: true
unused_variables: true
unused_properties: true
unused_parameters: true
unused_methods: true
unreachable_code: true
sql_injection_vulnerabilities: true
security_vulnerabilities: true
precedence_mistakes: true
precedence_in_conditions: true
parameter_non_unique: true
no_property_on_interface: true
no_non_implemented_abstract_methods: true
deprecated_code_usage: true
closure_use_not_conflicting: true
closure_use_modifiable: true
avoid_useless_overridden_methods: true
avoid_conflicting_incrementers: true
assignment_of_null_return: true
verify_access_scope_valid: true
too_many_arguments: true
symfony_request_injection: true
parameter_doc_comments: true
argument_type_checks: true
avoid_corrupting_byteorder_marks: true
avoid_entity_manager_injection: true
catch_class_exists: true
# implicit/excplicit comparation checks
encourage_shallow_comparison: false
foreach_traversable: true
foreach_usable_as_reference: true
instanceof_class_exists: true
method_calls_on_non_object: true
missing_arguments: true
no_duplicate_arguments: true
require_php_tag_first: true
return_doc_comments: true
verify_property_names: true
verify_argument_usable_as_reference: true

tools:
php_code_sniffer:
config:
standard: PSR-2
php_loc:
enabled: true
excluded_dirs: [vendor, test]
php_cpd:
enabled: true
excluded_dirs: [vendor, test]
php_analyzer: true
php_pdepend: true
sensiolabs_security_checker: true
php_mess_detector: true
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
- hhvm-nightly

matrix:
allow_failures:
- php: 7.0
- php: nightly
- php: hhvm
- php: hhvm-nightly
fast_finish: true

sudo: false

before_script:
- composer self-update
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction
- OCULAR_ENV='5.4'

script:
- vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml
- if [ $(phpenv version-name) = $OCULAR_ENV ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

after_script:
- php vendor/bin/coveralls -v
Empty file added CONTRIBUTING.md
Empty file.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## MultisiteDirectoryResolver

## Master

## Contributing

All code contributions - including those of people having commit access -
must go through a pull request and approved by a core developer before being
merged. This is to ensure proper review of all the code.

Fork the project, create a feature branch, and send us a pull request.

To ensure a consistent code base, you should make sure the code follows
the [Coding Standards](http://symfony.com/doc/current/contributing/code/standards.html)
which we borrowed from Symfony.

The easiest way to do make sure you're following the coding standard is to run `vendor/bin/php-cs-fixer fix` before committing.

If you would like to help take a look at the [list of issues](https://github.com/gwa/WpMultisiteDirectoryResolver/issues).

## Requirements

PHP 5.4.0 or above

## Authors

Great White Ark - <[email protected]> - <http://www.greatwhiteark.com><br />

### License

The Narrowspark framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
45 changes: 45 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name" : "MultisiteDirectoryResolver",
"type" : "library",
"description": "",
"keywords" : ["composer", "wordpress", "multisite"],
"license" : "MIT",
"homepage" : "https://github.com/gwa/WpMultisiteDirectoryResolver",
"support" : {
"issues": "https://github.com/gwa/WpMultisiteDirectoryResolver/issues",
"source": "https://github.com/gwa/WpMultisiteDirectoryResolver"
},
"authors" : [
{
"name" : "Great White Ark",
"homepage": "http://www.greatwhiteark.com"
}
],
"require": {
"php" : ">=5.4.0"
},
"require-dev": {
"fabpot/php-cs-fixer" : "~1.7",
"phpunit/phpunit" : "~4.6.6",
"satooshi/php-coveralls" : "~0.6.1"
},
"autoload": {
"psr-4": {
"Gwa\\Wordpress\\" : "src/Gwa"
}
},
"autoload-dev": {
"psr-4": {
"Gwa\\Wordpress\\Tests\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master" : "0.0.3-dev"
}
},
"suggest": {
},
"minimum-stability" : "dev",
"prefer-stable" : true
}
4 changes: 4 additions & 0 deletions phpunit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

require __DIR__.'/vendor/autoload.php';
require __DIR__.'/tests/MockFunc/WpFunc.php';
35 changes: 35 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="phpunit.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
syntaxCheck="true"
verbose="true"
>
<testsuites>
<testsuite name="Gwa MultisiteDirectoryResolver Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<exclude>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-html" target="./report" charset="UTF-8"
yui="true" highlight="true"
lowUpperBound="50" highLowerBound="80" />
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>
Loading

0 comments on commit 9994284

Please sign in to comment.