Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: drop psalm #165

Merged
merged 1 commit into from
Mar 23, 2024
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
/tests export-ignore
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/composer.lock
/phpcs.xml
/phpstan.neon
/psalm.xml
/phpunit.xml
/vendor/
.phpunit.result.cache
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
"phpstan/phpstan": "^1.3",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
"phpunit/phpunit": "^10.1",
"psalm/plugin-phpunit": "^0.19.0",
"vimeo/psalm": "^5.0"
"phpunit/phpunit": "^10.1"
},
"autoload": {
"psr-4": {
Expand Down
73 changes: 0 additions & 73 deletions psalm-baseline.xml

This file was deleted.

18 changes: 0 additions & 18 deletions psalm.xml.dist

This file was deleted.

6 changes: 3 additions & 3 deletions src/Builder/EnumBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
/**
* @see EnumType
*
* @psalm-import-type EnumValues from EnumType
* @psalm-import-type EnumTypeConfig from EnumType
* @phpstan-import-type EnumValues from EnumType
* @phpstan-import-type EnumTypeConfig from EnumType
*/
class EnumBuilder extends TypeBuilder
{
Expand Down Expand Up @@ -41,7 +41,7 @@
string|null $description = null,
string|null $deprecationReason = null,
): self {
$name ??= (string) $value;

Check warning on line 44 in src/Builder/EnumBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "CastString": --- Original +++ New @@ @@ /** @return $this */ public function addValue(int|string $value, string|null $name = null, string|null $description = null, string|null $deprecationReason = null) : self { - $name ??= (string) $value; + $name ??= $value; if (preg_match(self::VALID_NAME_PATTERN, $name) !== 1) { throw InvalidArgument::invalidNameFormat($name); }
if (preg_match(self::VALID_NAME_PATTERN, $name) !== 1) {
throw InvalidArgument::invalidNameFormat($name);
}
Expand All @@ -60,12 +60,12 @@
return $this;
}

/** @psalm-return EnumTypeConfig */
/** @phpstan-return EnumTypeConfig */
public function build(): array
{
return [
'name' => $this->name,
'description' => $this->description,

Check warning on line 68 in src/Builder/EnumBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ /** @phpstan-return EnumTypeConfig */ public function build() : array { - return ['name' => $this->name, 'description' => $this->description, 'values' => $this->values]; + return ['name' => $this->name, 'description' > $this->description, 'values' => $this->values]; } }
'values' => $this->values,
];
}
Expand Down
28 changes: 13 additions & 15 deletions src/Builder/FieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@
* @see FieldDefinition
* @see Argument
*
* @psalm-import-type FieldResolver from Executor
* @psalm-import-type FieldDefinitionConfig from FieldDefinition
* @psalm-import-type FieldType from FieldDefinition
* @psalm-import-type ArgumentListConfig from Argument
* @psalm-import-type ArgumentType from Argument
* @phpstan-import-type FieldResolver from Executor
* @phpstan-import-type FieldDefinitionConfig from FieldDefinition
* @phpstan-import-type FieldType from FieldDefinition
* @phpstan-import-type ArgumentListConfig from Argument
* @phpstan-import-type ArgumentType from Argument
*/
class FieldBuilder
{
/** @psalm-var FieldType */
/** @phpstan-var FieldType */
private mixed $type;

private string|null $description = null;

private string|null $deprecationReason = null;

/** @psalm-var FieldResolver|null */
/** @phpstan-var FieldResolver|null */
private $resolve;

/** @psalm-var (ArgumentListConfig&array)|null */
/** @phpstan-var (ArgumentListConfig&array)|null */
private array|null $args = null;

/** @psalm-param FieldType $type */
/** @phpstan-param FieldType $type */
final private function __construct(private string $name, $type)
{
$this->type = $type;
}

/**
* @psalm-param FieldType $type
* @phpstan-param FieldType $type
*
* @return static
*/
Expand All @@ -59,7 +59,7 @@
}

/**
* @psalm-param ArgumentType $type
* @phpstan-param ArgumentType $type
*
* @return $this
*/
Expand All @@ -70,7 +70,7 @@
mixed $defaultValue = null,
string|null $deprecationReason = null,
): self {
if ($this->args === null) {

Check warning on line 73 in src/Builder/FieldBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "Identical": --- Original +++ New @@ @@ */ public function addArgument(string $name, $type, string|null $description = null, mixed $defaultValue = null, string|null $deprecationReason = null) : self { - if ($this->args === null) { + if ($this->args !== null) { $this->args = []; } $value = ['type' => $type];
$this->args = [];
}

Expand All @@ -81,12 +81,10 @@
}

if ($defaultValue !== null) {
/** @psalm-suppress MixedAssignment */
$value['defaultValue'] = $defaultValue;
}

if ($deprecationReason !== null) {
/** @psalm-suppress MixedAssignment */
$value['deprecationReason'] = $deprecationReason;
}

Expand All @@ -96,7 +94,7 @@
}

/**
* @psalm-param FieldResolver $resolver
* @phpstan-param FieldResolver $resolver
*
* @return $this
*/
Expand All @@ -115,7 +113,7 @@
return $this;
}

/** @psalm-return FieldDefinitionConfig */
/** @phpstan-return FieldDefinitionConfig */
public function build(): array
{
return [
Expand All @@ -124,7 +122,7 @@
'description' => $this->description,
'deprecationReason' => $this->deprecationReason,
'resolve' => $this->resolve,
'type' => $this->type,

Check warning on line 125 in src/Builder/FieldBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ /** @phpstan-return FieldDefinitionConfig */ public function build() : array { - return ['args' => $this->args, 'name' => $this->name, 'description' => $this->description, 'deprecationReason' => $this->deprecationReason, 'resolve' => $this->resolve, 'type' => $this->type]; + return ['args' => $this->args, 'name' => $this->name, 'description' => $this->description, 'deprecationReason' => $this->deprecationReason, 'resolve' => $this->resolve, 'type' > $this->type]; } }
];
}
}
17 changes: 8 additions & 9 deletions src/Builder/InputFieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* @see InputObjectField
* @see Argument
*
* @psalm-import-type FieldResolver from Executor
* @psalm-import-type InputObjectFieldConfig from InputObjectField
* @psalm-import-type ArgumentListConfig from Argument
* @psalm-import-type ArgumentType from Argument
* @phpstan-import-type FieldResolver from Executor
* @phpstan-import-type InputObjectFieldConfig from InputObjectField
* @phpstan-import-type ArgumentListConfig from Argument
* @phpstan-import-type ArgumentType from Argument
*/
class InputFieldBuilder
{
/** @psalm-var ArgumentType */
/** @phpstan-var ArgumentType */
private mixed $type;

private string|null $deprecationReason = null;
Expand All @@ -30,14 +30,14 @@

private mixed $defaultValue;

/** @psalm-param ArgumentType $type */
/** @phpstan-param ArgumentType $type */
final private function __construct(private string $name, $type)
{
$this->type = $type;
}

/**
* @psalm-param ArgumentType $type
* @phpstan-param ArgumentType $type
*
* @return static
*/
Expand Down Expand Up @@ -70,19 +70,18 @@
return $this;
}

