Skip to content

Commit

Permalink
Updated project structure and CS
Browse files Browse the repository at this point in the history
  • Loading branch information
benatespina committed Oct 12, 2015
1 parent 267132f commit 3954cac
Show file tree
Hide file tree
Showing 30 changed files with 600 additions and 338 deletions.
12 changes: 0 additions & 12 deletions .coveralls.yml

This file was deleted.

19 changes: 11 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
; This file belongs to Kreta.
; The source code of application includes a LICENSE file
; with all information about license.
; This file is part of the Kreta package.
;
; @author benatespina <benatespina@gmail.com>
; @author gorkalaucirica <gorka.lauzirika@gmail.com>
; (c) Beñat Espiña <benatespina@gmail.com>
; (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
;
; For the full copyright and license information, please view the LICENSE
; file that was distributed with this source code.

; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
end_of_line = LF

[*.php]
[{*.php, *.yml}]
indent_style = space
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4
23 changes: 23 additions & 0 deletions .formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is part of the Kreta package.
#
# (c) Beñat Espiña <benatespina@gmail.com>
# (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.

use-sort:
group-type: each
sort-type: alph
sort-direction: asc

header: |
/*
* This file is part of the Kreta package.
*
* (c) Beñat Espiña <benatespina@gmail.com>
* (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
24 changes: 8 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
# This file belongs to Kreta.
# The source code of application includes a LICENSE file
# with all information about license.
# This file is part of the Kreta package.
#
# @author benatespina <benatespina@gmail.com>
# @author gorkalaucirica <gorka.lauzirika@gmail.com>

#### Generic ####
src/
vendor/
bin/
# (c) Beñat Espiña <benatespina@gmail.com>
# (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.

#### Composer ####
/composer.phar
composer.lock

#### PHPSpec ####
/coverage
coverage.xml
composer.phar
vendor
37 changes: 37 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/*
* This file is part of the Kreta package.
*
* (c) Beñat Espiña <benatespina@gmail.com>
* (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


$finder = Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__ . '/src')
->notName('*.yml')
->notName('*.xml')
->notName('*Spec.php');

return Symfony\CS\Config\Config::create()
->finder($finder)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'-unalign_double_arrow',
'-concat_without_spaces',
'align_double_arrow',
'concat_with_spaces',
'multiline_spaces_before_semicolon',
'newline_after_open_tag',
'ordered_use',
'php4_constructor',
'phpdoc_order',
'short_array_syntax',
'short_echo_tag',
'strict',
'strict_param'
]);
35 changes: 35 additions & 0 deletions .phpspec_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/*
* This file is part of the Kreta package.
*
* (c) Beñat Espiña <benatespina@gmail.com>
* (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$finder = Symfony\Component\Finder\Finder::create()
->in(__DIR__ . '/spec')
->name('*Spec.php');

return Symfony\CS\Config\Config::create()
->finder($finder)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'-visibility',
'-unalign_double_arrow',
'-concat_without_spaces',
'align_double_arrow',
'concat_with_spaces',
'multiline_spaces_before_semicolon',
'newline_after_open_tag',
'ordered_use',
'php4_constructor',
'phpdoc_order',
'short_array_syntax',
'short_echo_tag',
'strict',
'strict_param'
]);
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# This file belongs to Kreta.
# The source code of application includes a LICENSE file
# with all information about license.
# This file is part of the Kreta package.
#
# @author benatespina <benatespina@gmail.com>
# @author gorkalaucirica <gorka.lauzirika@gmail.com>
# (c) Beñat Espiña <benatespina@gmail.com>
# (c) Gorka Laucirica <gorka.lauzirika@gmail.com>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.

sudo: false

language: php

Expand All @@ -21,10 +24,7 @@ install:
- composer update --no-interaction ${COMPOSER_OPTIONS}

script:
- bin/phpspec run -fpretty

after_script:
- bin/coveralls -v
- vendor/bin/phpspec run -fpretty

cache:
directories:
Expand Down
4 changes: 1 addition & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
License

The MIT License (MIT)

Copyright (c) 2015 Kreta Simple ApiDoc Bundle - by gorkalaucirica and benatespina
Copyright (c) 2014, 2015 Kreta - by gorkalaucirica and benatespina

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
76 changes: 42 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,65 @@
# Kreta Simple Api Doc Bundle
> Bundle that generates Api documentation on top of **[NelmioApiDocBundle][0]**.
#Kreta Simple Api Doc Bundle
>Bundle that generates Api documentation on top of **[NelmioApiDocBundle][0]**.
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/87e637fa-3e4e-47d1-8b27-fd5fe65e8def/mini.png)](https://insight.sensiolabs.com/projects/87e637fa-3e4e-47d1-8b27-fd5fe65e8def)
[![Build Status](https://travis-ci.org/kreta/SimpleApiDocBundle.svg?branch=master)](https://travis-ci.org/kreta/SimpleApiDocBundle)
[![Coverage Status](https://img.shields.io/coveralls/kreta/SimpleApiDocBundle.svg)](https://coveralls.io/r/kreta/SimpleApiDocBundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kreta/SimpleApiDocBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kreta/SimpleApiDocBundle/?branch=master)
[![HHVM Status](http://hhvm.h4cc.de/badge/kreta/simple-api-doc-bundle.svg)](http://hhvm.h4cc.de/package/kreta/simple-api-doc-bundle)
[![Total Downloads](https://poser.pugx.org/kreta/simple-api-doc-bundle/downloads)](https://packagist.org/packages/kreta/simple-api-doc-bundle)

[![Latest Stable Version](https://poser.pugx.org/kreta/simple-api-doc-bundle/v/stable.svg)](https://packagist.org/packages/kreta/simple-api-doc-bundle)
[![Latest Unstable Version](https://poser.pugx.org/kreta/simple-api-doc-bundle/v/unstable.svg)](https://packagist.org/packages/kreta/simple-api-doc-bundle)

Tests
-----

##Tests
This bundle is completely tested by **[PHPSpec][1], SpecBDD framework for PHP**.

Because you want to contribute or simply because you want to throw the tests, you have to type the following command
in your terminal.
```
$ vendor/bin/phpspec run -fpretty
```
##Contributing
This bundle follows PHP coding standards, so pull requests need to execute the Fabien Potencier's [PHP-CS-Fixer][5]
and Marc Morera's [PHP-Formatter][6]. Furthermore, if the PR creates some not-PHP file remember that you have to put
the license header manually.
```
$ vendor/bin/php-cs-fixer fix
$ vendor/bin/php-cs-fixer fix --config-file .phpspec_cs
$ bin/phpspec run -fpretty
$ vendor/bin/php-formatter formatter:use:sort src/
$ vendor/bin/php-formatter formatter:use:sort spec/
$ vendor/bin/php-formatter formatter:header:fix src/
$ vendor/bin/php-formatter formatter:header:fix spec/
```

>*Depends the location of the `bin` directory (sometimes in the root dir; sometimes in the `/vendor` dir) the way that
works every time is to use the absolute path of the binary `vendor/phpspec/phpspec/bin/phpspec`*
There is also a policy for contributing to this project. Pull requests must be explained step by step to make the
review process easy in order to accept and merge them. New methods or code improvements must come paired with
[PHPSpec][1] tests.

Contributing
------------
If you would like to contribute it is a good point to follow Symfony contribution standards, so please read the
[Contributing Code][2] in the project documentation. If you are submitting a pull request, please follow the guidelines
in the [Submitting a Patch][3] section and use the [Pull Request Template][4].

This bundle follows PHP coding standards, so pull requests must pass PHP Code Sniffer and PHP Mess Detector
checks. In the root directory of this project you have the **custom rulesets** ([ruleset.xml]() for PHPCS and
[phpmd.xml]() for PHPMD).
If you have any doubt or maybe you want to share some opinion, you can use our **Gitter chat**.
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kreta/kreta?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

There is also a policy for contributing to this project. Pull requests must
be explained step by step to make the review process easy in order to
accept and merge them. New methods or code improvements must come paired with [PHPSpec][1] tests.
##To do
[]: Unit tests of [ValidationParser][7] class.
[]: Unit tests of [ApiDocExtractor][8] class.

If you would like to contribute it is a good point to follow Symfony contribution standards,
so please read the [Contributing Code][2] in the project
documentation. If you are submitting a pull request, please follow the guidelines
in the [Submitting a Patch][3] section and use the [Pull Request Template][4].
##Credits
Kreta is created by:
>
**@benatespina** - [benatespina@gmail.com](mailto:benatespina@gmail.com)<br>
**@gorkalaucirica** - [gorka.lauzirika@gmail.com](mailto:gorka.lauzirika@gmail.com)

##Licensing Options
[![License](https://poser.pugx.org/kreta/simple-api-doc-bundle/license.svg)](https://github.com/kreta/SimpleApiDocBundle/blob/master/LICENSE)

[0]: https://github.com/nelmio/NelmioApiDocBundle
[1]: http://www.phpspec.net/
[2]: http://symfony.com/doc/current/contributing/code/index.html
[3]: http://symfony.com/doc/current/contributing/code/patches.html#check-list
[4]: http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[5]: http://cs.sensiolabs.org/
[6]: https://github.com/mmoreram/php-formatter

Credits
-------
Kreta Simple Api Doc Bundle is created by:
>
**@benatespina** - [benatespina@gmail.com](mailto:benatespina@gmail.com)<br/>
**@gorkalaucirica** - [gorka.lauzirika@gmail.com](mailto:gorka.lauzirika@gmail.com)

Licensing Options
-----------------
[![License](https://poser.pugx.org/kreta/simple-api-doc-bundle/license.svg)](https://github.com/kreta/SimpleApiDocBundle/blob/master/LICENSE)
[7]: https://github.com/kreta/SimpleApiDocBundle/blob/master/src/Parser/ValidationParser.php
[8]: https://github.com/kreta/SimpleApiDocBundle/blob/master/src/Extractor/ApiDocExtractor.php
11 changes: 0 additions & 11 deletions Resources/config/routing.yml

This file was deleted.

26 changes: 8 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,19 @@
}
],
"require": {
"php": ">=5.4",
"nelmio/api-doc-bundle": "~2.8"
"php": ">=5.4",

"nelmio/api-doc-bundle": "^2.8"
},
"require-dev": {
"phpspec/phpspec": "~2.2",
"henrikbjorn/phpspec-code-coverage": "~1.0",
"satooshi/php-coveralls": "~0.6,>=0.6.2",
"squizlabs/php_codesniffer": "~1.0",
"phpmd/phpmd": "~2.1"
"fabpot/php-cs-fixer": "^1.10",
"mmoreram/php-formatter": "^1.0",
"phpspec/phpspec": "^2.3"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/kreta/php-coveralls"
}
],
"autoload": {
"psr-4": { "Kreta\\SimpleApiDocBundle\\": "" }
"psr-4": { "Kreta\\SimpleApiDocBundle\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Kreta\\SimpleApiDocBundle\\spec\\": "spec/" }
},
"config": {
"bin-dir": "bin"
"psr-4": { "spec\\Kreta\\SimpleApiDocBundle\\": "spec/" }
}
}
41 changes: 0 additions & 41 deletions phpmd.xml

This file was deleted.

Loading

0 comments on commit 3954cac

Please sign in to comment.