-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from koriym/clean
Clean the code
- Loading branch information
Showing
16 changed files
with
149 additions
and
119 deletions.
There are no files selected for viewing
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,15 +1,17 @@ | ||
sudo: false | ||
language: php | ||
php: | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
- 7 | ||
sudo: false | ||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
before_script: | ||
- composer self-update | ||
- composer install | ||
script: | ||
- phpunit --coverage-clover=coverage.clover | ||
- phpunit | ||
after_script: | ||
- wget https://scrutinizer-ci.com/ocular.phar | ||
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover | ||
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi |
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,23 +1,21 @@ | ||
Copyright (c) 2012-2016, Akihito Koriyama <[email protected]> | ||
All rights reserved. | ||
The MIT License (MIT) | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
Copyright (c) 2012-2016 Akihito Koriyama | ||
|
||
- Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
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: | ||
|
||
- Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
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. |
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,24 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<ruleset> | ||
<description>The coding standard used for applications using BEAR.Sunday Framework.</description> | ||
<!-- 2. General --> | ||
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/> | ||
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> | ||
<rule ref="Generic.Strings.UnnecessaryStringConcat"/> | ||
<!-- Include the whole PSR-2 standard --> | ||
<rule ref="PSR2"> | ||
<exclude name="Generic.Files.LineLength"/> | ||
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/> | ||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/> | ||
</rule> | ||
<rule ref="PEAR.Commenting.FunctionComment"> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingReturn"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamComment"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeTags"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamTag"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.Missing"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.MissingReturn"/> | ||
<exclude name="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned"/> | ||
<exclude name="PEAR.Commenting.FileComment.Missing"/> | ||
</rule> | ||
<file>src</file> | ||
<file>tests</file> | ||
</ruleset> |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace BEAR\Sunday\Inject; | ||
|
||
use Psr\Log\LoggerInterface; | ||
|
||
class DummyLogger implements LoggerInterface | ||
{ | ||
public function emergency($message, array $context = []) | ||
{ | ||
} | ||
public function alert($message, array $context = []) | ||
{ | ||
} | ||
public function critical($message, array $context = []) | ||
{ | ||
} | ||
public function error($message, array $context = []) | ||
{ | ||
} | ||
public function warning($message, array $context = []) | ||
{ | ||
} | ||
public function notice($message, array $context = []) | ||
{ | ||
} | ||
public function info($message, array $context = []) | ||
{ | ||
} | ||
public function debug($message, array $context = []) | ||
{ | ||
} | ||
public function log($level, $message, array $context = []) | ||
{ | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace BEAR\Sunday\Inject; | ||
|
||
class PsrLoggerApplication | ||
{ | ||
use PsrLoggerInject; | ||
|
||
public function returnDependency() | ||
{ | ||
return $this->logger; | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace BEAR\Sunday\Inject; | ||
|
||
use Ray\Di\AbstractModule; | ||
|
||
class PsrLoggerModule extends AbstractModule | ||
{ | ||
protected function configure() | ||
{ | ||
$this->bind('Psr\Log\LoggerInterface')->to(__NAMESPACE__ . '\DummyLogger'); | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace BEAR\Sunday\Inject; | ||
|
||
class ResourceInjectApplication | ||
{ | ||
use ResourceInject; | ||
|
||
public function returnDependency() | ||
{ | ||
return $this->resource; | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
function http_response_code($int) | ||
{ | ||
FakeHttpResponder::$code = func_get_args(); | ||
unset($int); | ||
} |
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
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,4 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/Fake/Provide/Transfer/header.php'; | ||
require_once __DIR__ . '/Fake/Provide/Transfer/http_response_code.php'; |