Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Issue refactor http 264 (#265)
Browse files Browse the repository at this point in the history
* fixes #264 | update composer

* remove symfony http

* remove cache/integration-tests

* remove old http classes

* small updates

* Applied fixes from StyleCI

* small updates

* added OpenSSL

* Added some Http classes

* Applied fixes from StyleCI

* update composer.json

* Added some ne classes

* Applied fixes from StyleCI

* adding hhvm support back | remove all http Exception form contracts

* remove bool from function

* Applied fixes from StyleCI

* Added some new classes | cs fixes

* fix test

* fixed tests

* fixed some funktions names

* fixed some tests

* fixed tests | added new test

* Applied fixes from StyleCI

* Added new tests | adding Uri

* Applied fixes from StyleCI

* Added more

* Applied fixes from StyleCI

* Added more tests and more classes

* Applied fixes from StyleCI

* Added ServerRequest and ServerRequestFactory

* Applied fixes from StyleCI

* Added more streams | update composer.json

* #264

* fixed all namespaces

* Refactoring Uri

* Refactoring Uri

* Refactoring Uri

* Refactoring Uri

* Refactoring Uri

* refactoring uri finish

* fixed all tests

* Scrutinizer Auto-Fixes (#275)

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com

* added type hints and doc fixes

* fix RequestFactory contract

* Added new tests

* fix tests

* Added more tests

* fixed more tests

* fix hhvm

* hhvm fix

* Scrutinizer Auto-Fixes (#276)

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com

* remove string stream
  • Loading branch information
prisis committed Jun 12, 2016
1 parent 9d78124 commit 95dbe3d
Show file tree
Hide file tree
Showing 167 changed files with 9,403 additions and 2,936 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ addons:

matrix:
include:
# Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
- php: hhvm
sudo: required
dist: trusty
group: edge
env: SETUP=basic
- php: 7.0
env: SETUP=basic CHECK_CS=true SEND_COVERAGE=true
- php: 7.0
Expand All @@ -38,16 +44,15 @@ cache:
before_install:
- mkdir -p ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d
- if [ -f build/travis/php/$TRAVIS_PHP_VERSION.sh]; then ./build/travis/php/$TRAVIS_PHP_VERSION.sh; fi
- travis_retry composer self-update # Run allways composer update
- composer global require hirak/prestissimo # Now composer can install components parallel
- if [[ "$HUMBUG" = 'true' ]]; then composer require humbug/humbug; fi
- if [[ "$PHP" != hhvm* ]]; then composer global require hirak/prestissimo; fi # Now composer can install components parallel
- if [[ "$HUMBUG" = "true" ]]; then composer require humbug/humbug; fi
- git config --global user.name travis-ci
- git config --global user.email travis@example.com

install:
- if [[ "$SETUP" = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-dist --no-progress --profile; fi
- if [[ "$SETUP" = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-progress --profile; fi
- if [[ "$SETUP" = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-progress --profile; fi
- if [[ "$SETUP" = "basic" ]]; then travis_retry composer install --no-interaction --prefer-dist --no-progress --profile; fi
- if [[ "$SETUP" = "stable" ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-progress --profile; fi
- if [[ "$SETUP" = "lowest" ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-progress --profile; fi

before_script:
- chmod a+x ./build/travis/all.sh && chmod a+x ./build/travis/php/7.x.sh && chmod a+x ./build/travis/script.sh && chmod a+x ./build/travis/after_success.sh
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ cache:
- .phpunit -> phpunit

init:
- SET PATH=c:\php;%PATH%
- SET PATH=C:\Program Files\OpenSSL;c:\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1
- SET ANSICON=121x90 (121x90)
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f

install:
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
- cinst -y OpenSSL.Light
- cd c:\php
- IF %PHP%==1 appveyor DownloadFile https://raw.githubusercontent.com/symfony/binary-utils/master/cacert.pem
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/php-7.0.7-nts-Win32-VC14-x86.zip
Expand Down
4 changes: 3 additions & 1 deletion build/travis/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ if [[ "$DISABLE_XDEBUG" = true ]]; then
phpenv config-rm xdebug.ini;
fi

if [[ "$PHP" != hhvm* ]]; then
# Doing something with phpenv
phpenv config-add ./build/travis/php/php.ini
phpenv config-add ./build/travis/php/php.ini;
fi
15 changes: 6 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
}
],
"require": {
"php" : "^7.0",
"php" : "^7.0.7",
"ext-curl" : "*",
"ext-openssl" : "*",
"ext-mbstring" : "*",
"ext-fileinfo" : "*",
"cache/adapter-common" : "^0.3.2",
"cache/hierarchical-cache" : "^0.2.1",
"cache/taggable-cache" : "^0.4",
Expand All @@ -45,6 +45,7 @@
"league/flysystem" : "^1.0",
"monolog/monolog" : "^1.17",
"narrowspark/arr" : "^1.0",
"narrowspark/http-status" : "^1.1",
"php-di/invoker" : "^1.2",
"mpoiriert/invoker" : "^1.1",
"nesbot/carbon" : "^1.21",
Expand All @@ -58,15 +59,12 @@
"symfony/console" : "^3.1",
"symfony/debug" : "^3.1",
"symfony/finder" : "^3.1",
"symfony/event-dispatcher" : "^3.1",
"symfony/http-foundation" : "^3.1",
"symfony/http-kernel" : "^3.1",
"symfony/filesystem" : "^3.1",
"symfony/polyfill-intl-icu" : "^1.0",
"symfony/polyfill-mbstring" : "^1.0",
"symfony/var-dumper" : "^3.1",
"swiftmailer/swiftmailer" : "^5.4",
"stack/builder" : "^1.0",
"vlucas/phpdotenv" : "^2.2",
"zendframework/zend-diactoros" : "^1.3"
"vlucas/phpdotenv" : "^2.2"
},
"replace": {
"viserio/cache" : "self.version",
Expand Down Expand Up @@ -103,7 +101,6 @@
},
"require-dev": {
"aws/aws-sdk-php" : "^3.0",
"cache/integration-tests" : "^0.10",
"fzaninotto/faker" : "^1.6",
"helmich/phpunit-psr7-assert" : "^1.0",
"league/flysystem-aws-s3-v3" : "^1.0",
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
<testsuite name="Narrowspark Hashing Component Test Suite">
<directory>./src/Viserio/Hashing/Tests</directory>
</testsuite>
<!-- <testsuite name="Narrowspark Http Component Test Suite">
<testsuite name="Narrowspark Http Component Test Suite">
<directory>./src/Viserio/Http/Tests</directory>
</testsuite>
<testsuite name="Narrowspark Log Component Test Suite">
<!-- <testsuite name="Narrowspark Log Component Test Suite">
<directory>./src/Viserio/Log/Tests</directory>
</testsuite>
<testsuite name="Narrowspark Loop Component Test Suite">
Expand Down
20 changes: 11 additions & 9 deletions src/Viserio/Application/Application.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace Viserio\Application;

use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use SplPriorityQueue;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Viserio\Application\Traits\BootableTrait;
use Viserio\Application\Traits\EnvironmentTrait;
use Viserio\Application\Traits\HttpErrorHandlingTrait;
Expand All @@ -13,9 +13,10 @@
use Viserio\Application\Traits\ServiceProviderTrait;
use Viserio\Container\Container;
use Viserio\Contracts\Application\Foundation;
use Viserio\Http\ServerRequest;
use Viserio\StaticalProxy\StaticalProxy;

class Application extends Container implements Foundation, HttpKernelInterface
class Application extends Container implements Foundation
{
// Register all needed Traits
use BootableTrait;
Expand All @@ -25,6 +26,7 @@ class Application extends Container implements Foundation, HttpKernelInterface
use MiddlewaresTrait;
use PathsTrait;
use ServiceProviderTrait;

/**
* The Viserio framework version.
*
Expand Down Expand Up @@ -224,15 +226,15 @@ public function getVersion(): string
/**
* Run the application.
*
* @param \Symfony\Component\HttpFoundation\Request|null $request
* @param bool $send
* @param \Psr\Http\Message\RequestInterface|null $request
* @param bool $send
*
* @return \Symfony\Component\HttpFoundation\Response
* @return \Psr\Http\Message\ResponseInterface
*/
public function run(SymfonyRequest $request = null, $send = true)
public function run(RequestInterface $request = null, $send = true): ResponseInterface
{
if ($request === null) {
$request = SymfonyRequest::createFromGlobals();
$request = ServerRequest::createFromGlobals();
}

$response = $this->handle($request);
Expand All @@ -243,7 +245,7 @@ public function run(SymfonyRequest $request = null, $send = true)
/**
* {@inheritdoc}
*/
public function handle(SymfonyRequest $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
public function handle(RequestInterface $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
if (! $this->booted) {
$this->boot();
Expand Down
155 changes: 0 additions & 155 deletions src/Viserio/Application/HttpKernel.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ public function testDblibDatabasesMayBeConnectedTo($dsn, $config)
{
$connection = $this->mock('stdClass');

$connector = $this->getMock(
'Viserio\Connect\Adapters\Database\DblibConnector',
['createConnection', 'getOptions']
);
$connector = $this->getMockBuilder('Viserio\Connect\Adapters\Database\DblibConnector')
->setMethods(['createConnection', 'getOptions'])
->getMock();
$connector->expects($this->once())
->method('getOptions')
->with($this->equalTo($config))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ public function testFirebirdDatabasesMayBeNotConnectedTo()
$config = ['server' => 'localhost', 'database' => null, 'username' => '', 'password' => ''];
$connection = $this->mock('stdClass');

$connector = $this->getMock(
'Viserio\Connect\Adapters\Database\FirebirdConnector',
['createConnection', 'getOptions']
);
$connector = $this->getMockBuilder('Viserio\Connect\Adapters\Database\FirebirdConnector')
->setMethods(['createConnection', 'getOptions'])
->getMock();

$this->assertSame($connector->connect($config), $connection);
}
Expand All @@ -59,10 +58,9 @@ public function testFirebirdDatabasesMayBeConnectedTo()
];
$connection = $this->mock('stdClass');

$connector = $this->getMock(
'Viserio\Connect\Adapters\Database\FirebirdConnector',
['createConnection', 'getOptions']
);
$connector = $this->getMockBuilder('Viserio\Connect\Adapters\Database\FirebirdConnector')
->setMethods(['createConnection', 'getOptions'])
->getMock();
$connector->expects($this->once())
->method('getOptions')
->with($this->equalTo($config))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ public function testConnect()
$config = ['server' => 'foo', 'database' => 'bar', 'charset' => 'utf8'];
$connection = $this->mock('stdClass');

$connector = $this->getMock(
'Viserio\Connect\Adapters\Database\GoogleCloudSQLConnector',
['createConnection', 'getOptions']
);
$connector = $this->getMockBuilder('Viserio\Connect\Adapters\Database\GoogleCloudSQLConnector')
->setMethods(['createConnection', 'getOptions'])
->getMock();
$connector->expects($this->once())
->method('getOptions')
->with($this->equalTo($config))
Expand Down

0 comments on commit 95dbe3d

Please sign in to comment.