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

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 { steps {
sh 'apk add --no-cache php7-phpdbg' sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php' 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' sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
} }
} }
@ -25,7 +25,7 @@ pipeline {
steps { steps {
sh 'apk add --no-cache php7-phpdbg' sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php' 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' sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
} }
} }
@ -39,7 +39,7 @@ pipeline {
steps { steps {
sh 'apk add --no-cache php7-phpdbg' sh 'apk add --no-cache php7-phpdbg'
sh 'curl -sS https://getcomposer.org/installer | php' 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' sh 'php composer.phar run-script coverage -- --coverage-text --colors=never'
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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