Skip to content

Commit

Permalink
Merge pull request #244 from koriym/cs
Browse files Browse the repository at this point in the history
Fix cs
  • Loading branch information
koriym committed Jul 12, 2017
2 parents c407770 + 79be3cc commit d71d192
Show file tree
Hide file tree
Showing 35 changed files with 174 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ return \PhpCsFixer\Config::create()
->setFinder(
PhpCsFixer\Finder::create()
->exclude('tests/Fake')
->in('src')
->exclude('var')
->in(__DIR__)
)->setLineEnding("\n");
26 changes: 0 additions & 26 deletions bin/bear.env

This file was deleted.

6 changes: 5 additions & 1 deletion docs/demo-app/bootstrap/api.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
$context = PHP_SAPI === 'cli' ? 'cli-hal-api-app' : 'prod-hal-api-app';
require __DIR__ . '/bootstrap.php';
5 changes: 5 additions & 0 deletions docs/demo-app/bootstrap/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp;

use BEAR\Package\Bootstrap;
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/bootstrap/web.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
$context = PHP_SAPI === 'cli' ? 'cli-hal-app' : 'hal-app';
require __DIR__ . '/bootstrap.php';
6 changes: 5 additions & 1 deletion docs/demo-app/src/Module/App.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Module;

use BEAR\Sunday\Extension\Application\AbstractApp;
Expand Down
8 changes: 5 additions & 3 deletions docs/demo-app/src/Module/AppModule.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Module;

use BEAR\AppMeta\AppMeta;
use BEAR\Package\PackageModule;
use BEAR\Package\Provide\Router\AuraRouterModule;
use Ray\Di\AbstractModule;

class AppModule extends AbstractModule
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/src/Resource/App/Contact.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Resource\App;

use BEAR\Resource\ResourceObject;
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/src/Resource/App/User.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Resource\App;

use BEAR\RepositoryModule\Annotation\Cacheable;
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/src/Resource/App/User/Friend.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Resource\App\User;

use BEAR\Resource\ResourceObject;
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/src/Resource/App/Website.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Resource\App;

use BEAR\Resource\ResourceObject;
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/src/Resource/Page/Index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Resource\Page;

use BEAR\Resource\ResourceObject;
Expand Down
6 changes: 5 additions & 1 deletion docs/demo-app/src/Resource/Page/User.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace MyVendor\MyApp\Resource\Page;

use BEAR\Resource\Annotation\Embed;
Expand Down
2 changes: 1 addition & 1 deletion src-deprecated/ExceptionAsString.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function detail(\Exception $e, Request $request)
private function getPhpVariables(array $server)
{
if (PHP_SAPI === 'cli') {
// return '';
// return '';
}

return sprintf("\nPHP Variables\n\n\$_SERVER => %s", print_r($server, true)); // @codeCoverageIgnore
Expand Down
1 change: 0 additions & 1 deletion src-deprecated/Provide/Error/VndErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* vnd.error for BEAR.Package
*
* @see https://github.com/blongden/vnd.error
*
* @deprecated
*/
class VndErrorHandler implements ErrorInterface
Expand Down
6 changes: 5 additions & 1 deletion tests/BootstrapTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package;

use BEAR\AppMeta\AppMeta;
Expand All @@ -8,7 +13,6 @@
use BEAR\Sunday\Extension\Application\AppInterface;
use BEAR\Sunday\Provide\Transfer\HttpResponder;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\FilesystemCache;
use Doctrine\Common\Cache\VoidCache;
use FakeVendor\HelloWorld\Module\AppModule;

Expand Down
5 changes: 5 additions & 0 deletions tests/Context/ApiModuleTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Context;

use BEAR\Sunday\Annotation\DefaultSchemeHost;
Expand Down
5 changes: 5 additions & 0 deletions tests/Context/HalModuleTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Context;

use BEAR\Package\Provide\Representation\HalRenderer;
Expand Down
5 changes: 5 additions & 0 deletions tests/Context/ProdModuleTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Context;

use BEAR\AppMeta\AppMeta;
Expand Down
5 changes: 5 additions & 0 deletions tests/NewAppTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package;

use BEAR\AppMeta\AppMeta;
Expand Down
11 changes: 8 additions & 3 deletions tests/Provide/Error/DevStatusTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Error;

use BEAR\Resource\Exception\BadRequestException;
Expand All @@ -23,21 +28,21 @@ public function setUp()
public function testRuntimeException()
{
$e = new \RuntimeException();
$status = new Status($e);
$status = new Status($e);
$this->assertSame(503, $status->code);
}

public function testBadRequest()
{
$e = new BadRequestException;
$status = new Status($e);
$status = new Status($e);
$this->assertSame(400, $status->code);
}

public function testNotFound()
{
$e = new ResourceNotFoundException('/__not_found__');
$status = new Status($e);
$status = new Status($e);
$this->assertSame(404, $status->code);
}
}
11 changes: 7 additions & 4 deletions tests/Provide/Error/DevVndErrorPageTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Error;

use BEAR\Sunday\Extension\Router\RouterMatch;
Expand All @@ -25,13 +30,11 @@ public function testToString()
$this->assertSame(500, $this->page->code);
$this->assertArrayHasKey('content-type', $this->page->headers);
$this->assertSame('application/vnd.error+json', $this->page->headers['content-type']);
$this->assertSame('{
$this->assertContains('{
"message": "Internal Server Error",
"logref": "{logref}",
"request": "get /",
"exceptions": "LogicException(bear)",
"file": "' . __FILE__ . '(16)"
}
', $this->page->view);
"file": "' . __FILE__, $this->page->view);
}
}
6 changes: 5 additions & 1 deletion tests/Provide/Error/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Error;

use BEAR\AppMeta\AppMeta;
Expand Down Expand Up @@ -41,7 +46,6 @@ public function testHandle()
*/
public function testTransfer(ErrorHandler $handler)
{

$handler->transfer();
$this->assertSame(500, FakeHttpResponder::$code);
$this->assertSame(['content-type' => 'application/vnd.error+json'], FakeHttpResponder::$headers);
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Error/ErrorPageTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Error;

class ErrorPageTest extends \PHPUnit_Framework_TestCase
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Error/ProdVndErrorPageTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Error;

use BEAR\Sunday\Extension\Router\RouterMatch;
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Logger/PsrLoggerModuleTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package;

use BEAR\AppMeta\AppMeta;
Expand Down
7 changes: 5 additions & 2 deletions tests/Provide/Representation/HalRendererTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package;

use BEAR\Package\Provide\Representation\HalRenderer;
use BEAR\Package\Provide\Router\HttpMethodParams;
use BEAR\Package\Provide\Router\WebRouter;
use BEAR\Resource\ResourceInterface;
use BEAR\Resource\Uri;
use Doctrine\Common\Annotations\AnnotationReader;
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Router/CliRouterTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Router;

use Aura\Cli\CliFactory;
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Router/HttpMethodParamsTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Router;

class HttpMethodParamsTest extends \PHPUnit_Framework_TestCase
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Router/RouterCollectionTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Provide\Router;

use BEAR\Package\FakeWebRouter;
Expand Down
5 changes: 5 additions & 0 deletions tests/Provide/Router/WebRouterTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* This file is part of the BEAR.Package package.
*
* @license http://opensource.org/licenses/MIT MIT
*/
namespace BEAR\Package\Provide\Router;

class WebRouterTest extends \PHPUnit_Framework_TestCase
Expand Down

0 comments on commit d71d192

Please sign in to comment.