-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored logic and cleanup repo skel
- Loading branch information
1 parent
42841b9
commit c0058d7
Showing
22 changed files
with
282 additions
and
235 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
root = true | ||
|
||
[*] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the `src-run/augustus-serializer-library` project. | ||
* | ||
* (c) Rob Frawley 2nd <rmf@src.run> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use SLLH\StyleCIBridge\ConfigBridge; | ||
|
||
require_once __DIR__.'/vendor/autoload.php'; | ||
|
||
$headerString = <<<EOF | ||
This file is part of the `src-run/augustus-serializer-library` project. | ||
(c) Rob Frawley 2nd <rmf@src.run> | ||
For the full copyright and license information, please view the LICENSE.md | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
$headerConfig = [ 'header_comment' => [ 'header' => $headerString ] ]; | ||
|
||
$config = ConfigBridge::create(); | ||
$config->setRules(array_merge($config->getRules(), $headerConfig)); | ||
|
||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
|
||
preset: symfony | ||
|
||
enabled: | ||
- combine_consecutive_unsets | ||
- linebreak_after_opening_tag | ||
- no_short_echo_tag | ||
- ordered_imports | ||
- phpdoc_order | ||
- php_unit_construct | ||
- php_unit_dedicate_assert | ||
- php_unit_strict | ||
- short_array_syntax | ||
|
||
disabled: | ||
- simplified_null_return | ||
|
||
finder: | ||
exclude: | ||
- 'vendor' | ||
- 'var' | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,90 @@ | ||
|
||
# Contributing | ||
|
||
Looking to contribute a pull-request back to a **Source Consulting** | ||
project? Great! Before sending a pull-request, ensure the following | ||
requirements (__A__, __B__, and __C__) described below are properly met. | ||
This will ensure your contribution is merged smoothly and quickly. | ||
Made some local modifications that might benefit upstream and have a | ||
motivation to contribute back to this project? Great! Before opening a | ||
PR (pull request), though, be sure the code style requirements standards | ||
described in this file have been met. This will expedite your PR and | ||
ensure a seamless experience in pushing your code back upstream. | ||
|
||
## A. Code Style | ||
|
||
All projects in the `SR` namespace adhere to strict code-style | ||
requirements. The expected style is guaranteed through use of the | ||
excellent auto-code-styling project | ||
All projects must adhere to strict code style requirements. Ensuring | ||
your PR meets these requirements is now easier than ever thanks to | ||
the excellent code styling auto-correcting CLI tool | ||
[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). | ||
|
||
### Download Fixer | ||
### Get Development Deps | ||
|
||
__A.__ To download *PHP CS Fixer* using *curl*: | ||
You no longer have to download PHP CS Fixer yourself or have it pre- | ||
installed globally on your system. Instead, it's a composer development | ||
dependency. If you don't already have the development dependencies | ||
installed, simply run (assuming you have composer installed globally on | ||
your system): | ||
|
||
```bash | ||
curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer | ||
composer install --dev | ||
``` | ||
|
||
__B.__ If *curl* is unavailable, download using *wget*: | ||
|
||
```bash | ||
wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer | ||
``` | ||
### Run PHP CS Fixer | ||
|
||
### Install Fixer | ||
|
||
It is recommended to install *PHP-CS-Fixer* at a system-level, making it | ||
available within your normal `PATH` environment variable (allowing you | ||
to call `php-cs-fixer` from any location). After downloading: | ||
Thanks to the recently added `.styleci.yml` (a style rule-set config | ||
files) and `.php_cs.dist` (a php-cs-fixer bridge to read `.styleci.yml` | ||
for its config) you do not have to provide any configuration parameters | ||
to PHP CS Fixer. Simply enter the repository root and run: | ||
|
||
```bash | ||
sudo chmod a+x php-cs-fixer | ||
sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer | ||
bin/php-cs-fixer fix ./ | ||
``` | ||
|
||
### Run Fixer | ||
|
||
When running *PHP CS Fixer*, there are a collection of "rules" that can | ||
be passed via the --rules command-line option. Rules are also grouped | ||
into "rule collections" that are prefixed by an "@" (at symbol). To | ||
disable a rule, it should be prefixed by an "-" (minus sign). | ||
|
||
*PHP CS Fixer* must be configured and run with the following rules: | ||
- `@Symfony` | ||
- `-simplified_null_return` | ||
This ensures all code style rules are implemented and auto corrects any | ||
inconsistencies. It also forcibly sets the PHP file-level doc-blocks, | ||
which may remove any attributes you set if they were in the file-level | ||
php doc-block. Don't fret: the next section describes acceptable | ||
attribution methods (if you require such). | ||
|
||
For example, to fix code within the `lib` directory of the current path: | ||
## B. Attribution | ||
|
||
```bash | ||
php-cs-fixer fix lib/ --rules=@Symfony,-simplified_null_return | ||
``` | ||
|
||
## B. New Files | ||
|
||
Every file must contain a file-level "doc-block" following the below | ||
template. The placeholder `PACKAGE_NAME` must match the | ||
[Packagist](https://packagist.org/) project name for the respective file. | ||
Attribution for yourself is 100% optional, but in some cases people | ||
prefer an explicit doc-block `@author` attribution for all classes or | ||
methods they wrote entirely themselves. If this is the case, the only | ||
acceptable places to add attribution tags is in a *class doc-block* or | ||
a *method doc-block*. The below example show how to implement atribution | ||
for both these cases. | ||
|
||
```php | ||
/* | ||
* This file is part of the `PACKAGE_NAME` project. | ||
* | ||
* (c) Rob Frawley 2nd <rmf@src.run> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.md | ||
* file that was distributed with this source code. | ||
/** | ||
* ... | ||
* File-level doc-block goes here automatically... | ||
* ... | ||
*/ | ||
``` | ||
|
||
An "end of file" comment followed by an empty new line, must be present | ||
at the end of all files. | ||
|
||
```php | ||
/* EOF */ | ||
|
||
``` | ||
|
||
## C. Attribution | ||
|
||
Sometimes completely new classes are written by a contributor. When | ||
this is the case, *the contributor __may__ choose (at their discretion)*, | ||
to use a class-level "doc-block" to provide attribution using the | ||
following template. | ||
|
||
```php | ||
/** | ||
* Class ReallyCoolContributedClass. | ||
* A description of the purpose of this class. | ||
* | ||
* @author CONTRIBUTOR_NAME <CONTRIBUTOR_EMAIL> | ||
*/ | ||
class ReallyCoolContributedClass | ||
{ | ||
// ... | ||
|
||
/** | ||
* A description of the purpose of this method. | ||
* | ||
* @author CONTRIBUTOR_NAME <CONTRIBUTOR_EMAIL> | ||
*/ | ||
public function myWonderfulMethod() | ||
{ | ||
// ... | ||
} | ||
|
||
// ... | ||
} | ||
``` | ||
|
||
## C. Submit PR | ||
|
||
After completing the above requirements (items **A.** and **B.**) your | ||
code is primed and ready to be accepted upstream. Go ahead and open a | ||
PR: we appreciate your time and contribution to this project, however | ||
small or large! |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,60 @@ | ||
{ | ||
"name" : "src-run/augustus-serializer-library", | ||
"license" : "MIT", | ||
"type" : "library", | ||
"homepage" : "https://src.run/augustus-serializer-library", | ||
"description" : "simple abstraction on serialize functions with support for php- json- and igbinary-based serialization", | ||
"support" : { | ||
"email" : "rmf@src.run", | ||
"issues" : "https://src.run/augustus-serializer-library/issues", | ||
"source" : "https://src.run/augustus-serializer-library/git" | ||
"name": "src-run/augustus-serializer-library", | ||
"license": "MIT", | ||
"type": "library", | ||
"homepage": "https://src.run/augustus-serializer-library", | ||
"description": "Basic serialize implementations supporting for php, json, and igbinary serializer.", | ||
"support": { | ||
"email": "rmf@src.run", | ||
"issues": "https://src.run/augustus-serializer-library/issues", | ||
"source": "https://src.run/augustus-serializer-library/git" | ||
}, | ||
"keywords" : [ | ||
"keywords": [ | ||
"augustus-serializer-library", "augustus", "serializer", "library", "rmf", "src-run" | ||
], | ||
"authors" : [ | ||
"authors": [ | ||
{ | ||
"name" : "Rob Frawley 2nd", | ||
"email" : "rmf@src.run", | ||
"name": "Rob Frawley 2nd", | ||
"email": "rmf@src.run", | ||
"homepage": "https://src.run/rmf", | ||
"role" : "Project Lead" | ||
"role": "Project Lead" | ||
} | ||
], | ||
"require" : { | ||
"php" : "^5.6||^7.0", | ||
"src-run/augustus-exception-library" : "^0.6" | ||
"require": { | ||
"php": "~7.0", | ||
"src-run/augustus-utility-library": "~0.7" | ||
}, | ||
"require-dev" : { | ||
"phpunit/phpunit" : "^5.0", | ||
"codacy/coverage" : "^1.0", | ||
"satooshi/php-coveralls" : "^1.0" | ||
"require-dev": { | ||
"codacy/coverage": "~1.0", | ||
"ext-igbinary": "*", | ||
"friendsofphp/php-cs-fixer": "v2.0.0-alpha", | ||
"phpunit/phpunit": "~5.4", | ||
"satooshi/php-coveralls": "~1.0", | ||
"sllh/php-cs-fixer-styleci-bridge": "~2.1", | ||
"symfony/phpunit-bridge": "~3.0" | ||
}, | ||
"autoload" : { | ||
"psr-4" : { | ||
"SR\\Serializer\\" : "lib/" | ||
"suggest": { | ||
"ext-igbinary": "Require to use igbinary serializer implementation." | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"SR\\Serializer\\": "lib/" | ||
} | ||
}, | ||
"autoload-dev" : { | ||
"psr-4" : { | ||
"SR\\Serializer\\Tests\\" : "tests/" | ||
"autoload-dev": { | ||
"psr-4": { | ||
"SR\\Serializer\\Tests\\": "tests/" | ||
} | ||
}, | ||
"minimum-stability" : "dev", | ||
"prefer-stable" : true, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"config": { | ||
"bin-dir" : "bin" | ||
"bin-dir": "bin", | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master" : "0.6-dev" | ||
"dev-master": "0.7-dev" | ||
} | ||
} | ||
} |
Oops, something went wrong.