/** @psalm-return InputObjectFieldConfig */
/** @phpstan-return InputObjectFieldConfig */
public function build(): array
{
$config = [
'name' => $this->name,
'deprecationReason' => $this->deprecationReason,
'description' => $this->description,
'type' => $this->type,

Check warning on line 80 in src/Builder/InputFieldBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ /** @phpstan-return InputObjectFieldConfig */ public function build() : array { - $config = ['name' => $this->name, 'deprecationReason' => $this->deprecationReason, 'description' => $this->description, 'type' => $this->type]; + $config = ['name' => $this->name, 'deprecationReason' => $this->deprecationReason, 'description' => $this->description, 'type' > $this->type]; $property = new ReflectionProperty($this, 'defaultValue'); if ($property->isInitialized($this)) { $config['defaultValue'] = $this->defaultValue;
];

$property = new ReflectionProperty($this, 'defaultValue');
if ($property->isInitialized($this)) {
/** @psalm-suppress MixedAssignment */
$config['defaultValue'] = $this->defaultValue;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Builder/InputObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/**
* @see InputObjectType
*
* @psalm-import-type FieldConfig from InputObjectType
* @psalm-import-type InputObjectConfig from InputObjectType
* @phpstan-import-type FieldConfig from InputObjectType
* @phpstan-import-type InputObjectConfig from InputObjectType
*/
class InputObjectBuilder extends TypeBuilder
{
Expand Down Expand Up @@ -39,7 +39,7 @@ public function setFields(callable|array $fields): self
return $this;
}

/** @psalm-return InputObjectConfig */
/** @phpstan-return InputObjectConfig */
public function build(): array
{
return [
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/InterfaceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @see InterfaceType
*
* @psalm-import-type InterfaceConfig from InterfaceType
* @phpstan-import-type InterfaceConfig from InterfaceType
*/
class InterfaceBuilder extends TypeBuilder
{
Expand Down Expand Up @@ -61,13 +61,13 @@
return $this;
}

/** @psalm-return InterfaceConfig */
/** @phpstan-return InterfaceConfig */
public function build(): array
{
return [
'name' => $this->name,
'description' => $this->description,
'interfaces' => $this->interfaces,

Check warning on line 70 in src/Builder/InterfaceBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ /** @phpstan-return InterfaceConfig */ public function build() : array { - return ['name' => $this->name, 'description' => $this->description, 'interfaces' => $this->interfaces, 'fields' => $this->fields, 'resolveType' => $this->resolveType]; + return ['name' => $this->name, 'description' => $this->description, 'interfaces' > $this->interfaces, 'fields' => $this->fields, 'resolveType' => $this->resolveType]; } }
'fields' => $this->fields,
'resolveType' => $this->resolveType,
];
Expand Down
6 changes: 3 additions & 3 deletions src/Builder/ObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* @see FieldDefinition
* @see ObjectType
*
* @psalm-import-type FieldDefinitionConfig from FieldDefinition
* @psalm-import-type ObjectConfig from ObjectType
* @phpstan-import-type FieldDefinitionConfig from FieldDefinition
* @phpstan-import-type ObjectConfig from ObjectType
*/
class ObjectBuilder extends TypeBuilder
{
Expand Down Expand Up @@ -94,13 +94,13 @@
return $this;
}

/** @psalm-return ObjectConfig */
/** @phpstan-return ObjectConfig */
public function build(): array
{
return [
'name' => $this->name,
'description' => $this->description,
'interfaces' => $this->interfaces,

Check warning on line 103 in src/Builder/ObjectBuilder.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "ArrayItem": --- Original +++ New @@ @@ /** @phpstan-return ObjectConfig */ public function build() : array { - return ['name' => $this->name, 'description' => $this->description, 'interfaces' => $this->interfaces, 'fields' => $this->fields, 'resolveField' => $this->fieldResolver]; + return ['name' => $this->name, 'description' => $this->description, 'interfaces' > $this->interfaces, 'fields' => $this->fields, 'resolveField' => $this->fieldResolver]; } }
'fields' => $this->fields,
'resolveField' => $this->fieldResolver,
];
Expand Down
20 changes: 10 additions & 10 deletions src/Builder/UnionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
* @see ObjectType
* @see UnionType
*
* @psalm-import-type ResolveType from AbstractType
* @psalm-import-type ObjectTypeReference from UnionType
* @psalm-import-type UnionConfig from UnionType
* @psalm-type Types iterable<ObjectTypeReference>|callable(): iterable<ObjectTypeReference>
* @phpstan-import-type ResolveType from AbstractType
* @phpstan-import-type ObjectTypeReference from UnionType
* @phpstan-import-type UnionConfig from UnionType
* @phpstan-type Types iterable<ObjectTypeReference>|callable(): iterable<ObjectTypeReference>
*/
class UnionBuilder extends TypeBuilder
{
/** @psalm-var ResolveType|null */
/** @phpstan-var ResolveType|null */
private $resolveType = null;

/** @psalm-var Types */
/** @phpstan-var Types */
private $types;

/** @psalm-param Types $types */
/** @phpstan-param Types $types */
final private function __construct(iterable|callable $types, private string|null $name = null)
{
$this->types = $types;
}

/**
* @psalm-param Types $types
* @phpstan-param Types $types
*
* @return static
*/
Expand All @@ -43,7 +43,7 @@ public static function create(string|null $name, iterable|callable $types): self
}

/**
* @psalm-param ResolveType $resolveType
* @phpstan-param ResolveType $resolveType
*
* @return $this
*/
Expand All @@ -54,7 +54,7 @@ public function setResolveType(callable $resolveType): self
return $this;
}

/** @psalm-return UnionConfig */
/** @phpstan-return UnionConfig */
public function build(): array
{
return [
Expand Down
Loading