Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
9 changed files with 125 additions and 41 deletions
Showing only changes of commit 2beba8d5c3 - Show all commits

4
.gitignore vendored
View File

@ -150,4 +150,6 @@ public/mal_mappings.json
.is-dev
tmp
tmp
tools/vendor/
tools/phinx/vendor/

View File

@ -38,7 +38,7 @@
"aura/html": "^2.5.0",
"aura/router": "^3.1.0",
"aura/session": "^2.1.0",
"aviat/banker": "^3.0.0 || ^4.0.0",
"aviat/banker": "^3.0.0",
"aviat/query": "^3.0.0",
"danielstjules/stringy": "^3.1.0",
"ext-dom": "*",
@ -53,7 +53,6 @@
"php": ">= 8.0.0",
"psr/http-message": "^1.0.1",
"psr/log": "*",
"robmorgan/phinx": "^0.12.4",
"symfony/polyfill-mbstring": "^1.0.0",
"symfony/polyfill-util": "^1.0.0",
"tracy/tracy": "^2.8.0",

View File

@ -46,27 +46,22 @@ final class SyncLists extends BaseCommand {
/**
* Model for making requests to Anilist API
* @var Anilist\Model
*/
private Anilist\Model $anilistModel;
/**
* Model for making requests to Kitsu API
* @var API\Kitsu\Model
*/
private API\Kitsu\Model $kitsuModel;
/**
* Does the Kitsu API have valid authentication?
* @var bool
*/
private bool $isKitsuAuthenticated = FALSE;
/**
* Sync Kitsu <=> Anilist
*
* @param array $args
* @param array $options
* @throws ContainerException
* @throws NotFoundException
* @throws Throwable

View File

@ -81,19 +81,9 @@ class Config extends AbstractType {
public ?string $whose_list;
// ------------------------------------------------------------------------
// Application config
// ------------------------------------------------------------------------
public array $menus = [];
/**
* @var array
*/
public array $menus;
/**
* @var array
*/
public array $routes;
public array $routes = [];
// ------------------------------------------------------------------------
// Generated config values

View File

@ -24,35 +24,26 @@ use Psr\Log\LoggerInterface;
*/
class Container implements ContainerInterface {
/**
* Array of container Generator functions
*
* @var Callable[]
*/
protected array $container = [];
/**
* Array of object instances
*
* @var array
*/
protected array $instances = [];
/**
* Map of logger instances
*
* @var array
*/
protected array $loggers = [];
/**
* Constructor
*
* @param array $values (optional)
* @param (callable)[] $container (optional)
*/
public function __construct(array $values = [])
public function __construct(/**
* Array of container Generator functions
*/
protected array $container = [])
{
$this->container = $values;
$this->loggers = [];
}

View File

@ -26,27 +26,21 @@ use Psr\Http\Message\ResponseInterface;
/**
* Base view class for Http output
*/
class HttpView implements HttpViewInterface{
class HttpView implements HttpViewInterface, \Stringable{
/**
* HTTP response Object
*
* @var ResponseInterface
*/
public ResponseInterface $response;
/**
* If the view has sent output via
* __toString or send method
*
* @var boolean
*/
protected bool $hasRendered = FALSE;
/**
* Response mime type
*
* @var string
*/
protected string $contentType = '';

6
tools/composer.json Normal file
View File

@ -0,0 +1,6 @@
{
"require": {
"friendsofphp/php-cs-fixer": "^3.6",
"rector/rector": "^0.12.16"
}
}

View File

@ -0,0 +1,5 @@
{
"require": {
"robmorgan/phinx": "^0.12.4"
}
}

102
tools/rector.php Normal file
View File

@ -0,0 +1,102 @@
<?php declare(strict_types=1);
use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector;
use Rector\CodeQuality\Rector\For_\ForToForeachRector;
use Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\CodeQuality\Rector\Ternary\SimplifyDuplicatedTernaryRector;
use Rector\CodeQuality\Rector\Ternary\SimplifyTautologyTernaryRector;
use Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector;
use Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector;
use Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Core\Configuration\Option;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
use Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Restoration\Rector\Property\MakeTypedPropertyNullableIfCheckedRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByParentCallTypeRector;
use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
if ( ! function_exists('walk_array'))
{
function walk_array(callable $method, array $items): void
{
foreach ($items as $item) {
$method($item);
}
}
}
return static function (ContainerConfigurator $config): void {
$parameters = $config->parameters();
$parameters->set(Option::AUTO_IMPORT_NAMES, false);
$parameters->set(Option::IMPORT_SHORT_CLASSES, false);
$parameters->set(Option::SKIP, [
ReadOnlyPropertyRector::class,
]);
walk_array([$config, 'import'], [
LevelSetList::UP_TO_PHP_80,
]);
$services = $config->services();
walk_array([$services, 'set'], [
AddArrayDefaultToArrayPropertyRector::class,
AddArrayParamDocTypeRector::class,
AddArrayReturnDocTypeRector::class,
AddClosureReturnTypeRector::class,
AddMethodCallBasedStrictParamTypeRector::class,
CallUserFuncArrayToVariadicRector::class,
CallUserFuncToMethodCallRector::class,
ChangeIfElseValueAssignToEarlyReturnRector::class,
ChangeNestedForeachIfsToEarlyContinueRector::class,
CompleteDynamicPropertiesRector::class,
ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class,
CountArrayToEmptyArrayComparisonRector::class,
ForRepeatedCountToOwnVariableRector::class,
ForToForeachRector::class,
// MakeTypedPropertyNullableIfCheckedRector::class,
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
ParamTypeByMethodCallTypeRector::class,
ParamTypeByParentCallTypeRector::class,
RemoveAlwaysElseRector::class,
RemoveDuplicatedCaseInSwitchRector::class,
RemoveFinalFromConstRector::class,
RemoveUnusedForeachKeyRector::class,
RemoveUselessParamTagRector::class,
RemoveUselessReturnTagRector::class,
RemoveUselessVarTagRector::class,
// SimplifyDeMorganBinaryRector::class,
SimplifyDuplicatedTernaryRector::class,
SimplifyIfElseToTernaryRector::class,
SimplifyIfReturnBoolRector::class,
SimplifyTautologyTernaryRector::class,
SwitchNegatedTernaryRector::class,
TypedPropertyFromAssignsRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
]);
};