Skip to content

Commit

Permalink
Merge pull request #157 from koriym/remove-cache
Browse files Browse the repository at this point in the history
Remove cache
  • Loading branch information
koriym authored Jul 15, 2021
2 parents 1a6cd21 + 58e9b31 commit 8b0fee0
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 407 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@ jobs:
composer require --dev maglnet/composer-require-checker ^3.0
- name: Run composer-require-checker
run: ./vendor/bin/composer-require-checker
run: ./vendor/bin/composer-require-checker --config-file=./composer-require-checker.json

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/coverage.xml
/vendor-bin/**/vendor
/demo/vendor
/.phpunit-cache
18 changes: 18 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"symbol-whitelist" : [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed",
"Doctrine\\Common\\Cache\\ArrayCache", "Doctrine\\Common\\Cache\\Cache"
],
"php-core-extensions" : [
"Core",
"date",
"pcre",
"Phar",
"Reflection",
"SPL",
"standard"
],
"scan-files" : []
}
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"ext-json": "*",
"bear/resource": "^1.15.4",
"doctrine/annotations": "^1.12",
"doctrine/cache": "^1.10",
"psr/log": "^1.1",
"ray/aop": "^2.10.1",
"ray/di": "^2.11"
Expand Down
372 changes: 0 additions & 372 deletions coverage.xml

This file was deleted.

9 changes: 6 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php">
<coverage processUncoveredFiles="true">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php">
<coverage processUncoveredFiles="true" cacheDirectory="./.phpunit-cache">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="all">
<testsuite name="BEAR.Sunday test suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Ray\Di\AbstractModule;
use Ray\Di\Scope;

/**
* @deprecated
*/
class DoctrineCacheModule extends AbstractModule
{
protected function configure(): void
Expand Down
2 changes: 0 additions & 2 deletions src/Module/SundayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace BEAR\Sunday\Module;

use BEAR\Resource\Module\ResourceModule;
use BEAR\Sunday\Module\Cache\DoctrineCacheModule;
use BEAR\Sunday\Provide\Error\ErrorModule;
use BEAR\Sunday\Provide\Router\RouterModule;
use BEAR\Sunday\Provide\Transfer\HttpCacheModule;
Expand All @@ -17,7 +16,6 @@ class SundayModule extends AbstractModule
protected function configure(): void
{
$this->install(new HttpCacheModule());
$this->install(new DoctrineCacheModule());
$this->install(new ResourceModule());
$this->install(new RouterModule());
$this->install(new HttpResponderModule());
Expand Down
10 changes: 5 additions & 5 deletions src/Provide/Transfer/ConditionalResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ public function isModified(ResourceObject $ro, array $server): bool
/**
* {@inheritdoc}
*/
public function getOutput(array $originalHeaders): Output
public function getOutput(array $headers): Output
{
$headers = [];
foreach ($originalHeaders as $label => $value) {
$newHeaders = [];
foreach ($headers as $label => $value) {
if (! in_array($label, self::HEADER_IN_304, true)) {
continue;
}

$headers[$label] = $value;
$newHeaders[$label] = $value;
}

return new Output(304, $headers, '');
return new Output(304, $newHeaders, '');
}
}
18 changes: 0 additions & 18 deletions tests/Module/Cache/DoctrineCacheModuleTest.php

This file was deleted.

5 changes: 0 additions & 5 deletions tests/Module/SundayModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
use BEAR\Sunday\Provide\Router\WebRouter;
use BEAR\Sunday\Provide\Transfer\HttpResponder;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\Cache;
use PHPUnit\Framework\TestCase;
use Ray\Di\AbstractModule;
use Ray\Di\Injector;
Expand Down Expand Up @@ -43,9 +41,6 @@ public function testMinApp(): void

public function testDependModules(): void
{
$cache = $this->injector->getInstance(Cache::class);
$this->assertInstanceOf(ArrayCache::class, $cache);

$reader = $this->injector->getInstance(Reader::class);
$this->assertInstanceOf(Reader::class, $reader);

Expand Down

0 comments on commit 8b0fee0

Please sign in to comment.