Skip to content

Commit

Permalink
Add missing use statements
Browse files Browse the repository at this point in the history
Add Licence
  • Loading branch information
Jan-Nox committed Nov 26, 2021
1 parent 780b4d4 commit 937af68
Show file tree
Hide file tree
Showing 33 changed files with 801 additions and 8 deletions.
675 changes: 675 additions & 0 deletions COPYING

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions backend/class/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use noxkiwi\log\Traits\LogTrait;
use noxkiwi\singleton\Singleton;
use ReflectionClass;
use function explode;
use function is_string;
use function ucfirst;
use const E_ERROR;

Expand Down
1 change: 1 addition & 0 deletions backend/class/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use noxkiwi\validator\Validator\Structure\Config\ContextValidator;
use function is_array;
use noxkiwi\singleton\Singleton;
use const E_ERROR;

/**
* I am the "class" everyone wants to have but won't ever have.
Expand Down
2 changes: 2 additions & 0 deletions backend/class/Config/JsonConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use noxkiwi\core\Filesystem;
use noxkiwi\core\Helper\JsonHelper;
use noxkiwi\core\Path;
use function array_replace_recursive;
use function compact;
use function is_array;
use const E_ERROR;

Expand Down
4 changes: 4 additions & 0 deletions backend/class/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
use noxkiwi\log\Traits\LogTrait;
use noxkiwi\singleton\Singleton;
use noxkiwi\translator\Traits\TranslatorTrait;
use function class_exists;
use function extension_loaded;
use function method_exists;
use function newrelic_name_transaction;
use function ucfirst;
use const E_ERROR;

/**
Expand Down
1 change: 1 addition & 0 deletions backend/class/Context/ResourceContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use noxkiwi\core\Helper\MimeHelper;
use noxkiwi\core\Helper\WebHelper;
use noxkiwi\core\Path;
use function explode;

/**
* I am the base Resource context class.
Expand Down
3 changes: 3 additions & 0 deletions backend/class/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

use noxkiwi\core\Interfaces\CookieInterface;
use noxkiwi\singleton\Singleton;
use function hash;
use function time;
use function uniqid;

/**
* I am the basic cookie class
Expand Down
2 changes: 2 additions & 0 deletions backend/class/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
use function func_get_args;
use function in_array;
use function is_array;
use const CORE_ENVIRONMENT;
use const E_ERROR;
use const NK_ENVIRONMENT;

/**
* I am the Environment base.
Expand Down
13 changes: 13 additions & 0 deletions backend/class/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@
use noxkiwi\core\Helper\WebHelper;
use noxkiwi\core\Response\CliResponse;
use noxkiwi\core\Response\HttpResponse;
use function basename;
use function chr;
use function count;
use function defined;
use function error_reporting;
use function explode;
use function file_get_contents;
use function file_put_contents;
use function header;
use function headers_sent;
use function htmlspecialchars;
use function max;
use function min;
use function print_r;
use function uniqid;
use function var_dump;
use const E_ERROR;

Expand Down
3 changes: 3 additions & 0 deletions backend/class/ErrorStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use noxkiwi\core\Observer\ErrorstackObserver;
use noxkiwi\observing\Traits\ObservableTrait;
use noxkiwi\stack\StackOf;
use function call_user_func;
use function compact;
use function count;

/**
* I am
Expand Down
1 change: 1 addition & 0 deletions backend/class/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace noxkiwi\core;

use noxkiwi\hook\Hook;
use function chr;
use function file_put_contents;

/**
Expand Down
16 changes: 16 additions & 0 deletions backend/class/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,26 @@
use noxkiwi\core\Interfaces\FilesystemInterface;
use noxkiwi\log\Traits\LogTrait;
use noxkiwi\singleton\Singleton;
use function array_diff;
use function array_pop;
use function compact;
use function copy;
use function dirname;
use function explode;
use function file_exists;
use function file_get_contents;
use function file_put_contents;
use function is_dir;
use function is_file;
use function is_readable;
use function is_writable;
use function is_writeable;
use function mkdir;
use function rename;
use function rmdir;
use function scandir;
use function unlink;
use const SCANDIR_SORT_NONE;

/**
* I am the Filesystem handler class.
Expand Down
1 change: 1 addition & 0 deletions backend/class/Gate/CliGate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace noxkiwi\core\Gate;

use noxkiwi\core\Gate;
use const PHP_SAPI;

/**
* I am the CommandLineInterface Gate class.
Expand Down
2 changes: 2 additions & 0 deletions backend/class/Gate/CsrfGate.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use noxkiwi\core\Gate;
use noxkiwi\core\Request;
use noxkiwi\core\Session;
use function random_int;
use function sprintf;

/**
* I am the Gate that checks for cross site request forgery.
Expand Down
2 changes: 2 additions & 0 deletions backend/class/Gate/Fail2banGate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use noxkiwi\core\Gate;
use noxkiwi\core\Helper\WebHelper;
use function chr;
use function file_put_contents;
use function is_writable;
use const FILE_APPEND;

Expand Down
1 change: 1 addition & 0 deletions backend/class/Gate/MaintenanceGate.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use noxkiwi\core\Gate;
use noxkiwi\core\Path;
use noxkiwi\core\Request;
use function defined;

/**
* I am the interface for the maintenance mode.
Expand Down
1 change: 1 addition & 0 deletions backend/class/Gate/RemoteHostnameGate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use JetBrains\PhpStorm\Pure;
use noxkiwi\core\Gate;
use noxkiwi\core\Helper\WebHelper;
use function gethostbyname;

/**
* I am the Gate that checks the hostname that was given.
Expand Down
5 changes: 5 additions & 0 deletions backend/class/Helper/CryptographyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
namespace noxkiwi\core\Helper;

use noxkiwi\core\Exception\CryptographyException;
use function base64_decode;
use function base64_encode;
use function is_string;
use function openssl_decrypt;
use function openssl_encrypt;
use function substr;
use const E_WARNING;

/**
Expand Down
5 changes: 5 additions & 0 deletions backend/class/Helper/DateHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?php declare(strict_types = 1);
namespace noxkiwi\core\Helper;

use function abs;
use function date;
use function in_array;
use function round;
use function strtotime;
use function time;

/**
* I am
Expand Down
6 changes: 6 additions & 0 deletions backend/class/Helper/FilesystemHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

use JetBrains\PhpStorm\ArrayShape;
use function count;
use function explode;
use function implode;
use function preg_match;
use function preg_replace;
use function str_replace;
use function strtolower;

/**
* I am
Expand Down
5 changes: 5 additions & 0 deletions backend/class/Helper/FrontendHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
use noxkiwi\core\Filesystem;
use noxkiwi\core\Path;
use noxkiwi\core\Request;
use function header;
use function in_array;
use function ob_get_clean;
use function ob_start;
use function str_contains;
use function strtolower;

/**
* I am
Expand Down
10 changes: 10 additions & 0 deletions backend/class/Helper/JsonHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
use noxkiwi\core\Exception\FilesystemException;
use noxkiwi\core\Exception\InvalidJsonException;
use noxkiwi\core\Filesystem;
use function file_get_contents;
use function json_decode;
use function json_encode;
use function json_last_error;
use const E_WARNING;
use const JSON_ERROR_CTRL_CHAR;
use const JSON_ERROR_DEPTH;
use const JSON_ERROR_NONE;
use const JSON_ERROR_STATE_MISMATCH;
use const JSON_ERROR_SYNTAX;
use const JSON_ERROR_UTF8;
use const JSON_PRETTY_PRINT;
use const JSON_THROW_ON_ERROR;

Expand Down
4 changes: 4 additions & 0 deletions backend/class/Helper/LinkHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
use JetBrains\PhpStorm\NoReturn;
use noxkiwi\core\Constants\Mvc;
use noxkiwi\core\Response;
use function header;
use function http_build_query;
use function is_array;
use function is_string;
use function str_replace;
use function strlen;
use function substr;

/**
* I am the link generator class.
Expand Down
6 changes: 6 additions & 0 deletions backend/class/Helper/MimeHelper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php declare(strict_types = 1);
namespace noxkiwi\core\Helper;

use function end;
use function explode;
use function header;
use function headers_sent;
use function strtolower;

/**
* I am the MIME type helper class
*
Expand Down
3 changes: 3 additions & 0 deletions backend/class/Helper/WebHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
namespace noxkiwi\core\Helper;

use JetBrains\PhpStorm\Pure;
use function explode;
use function getenv;
use function ip2long;

/**
* I am
Expand Down
3 changes: 3 additions & 0 deletions backend/class/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
use noxkiwi\core\Request\HttpRequest;
use noxkiwi\core\Traits\DatacontainerTrait;
use noxkiwi\core\Traits\LanguageImprovementTrait;
use function date;
use function json_encode;
use function md5;
use const PHP_SAPI;

/**
* I am the Core's Request representation.
Expand Down
12 changes: 11 additions & 1 deletion backend/class/Request/HttpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@
use noxkiwi\core\Helper\WebHelper;
use noxkiwi\core\Request;
use noxkiwi\rewrite\Urlrewrite;
use function compact;
use function explode;
use function file_get_contents;
use function filter_input_array;
use function is_array;
use function json_decode;
use function parse_str;
use function str_contains;
use function strncmp;
use function strtok;
use function strtolower;
use function substr;
use const INPUT_COOKIE;
use const INPUT_GET;
use const INPUT_POST;
Expand Down Expand Up @@ -51,7 +61,7 @@ protected function __construct(array $data = [])
$this->add(filter_input_array(INPUT_POST) ?? []);
$decoded = (array)(json_decode(file_get_contents('php://input') ?? '', true) ?? []);
$this->add($decoded);
if (! is_array($decoded))
if (! is_array($decoded))
{
return;
}
Expand Down
1 change: 1 addition & 0 deletions backend/class/Response/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use noxkiwi\core\Path;
use noxkiwi\core\Response;
use function in_array;
use function strpos;
use const E_NOTICE;

/**
Expand Down
1 change: 1 addition & 0 deletions backend/class/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use noxkiwi\core\Interfaces\SessionInterface;
use noxkiwi\singleton\Singleton;
use function session_id;

/**
* I am the base session class. All session objects must be my children.
Expand Down
1 change: 1 addition & 0 deletions backend/class/Session/CacheSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use noxkiwi\core\Session;
use function count;
use function is_array;
use function is_numeric;

/**
* I am
Expand Down
2 changes: 2 additions & 0 deletions backend/class/Traits/DatacontainerTrait.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php declare(strict_types = 1);
namespace noxkiwi\core\Traits;

use function explode;
use function in_array;
use function is_array;
use function is_object;
use function str_contains;

/**
* I am the trait for the implementation if the DataContainerInterface.
Expand Down
1 change: 1 addition & 0 deletions backend/class/Traits/TranslationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Exception;
use noxkiwi\core\ErrorHandler;
use noxkiwi\translator\Translator;
use function strtoupper;

/**
* I am the TranslationTrait.
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "I am the core framework for all applications from noxkiwi. My collection of functionality is quite big, my app class is a simple, yet usable and flexible toolbox for all kinds of tasks.",
"version": "1.0.0",
"type": "package",
"license": "proprietary",
"license": "GPL-3.0-or-later",
"keywords": [
"core",
"main",
Expand All @@ -21,12 +21,12 @@
],
"require": {
"php": ">=8.0.0",
"noxkiwi/validator": "*",
"noxkiwi/hook": "*",
"noxkiwi/log": "*",
"noxkiwi/singleton": "*",
"noxkiwi/cache": "*",
"noxkiwi/stack": "*",
"noxkiwi/validator": "dev-master",
"noxkiwi/hook": "dev-master",
"noxkiwi/log": "dev-master",
"noxkiwi/singleton": "dev-master",
"noxkiwi/cache": "dev-master",
"noxkiwi/stack": "dev-master",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand Down

0 comments on commit 937af68

Please sign in to comment.