Skip to content

Commit

Permalink
Required parameters after optional parameters in function/method sign…
Browse files Browse the repository at this point in the history
…atures
  • Loading branch information
weisswurstkanone committed Apr 28, 2021
1 parent dcde4af commit e5a54cc
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/Event/GraphQL/Model/ListingEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function setResolveInfo(ResolveInfo $resolveInfo): void
* @param array $context
* @param ResolveInfo $resolveInfo
*/
public function __construct(AbstractListing $listing, $args, $context, ResolveInfo $resolveInfo = null)
public function __construct(AbstractListing $listing, $args, $context = [], ResolveInfo $resolveInfo = null)
{
$this->listing = $listing;
$this->args = $args;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function getInstance()
$fields = Helper::getCommonFields();
$fields['checked'] = [
'type' => Type::boolean(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function getInstance()
$fields = Helper::getCommonFields();
$fields['checked'] = [
'type' => Type::boolean(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getValue();
}
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/ClassificationstoreFeatureType/DateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getInstance()
'description' => 'see Carbon::format'
]
],
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
$dateValue = $value->getValue();
if ($dateValue instanceof Carbon) {
Expand Down
8 changes: 4 additions & 4 deletions src/GraphQL/ClassificationstoreFeatureType/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public static function getCommonFields()
$fields = [
'id' => [
'type' => Type::int(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getId();
}
}
],
'name' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
$keyConfig = KeyConfig::getById($value->getId());
if ($keyConfig) {
Expand All @@ -51,7 +51,7 @@ public static function getCommonFields()
],
'description' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
$keyConfig = KeyConfig::getById($value->getId());
if ($keyConfig) {
Expand All @@ -62,7 +62,7 @@ public static function getCommonFields()
],
'type' => [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getType();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static function getInstance(Service $service, string $name, $fieldname =
$fields = Helper::getCommonFields();
$fields[$fieldname] = [
'type' => Type::listOf(Type::string()),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function getInstance(Service $service, string $name, string $inner
$fields = Helper::getCommonFields();
$fields[$fieldname] = [
'type' => $innerType,
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getValue();
}
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/ClassificationstoreFeatureType/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function getInstance(string $name, string $valueField)
$fields = Helper::getCommonFields();
$fields[$valueField] = [
'type' => Type::string(),
'resolve' => static function ($value = null, $args = [], $context, ResolveInfo $resolveInfo = null) {
'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) {
if ($value instanceof FeatureDescriptor) {
return $value->getValue();
}
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/ClassificationstoreType/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function build(&$config)
'description' => Type::string(),
'features' => [
'type' => Type::listOf($this->featureType),
'resolve' => function ($value, $args, $context, ResolveInfo $resolveInfo = null) {
'resolve' => function ($value, $args, $context = [], ResolveInfo $resolveInfo = null) {
/** @var Classificationstore $csValue */
$csValue = $value["_csValue"];
$groupId = $value["id"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class
return $this->enrichConfig($fieldDefinition, $class, $attribute, [
'name' => $fieldDefinition->getName(),
'type' => $this->getFieldType($fieldDefinition, $class, $container),
'resolve' => function ($value, $args, $context, ResolveInfo $resolveInfo = null) use ($fieldDefinition, $attribute) {
'resolve' => function ($value, $args, $context = [], ResolveInfo $resolveInfo = null) use ($fieldDefinition, $attribute) {
$result = Service::resolveValue($value, $fieldDefinition, $attribute, $args);

// The table has no specific definition of columns, so we cannot have a ObjectType in schema for it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class
'type' => $this->getFieldType($fieldDefinition, $class, $container),
'args' => ['language' => ['type' => Type::string()]],
'description' => "returns a list of group containers",
'resolve' => function ($value, $args, $context, ResolveInfo $resolveInfo = null) {
'resolve' => function ($value, $args, $context = [], ResolveInfo $resolveInfo = null) {
$fieldName = $resolveInfo->fieldName;
$language = isset($args["language"]) ? $args["language"] : null;
/** @var $csField \Pimcore\Model\DataObject\Classificationstore*/
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/FieldHelper/AbstractFieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getArguments(FieldNode $ast)
*
* @return array
*/
public function extractData(&$data, $container, $args, $context, ResolveInfo $resolveInfo = null)
public function extractData(&$data, $container, $args, $context = [], ResolveInfo $resolveInfo = null)
{
if ($container instanceof ElementInterface) {
// we have to at least add the ID and pass it around even if not requested because we need it internally
Expand Down
8 changes: 4 additions & 4 deletions src/GraphQL/Resolver/AssetListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(Service $graphQlService, EventDispatcherInterface $e
* @param ResolveInfo|null $resolveInfo
* @return mixed
*/
public function resolveEdges($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveEdges($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
return $value['edges'];
}
Expand All @@ -69,7 +69,7 @@ public function resolveEdges($value = null, $args = [], $context, ResolveInfo $r
* @param ResolveInfo|null $resolveInfo
* @return mixed
*/
public function resolveEdge($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveEdge($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
$element = $value['node'];

Expand All @@ -88,7 +88,7 @@ public function resolveEdge($value = null, $args = [], $context, ResolveInfo $re
* @return array
* @throws \Exception
*/
public function resolveListing($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveListing($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($args && isset($args['defaultLanguage'])) {
$this->getGraphQlService()->getLocaleService()->setLocale($args['defaultLanguage']);
Expand Down Expand Up @@ -210,7 +210,7 @@ static function ($fullpath) use ($db) {
* @param ResolveInfo|null $resolveInfo
* @return mixed
*/
public function resolveListingTotalCount($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveListingTotalCount($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
return $value['totalCount'];
}
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/Resolver/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct($typeName, $attributes, $class, $container)
}


public function resolve($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolve($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
/** @var \Pimcore\Bundle\DataHubBundle\GraphQL\Query\Operator\AbstractOperator $operatorImpl */
$operatorImpl = $this->getGraphQlService()->buildQueryOperator($this->typeName, $this->attributes);
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Resolver/Geobounds.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Geobounds
* @return \Pimcore\Model\DataObject\Data\GeoCoordinates
* @throws \Exception
*/
public function resolveNorthEast($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveNorthEast($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($value instanceof \Pimcore\Model\DataObject\Data\Geobounds) {
return $value->getNorthEast();
Expand All @@ -48,7 +48,7 @@ public function resolveNorthEast($value = null, $args = [], $context, ResolveInf
* @return \Pimcore\Model\DataObject\Data\GeoCoordinates
* @throws \Exception
*/
public function resolveSouthWest($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveSouthWest($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($value instanceof \Pimcore\Model\DataObject\Data\Geobounds) {
return $value->getSouthWest();
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Resolver/Geopoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Geopoint
* @return array
* @throws \Exception
*/
public function resolveLongitude($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveLongitude($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
// cannot be changed to GeoCoordinates due to BC reasons
if ($value instanceof \Pimcore\Model\DataObject\Data\Geopoint) {
Expand All @@ -49,7 +49,7 @@ public function resolveLongitude($value = null, $args = [], $context, ResolveInf
* @return array
* @throws \Exception
*/
public function resolveLatitude($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveLatitude($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
// cannot be changed to GeoCoordinates due to BC reasons
if ($value instanceof \Pimcore\Model\DataObject\Data\Geopoint) {
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Resolver/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Link
* @return array
* @throws \Exception
*/
public function resolveText($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveText($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($value instanceof \Pimcore\Model\DataObject\Data\Link) {
return $value->getText();
Expand All @@ -49,7 +49,7 @@ public function resolveText($value = null, $args = [], $context, ResolveInfo $re
* @return array
* @throws \Exception
*/
public function resolvePath($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolvePath($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($value instanceof \Pimcore\Model\DataObject\Data\Link) {
return $value->getPath();
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/Resolver/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct($typeName = null, $attributes = null, $class = null,
* @return array
* @throws \Exception
*/
public function resolve($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolve($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
/** @var $operatorImpl \Pimcore\Bundle\DataHubBundle\GraphQL\Query\Operator\AbstractOperator */
$operatorImpl = $this->getGraphQlService()->buildQueryOperator($this->typeName, $this->attributes);
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Resolver/MultihrefMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct($fieldDefinition = null, $class = null, $fieldHelper
* @return array
* @throws \Exception
*/
public function resolveElement($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveElement($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
$element = null;

Expand Down Expand Up @@ -95,7 +95,7 @@ public function resolveElement($value = null, $args = [], $context, ResolveInfo
* @return array
* @throws \Exception
*/
public function resolveMetadata($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveMetadata($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($value && $value['element']) {

Expand Down
4 changes: 2 additions & 2 deletions src/GraphQL/Resolver/ObjectMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct($fieldDefinition = null, $class = null, $fieldHelper
* @return array
* @throws \Exception
*/
public function resolveElement($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveElement($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
$element = null;

Expand Down Expand Up @@ -92,7 +92,7 @@ public function resolveElement($value = null, $args = [], $context, ResolveInfo
* @return array
* @throws \Exception
*/
public function resolveMetadata($value = null, $args = [], $context, ResolveInfo $resolveInfo = null)
public function resolveMetadata($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
if ($value && $value['element']) {

Expand Down
Loading

0 comments on commit e5a54cc

Please sign in to comment.