Skip to content
Merged
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
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@

"autoload": {
"psr-4": {
"GT\\Input\\": "./src",
"Gt\\Input\\": "./src"
}
},
"autoload-dev": {
"psr-4": {
"GT\\Input\\Test\\": "./test/phpunit",
"Gt\\Input\\Test\\": "./test/phpunit"
}
},

"scripts": {
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
"phpunit:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text",
"phpstan": "vendor/bin/phpstan analyse --level 6 src --memory-limit 256M",
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
Expand All @@ -41,6 +42,12 @@
]
},

"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},

"funding": [
{
"type": "github",
Expand Down
2 changes: 1 addition & 1 deletion src/BodyStream.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input;
namespace GT\Input;

use Gt\Http\Stream;

Expand Down
2 changes: 1 addition & 1 deletion src/CallOrOutOfSequenceException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class CallOrOutOfSequenceException extends InputException {}
2 changes: 1 addition & 1 deletion src/DataNotCompatibleFormatException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class DataNotCompatibleFormatException extends InputException {}
2 changes: 1 addition & 1 deletion src/DataNotFileUploadException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input;
namespace GT\Input;

use Throwable;

Expand Down
2 changes: 1 addition & 1 deletion src/ImmutableObjectModificationException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class ImmutableObjectModificationException extends InputException {}
26 changes: 13 additions & 13 deletions src/Input.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php
namespace Gt\Input;
namespace GT\Input;

use ArrayAccess;
use Countable;
use Gt\Input\Trigger\NeverTrigger;
use GT\Input\Trigger\NeverTrigger;
use Gt\Json\JsonDecodeException;
use Gt\Json\JsonObject;
use Gt\Json\JsonObjectBuilder;
use Iterator;
use Psr\Http\Message\StreamInterface;
use Gt\Input\Trigger\Trigger;
use Gt\Input\InputData\InputData;
use Gt\Input\InputData\Datum\StreamNotAvailableException;
use Gt\Input\InputData\Datum\InputDatum;
use Gt\Input\InputData\KeyValueArrayAccess;
use Gt\Input\InputData\KeyValueCountable;
use Gt\Input\InputData\KeyValueIterator;
use Gt\Input\InputData\BodyInputData;
use Gt\Input\InputData\CombinedInputData;
use Gt\Input\InputData\FileUploadInputData;
use Gt\Input\InputData\QueryStringInputData;
use GT\Input\Trigger\Trigger;
use GT\Input\InputData\InputData;
use GT\Input\InputData\Datum\StreamNotAvailableException;
use GT\Input\InputData\Datum\InputDatum;
use GT\Input\InputData\KeyValueArrayAccess;
use GT\Input\InputData\KeyValueCountable;
use GT\Input\InputData\KeyValueIterator;
use GT\Input\InputData\BodyInputData;
use GT\Input\InputData\CombinedInputData;
use GT\Input\InputData\FileUploadInputData;
use GT\Input\InputData\QueryStringInputData;

/**
* @implements ArrayAccess<string, ?string>
Expand Down
8 changes: 4 additions & 4 deletions src/InputData/AbstractInputData.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

use ArrayAccess;
use Countable;
use Gt\Input\InputData\Datum\MultipleInputDatum;
use Gt\Input\InputValueGetter;
use GT\Input\InputData\Datum\MultipleInputDatum;
use GT\Input\InputValueGetter;
use Iterator;
use Gt\Input\InputData\Datum\InputDatum;
use GT\Input\InputData\Datum\InputDatum;

/**
* @implements ArrayAccess<string, string|InputDatum>
Expand Down
2 changes: 1 addition & 1 deletion src/InputData/BodyInputData.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

class BodyInputData extends InputData {}
2 changes: 1 addition & 1 deletion src/InputData/CombinedInputData.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

class CombinedInputData extends InputData {}
2 changes: 1 addition & 1 deletion src/InputData/Datum/FailedFileUpload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input\InputData\Datum;
namespace GT\Input\InputData\Datum;

class FailedFileUpload extends FileUpload {
protected int $errorCode;
Expand Down
6 changes: 3 additions & 3 deletions src/InputData/Datum/FileUpload.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace Gt\Input\InputData\Datum;
namespace GT\Input\InputData\Datum;

use Gt\Http\Stream;
use Gt\Input\UploadedFileMoveException;
use Gt\Input\UploadedFileSecurityException;
use GT\Input\UploadedFileMoveException;
use GT\Input\UploadedFileSecurityException;
use InvalidArgumentException;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/InputData/Datum/InputDatum.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input\InputData\Datum;
namespace GT\Input\InputData\Datum;

class InputDatum {
protected mixed $value;
Expand Down
4 changes: 2 additions & 2 deletions src/InputData/Datum/MultipleInputDatum.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Gt\Input\InputData\Datum;
namespace GT\Input\InputData\Datum;

use ArrayAccess;
use Gt\Input\ImmutableObjectModificationException;
use GT\Input\ImmutableObjectModificationException;
use Iterator;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/InputData/Datum/StreamNotAvailableException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
namespace Gt\Input\InputData\Datum;
namespace GT\Input\InputData\Datum;

use Gt\Input\InputException;
use GT\Input\InputException;

class StreamNotAvailableException extends InputException {}
6 changes: 3 additions & 3 deletions src/InputData/FileUploadInputData.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

use Gt\Input\InputData\Datum\FailedFileUpload;
use Gt\Input\InputData\Datum\FileUpload;
use GT\Input\InputData\Datum\FailedFileUpload;
use GT\Input\InputData\Datum\FileUpload;

class FileUploadInputData extends InputData {
/**
Expand Down
8 changes: 4 additions & 4 deletions src/InputData/InputData.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

use Gt\Input\InputData\Datum\InputDatum;
use Gt\Input\InputData\Datum\MultipleInputDatum;
use Gt\Input\InputValueGetter;
use GT\Input\InputData\Datum\InputDatum;
use GT\Input\InputData\Datum\MultipleInputDatum;
use GT\Input\InputValueGetter;

class InputData extends AbstractInputData {
/** @param iterable<string,string>|iterable<string, array<string>>|iterable<InputData>...$sources */
Expand Down
6 changes: 3 additions & 3 deletions src/InputData/InputDataFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

use Gt\Input\Input;
use Gt\Input\WithWithoutClashingException;
use GT\Input\Input;
use GT\Input\WithWithoutClashingException;

class InputDataFactory {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/InputData/KeyValueArrayAccess.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

use Gt\Input\Input;
use Gt\Input\InputData\Datum\InputDatum;
use GT\Input\Input;
use GT\Input\InputData\Datum\InputDatum;

trait KeyValueArrayAccess {
public function offsetExists($offset):bool {
Expand Down
2 changes: 1 addition & 1 deletion src/InputData/KeyValueCountable.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

trait KeyValueCountable {
public function count():int {
Expand Down
4 changes: 2 additions & 2 deletions src/InputData/KeyValueIterator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

use Gt\Input\InputData\Datum\InputDatum;
use GT\Input\InputData\Datum\InputDatum;

trait KeyValueIterator {
/** @var int */
Expand Down
2 changes: 1 addition & 1 deletion src/InputData/QueryStringInputData.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input\InputData;
namespace GT\Input\InputData;

class QueryStringInputData extends InputData {}
2 changes: 1 addition & 1 deletion src/InputException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input;
namespace GT\Input;

use RuntimeException;

Expand Down
14 changes: 7 additions & 7 deletions src/InputValueGetter.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
namespace Gt\Input;
namespace GT\Input;

use DateTime;
use DateTimeInterface;
use Exception;
use Gt\Input\InputData\CombinedInputData;
use Gt\Input\InputData\Datum\FileUpload;
use Gt\Input\InputData\Datum\InputDatum;
use Gt\Input\InputData\Datum\MultipleInputDatum;
use Gt\Input\InputData\FileUploadInputData;
use Gt\Input\InputData\InputData;
use GT\Input\InputData\CombinedInputData;
use GT\Input\InputData\Datum\FileUpload;
use GT\Input\InputData\Datum\InputDatum;
use GT\Input\InputData\Datum\MultipleInputDatum;
use GT\Input\InputData\FileUploadInputData;
use GT\Input\InputData\InputData;
use TypeError;

trait InputValueGetter {
Expand Down
2 changes: 1 addition & 1 deletion src/InvalidInputMethodException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class InvalidInputMethodException extends InputException {}
2 changes: 1 addition & 1 deletion src/MissingInputParameterException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class MissingInputParameterException extends InputException {}
4 changes: 2 additions & 2 deletions src/Trigger/Callback.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Gt\Input\Trigger;
namespace GT\Input\Trigger;

use Gt\Input\InputData\InputData;
use GT\Input\InputData\InputData;

class Callback {
/** @var callable */
Expand Down
2 changes: 1 addition & 1 deletion src/Trigger/NeverTrigger.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input\Trigger;
namespace GT\Input\Trigger;

class NeverTrigger extends Trigger {
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
Expand Down
10 changes: 5 additions & 5 deletions src/Trigger/Trigger.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace Gt\Input\Trigger;
namespace GT\Input\Trigger;

use Gt\Input\CallOrOutOfSequenceException;
use Gt\Input\Input;
use Gt\Input\InputData\InputDataFactory;
use GT\Input\CallOrOutOfSequenceException;
use GT\Input\Input;
use GT\Input\InputData\InputDataFactory;

class Trigger {
protected Input $input;
Expand Down Expand Up @@ -159,7 +159,7 @@ protected function callCallbacks():void {
);

foreach($this->callbacks as $callback) {
/** @var $callback \Gt\Input\Trigger\Callback */
/** @var $callback \GT\Input\Trigger\Callback */
$callback->call($fields);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/UploadedFileMoveException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class UploadedFileMoveException extends InputException {}
2 changes: 1 addition & 1 deletion src/UploadedFileSecurityException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class UploadedFileSecurityException extends InputException {}
2 changes: 1 addition & 1 deletion src/WithWithoutClashingException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace Gt\Input;
namespace GT\Input;

class WithWithoutClashingException extends InputException {}
6 changes: 3 additions & 3 deletions test/phpunit/Helper/Helper.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace Gt\Input\Test\Helper;
namespace GT\Input\Test\Helper;

use Gt\Input\Input;
use Gt\Input\InputData\InputData;
use GT\Input\Input;
use GT\Input\InputData\InputData;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

Expand Down
2 changes: 1 addition & 1 deletion test/phpunit/Helper/Reflection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Gt\Input\Test\Helper;
namespace GT\Input\Test\Helper;

use ReflectionClass;
use ReflectionMethod;
Expand Down
10 changes: 5 additions & 5 deletions test/phpunit/InputData/BodyInputDataTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Gt\Input\Test\InputData;
namespace GT\Input\Test\InputData;

use Gt\Input\InputData\BodyInputData;
use Gt\Input\InputData\Datum\InputDatum;
use Gt\Input\InputData\Datum\MultipleInputDatum;
use Gt\Input\Test\Helper\Helper;
use GT\Input\InputData\BodyInputData;
use GT\Input\InputData\Datum\InputDatum;
use GT\Input\InputData\Datum\MultipleInputDatum;
use GT\Input\Test\Helper\Helper;
use PHPUnit\Framework\TestCase;

class BodyInputDataTest extends TestCase {
Expand Down
Loading
Loading