Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update monolog and collect package to resolved dependencies conflicts #30

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .phpunit.result.cache

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"require": {
"php": ">=7.1.0",
"php-di/php-di": "^6.0.0",
"rareloop/router": "^4.4.0",
"rareloop/router": "^6.0",
"psr/container": "^1.0",
"psr/http-message": "^1.0",
"psr/http-server-middleware": "^1.0",
"blast/facades": "^1.0",
"timber/timber": "^1.7",
"monolog/monolog": "^1.23",
"timber/timber": "^1.19",
"monolog/monolog": "^2.3",
"http-interop/response-sender": "^1.0",
"symfony/debug": "^4.1",
"tightenco/collect": "^5.6.0",
"tightenco/collect": "^8.34",
"statamic/stringy": "~3.1.0",
"laminas/laminas-diactoros": "^2.4",
"laminas/laminas-diactoros": "^2.8",
"rareloop/psr7-server-request-extension": "^2.1.0",
"mmeyer2k/dcrypt": "^8.0.1",
"spatie/macroable": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer">
>
<testsuites>
<testsuite name="Rareloop Router Test Suite">
<directory>tests</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrappers/RegisterExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Rareloop\Lumberjack\Exceptions\HandlerInterface;
use Rareloop\Router\Responsable;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Zend\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\ServerRequestFactory;
use function Http\Response\send;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Rareloop\Lumberjack\Facades\Config;
use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler;
use Symfony\Component\Debug\Exception\FlattenException;
use Zend\Diactoros\Response\HtmlResponse;
use Laminas\Diactoros\Response\HtmlResponse;

class Handler implements HandlerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Responses/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Rareloop\Lumberjack\Http\Responses;

use Rareloop\Lumberjack\Helpers;
use Zend\Diactoros\Response\RedirectResponse as DiactorosRedirectResponse;
use Laminas\Diactoros\Response\RedirectResponse as DiactorosRedirectResponse;

class RedirectResponse extends DiactorosRedirectResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Responses/TimberResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rareloop\Lumberjack\Contracts\Arrayable;
use Rareloop\Lumberjack\Exceptions\TwigTemplateNotFoundException;
use Timber\Timber;
use Zend\Diactoros\Response\HtmlResponse;
use Laminas\Diactoros\Response\HtmlResponse;

class TimberResponse extends HtmlResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Rareloop\Psr7ServerRequestExtension\InteractsWithInput;
use Rareloop\Psr7ServerRequestExtension\InteractsWithUri;
use Zend\Diactoros\ServerRequest as DiactorosServerRequest;
use Laminas\Diactoros\ServerRequest as DiactorosServerRequest;

class ServerRequest extends DiactorosServerRequest
{
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/RouterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Rareloop\Lumberjack\Http\Router;
use Rareloop\Lumberjack\Http\ServerRequest;
use Rareloop\Router\MiddlewareResolver as MiddlewareResolverInterface;
use Zend\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\ServerRequestFactory;

class RouterServiceProvider extends ServiceProvider
{
Expand Down
4 changes: 2 additions & 2 deletions src/Providers/WordPressControllersServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Rareloop\Router\ResponseFactory;
use Stringy\Stringy;
use Tightenco\Collect\Support\Collection;
use Zend\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\ServerRequestFactory;
use mindplay\middleman\Dispatcher;

class WordPressControllersServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -85,7 +85,7 @@ public function handleRequest(RequestInterface $request, $controllerName, $metho
$middlewares[] = function ($request) use ($controller, $methodName) {
$invoker = new Invoker($this->app);
$output = $invoker->setRequest($request)->call([$controller, $methodName]);
return ResponseFactory::create($output, $request);
return ResponseFactory::create($request, $output);
};

$dispatcher = $this->createDispatcher($middlewares);
Expand Down
26 changes: 18 additions & 8 deletions tests/Unit/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class ApplicationTest extends TestCase
{
use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;

public function setUp()
protected function setUp(): void
{
Monkey\setUp();
parent::setUp();
}

public function tearDown()
protected function tearDown(): void
{
Monkey\tearDown();
Mock::disableAll();
Expand Down Expand Up @@ -593,7 +593,9 @@ class TestInterfaceImplementation implements TestInterface

class TestInterfaceImplementationWithConstructorParams implements TestInterface
{
public function __construct(TestServiceProvider $provider) {}
public function __construct(TestServiceProvider $provider)
{
}
}

interface TestSubInterface
Expand All @@ -608,8 +610,12 @@ class TestSubInterfaceImplementation implements TestSubInterface

class TestServiceProvider extends ServiceProvider
{
public function register() {}
public function boot() {}
public function register()
{
}
public function boot()
{
}
}

class EmptyServiceProvider extends ServiceProvider
Expand All @@ -621,15 +627,19 @@ class TestBootServiceProvider extends ServiceProvider
{
private $bootCallback;

public function register() {}
public function register()
{
}

public function boot(Application $app, TestInterface $test) {
public function boot(Application $app, TestInterface $test)
{
if (isset($this->bootCallback)) {
call_user_func($this->bootCallback, func_get_args());
}
}

public function addBootCallback(\Closure $callback) {
public function addBootCallback(\Closure $callback)
{
$this->bootCallback = $callback;
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Bootstrappers/RegisterExceptionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\Responsable;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Zend\Diactoros\Response;
use Zend\Diactoros\Response\TextResponse;
use Zend\Diactoros\ServerRequest;
use Laminas\Diactoros\Response;
use Laminas\Diactoros\Response\TextResponse;
use Laminas\Diactoros\ServerRequest;

/**
* @runTestsInSeparateProcesses
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/BrainMonkeyPHPUnitIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ trait BrainMonkeyPHPUnitIntegration
{
use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;

public function setUp()
protected function setUp(): void
{
parent::setUp();
Monkey\setUp();
}

public function tearDown()
protected function tearDown(): void
{
parent::tearDown();
Monkey\tearDown();
Expand Down
8 changes: 5 additions & 3 deletions tests/Unit/Exceptions/HandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Exceptions\Handler;
use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\ServerRequest;
use Laminas\Diactoros\Response\HtmlResponse;
use Laminas\Diactoros\ServerRequest;

class HandlerTest extends TestCase
{
Expand Down Expand Up @@ -124,4 +124,6 @@ class HandlerWithBlacklist extends Handler
];
}

class BlacklistedException extends \Exception {}
class BlacklistedException extends \Exception
{
}
2 changes: 1 addition & 1 deletion tests/Unit/GlobalFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class GlobalFunctionsTest extends TestCase
{
use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;

public function setUp()
protected function setUp(): void
{
include_once(__DIR__ . '/../../src/functions.php');

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Http/ServerRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Rareloop\Lumberjack\Http\ServerRequest;
use Rareloop\Psr7ServerRequestExtension\InteractsWithInput;
use Rareloop\Psr7ServerRequestExtension\InteractsWithUri;
use Zend\Diactoros\ServerRequest as DiactorosServerRequest;
use Laminas\Diactoros\ServerRequest as DiactorosServerRequest;

class ServerRequestTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/PostQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PostQueryBuilderTest extends TestCase
{
use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;

public function setUp()
protected function setUp(): void
{
$this->app = new Application;
$this->app->bind(QueryBuilderContract::class, QueryBuilder::class);
Expand Down
14 changes: 8 additions & 6 deletions tests/Unit/Providers/RouterServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
use Rareloop\Lumberjack\Providers\RouterServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\MiddlewareResolver;
use Zend\Diactoros\Request;
use Zend\Diactoros\Response\HtmlResponse;
use Zend\Diactoros\Response\TextResponse;
use Zend\Diactoros\ServerRequest;
use Laminas\Diactoros\Request;
use Laminas\Diactoros\Response\HtmlResponse;
use Laminas\Diactoros\Response\TextResponse;
use Laminas\Diactoros\ServerRequest;

class RouterServiceProviderTest extends TestCase
{
Expand Down Expand Up @@ -79,7 +79,8 @@ public function configured_router_can_resolve_middleware_aliases()
$store->set('middleware-key', new RSPAddHeaderMiddleware('X-Key', 'abc'));
$request = new ServerRequest([], [], '/test/123', 'GET');

$router->get('/test/123', function () {})->middleware('middleware-key');
$router->get('/test/123', function () {
})->middleware('middleware-key');
$response = $router->match($request);

$this->assertTrue($response->hasHeader('X-Key'));
Expand Down Expand Up @@ -274,7 +275,8 @@ public function unmatched_request_will_not_mark_request_handled_in_app()
$this->assertFalse($app->hasRequestBeenHandled());
}

private function setSiteUrl($url) {
private function setSiteUrl($url)
{
Functions\when('get_bloginfo')->alias(function ($key) use ($url) {
if ($key === 'url') {
return $url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use Rareloop\Lumberjack\Providers\WordPressControllersServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\Responsable;
use Zend\Diactoros\Response\TextResponse;
use Zend\Diactoros\ServerRequest;
use Laminas\Diactoros\Response\TextResponse;
use Laminas\Diactoros\ServerRequest;
use \Mockery;

class WordPressControllersServiceProviderTest extends TestCase
Expand Down Expand Up @@ -343,28 +343,24 @@ class TestController
{
public function handle()
{

}
}

class TestControllerWithConstructorParams
{
public function __construct(Application $app)
{

}

public function handle()
{

}
}

class TestControllerWithHandleParams
{
public function handle(Application $app)
{

}
}

Expand All @@ -388,7 +384,6 @@ class TestControllerWithMiddleware extends Controller
{
public function handle()
{

}
}

Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/ScopedQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ScopedQueryBuilderTest extends TestCase
{
use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;

public function setUp()
protected function setUp(): void
{
$this->app = new Application;
$this->app->bind(QueryBuilderContract::class, QueryBuilder::class);
Expand Down Expand Up @@ -173,4 +173,3 @@ public function scopeWithout($query, $id1, $id2)
return $query->whereIdNotIn([$id1, $id2]);
}
}

2 changes: 1 addition & 1 deletion tests/Unit/Session/FileSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class FileSessionHandlerTest extends TestCase

private $rootFileSystem;

public function setUp()
protected function setUp(): void
{
$this->rootFileSystem = vfsStream::setup('exampleDir');
}
Expand Down