Fix dependency version, visual code tweaks
Gitea - aviat/ion/master There was a failure building this commit Details

This commit is contained in:
Timothy Warren 2019-12-05 16:20:10 -05:00
parent 10682b8d60
commit b84145248f
10 changed files with 30 additions and 23 deletions

6
Jenkinsfile vendored
View File

@ -11,7 +11,7 @@ pipeline {
steps {
sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php'
sh 'php composer.phar install --ignore-platform-reqs'
sh 'php composer.phar install
sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
}
}
@ -25,7 +25,7 @@ pipeline {
steps {
sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php'
sh 'php composer.phar install --ignore-platform-reqs'
sh 'php composer.phar install
sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
}
}
@ -39,7 +39,7 @@ pipeline {
steps {
sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php'
sh 'php composer.phar install --ignore-platform-reqs'
sh 'php composer.phar install
sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
}
}

View File

@ -17,9 +17,10 @@
}
},
"require": {
"aviat/query": "^2.5.1",
"aura/html": "^2.5.0",
"danielstjules/stringy": "^3.2.0",
"aviat/query": "^2.5.1",
"danielstjules/stringy": "^3.1.0",
"ext-dom": "*",
"ext-json": "*",
"php": "^7.2",
"psr/http-message": "~1.0",
@ -37,7 +38,6 @@
"phpstan/phpstan": "^0.12.0",
"phpunit/phpunit": "^8.4.3",
"roave/security-advisories": "dev-master",
"robmorgan/phinx": "^0.10.6",
"sebastian/phpcpd": "^4.1.0",
"squizlabs/php_codesniffer": "^3.0.0",
"theseer/phpdox": "^0.12.0"

View File

@ -44,7 +44,7 @@ interface ConfigInterface {
* @throws \InvalidArgumentException
* @return ConfigInterface
*/
public function set($key, $value): ConfigInterface;
public function set($key, $value): self;
/**
* Remove a config value

View File

@ -35,7 +35,7 @@ class Friend {
/**
* Reflection class of the object
* @var \ReflectionClass
* @var ReflectionClass
*/
private $_reflect_;

View File

@ -33,8 +33,8 @@ class StringType extends Stringy {
*/
public function fuzzyCaseMatch(string $strToMatch): bool
{
$firstStr = self::create($this->str)->dasherize()->__toString();
$secondStr = self::create($strToMatch)->dasherize()->__toString();
$firstStr = (string)self::create($this->str)->dasherize();
$secondStr = (string)self::create($strToMatch)->dasherize();
return $firstStr === $secondStr;
}

View File

@ -50,6 +50,8 @@ abstract class View
* Constructor
*
* @param ContainerInterface $container
* @throws Di\Exception\ContainerException
* @throws Di\Exception\NotFoundException
*/
public function __construct(ContainerInterface $container)
{
@ -135,7 +137,7 @@ abstract class View
*/
public function getOutput(): string
{
return $this->response->getBody()->__toString();
return (string)$this->response->getBody();
}
}
// End of View.php

View File

@ -16,7 +16,10 @@
namespace Aviat\Ion\View;
use Aura\Html\HelperLocator;
use Aviat\Ion\Di\ContainerInterface;
use Aviat\Ion\Di\Exception\ContainerException;
use Aviat\Ion\Di\Exception\NotFoundException;
/**
* View class for outputting HTML
@ -26,7 +29,7 @@ class HtmlView extends HttpView {
/**
* HTML generator/escaper helper
*
* @var \Aura\Html\HelperLocator
* @var HelperLocator
*/
protected $helper;
@ -41,6 +44,8 @@ class HtmlView extends HttpView {
* Create the Html View
*
* @param ContainerInterface $container
* @throws ContainerException
* @throws NotFoundException
*/
public function __construct(ContainerInterface $container)
{
@ -64,8 +69,7 @@ class HtmlView extends HttpView {
ob_start();
extract($data, \EXTR_OVERWRITE);
include_once $path;
$buffer = ob_get_contents();
ob_end_clean();
$buffer = ob_get_clean();
// Very basic html minify, that won't affect content between html tags

View File

@ -17,6 +17,7 @@
namespace Aviat\Ion\View;
use Aviat\Ion\Json;
use Aviat\Ion\JsonException;
use Aviat\Ion\ViewInterface;
/**
@ -37,7 +38,7 @@ class JsonView extends HttpView {
* @param mixed $string
* @throws \InvalidArgumentException
* @throws \RuntimeException
* @throws \Aviat\Ion\JsonException
* @throws JsonException
* @return ViewInterface
*/
public function setOutput($string): ViewInterface

View File

@ -21,8 +21,8 @@ require 'Ion_TestCase.php';
// Ini Settings
// -----------------------------------------------------------------------------
ini_set('session.use_cookies', 0);
ini_set("session.use_only_cookies",0);
ini_set("session.use_trans_sid",1);
ini_set('session.use_only_cookies',0);
ini_set('session.use_trans_sid',1);
// Start session here to surpress error about headers not sent
session_start();

View File

@ -11,16 +11,16 @@ use Aviat\Ion\Di\Container;
// -----------------------------------------------------------------------------
// Setup DI container
// -----------------------------------------------------------------------------
return function(array $config_array = []) {
return static function(array $config_array = []) {
$container = new Container();
$container->set('config', function() {
$container->set('config', static function() {
return new Config([]);
});
$container->setInstance('config', new Config($config_array));
$container->set('request', function() {
$container->set('request', static function() {
return ServerRequestFactory::fromGlobals(
$_SERVER,
$_GET,
@ -30,17 +30,17 @@ return function(array $config_array = []) {
);
});
$container->set('response', function() {
$container->set('response', static function() {
return new Response();
});
// Create session Object
$container->set('session', function() {
$container->set('session', static function() {
return (new SessionFactory())->newInstance($_COOKIE);
});
// Create Html helper Object
$container->set('html-helper', function() {
$container->set('html-helper', static function() {
return (new HelperLocatorFactory)->newInstance();
});