Skip to content

Commit

Permalink
TASK: Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
albe authored Mar 22, 2021
1 parent 6d3c5ca commit 23f4bc3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ protected function autowireProperties(array &$objectConfigurations)
try {
$classMethodNames = get_class_methods($className);
} catch (\TypeError $error) {
throw new UnknownClassException(sprintf('The class "%s" defined in the object configuration for object "%s", defined in package: %s, does not exist.', $className, $objectConfiguration->getObjectName(), $objectConfiguration->getPackageKey()), 1352371371);
throw new UnknownClassException(sprintf('The class "%s" defined in the object configuration for object "%s", defined in package: %s, does not exist.', $className, $objectConfiguration->getObjectName(), $objectConfiguration->getPackageKey()), 1352371372);
}
if (!is_array($classMethodNames)) {
if (!class_exists($className)) {
Expand Down
1 change: 1 addition & 0 deletions Neos.Flow/Classes/Reflection/ReflectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,7 @@ protected function convertParameterReflectionToArray(ParameterReflection $parame
$parameterInformation[self::DATA_PARAMETER_CLASS] = $parameterType;
} elseif ($parameterType === 'array') {
$parameterInformation[self::DATA_PARAMETER_ARRAY] = true;
$parameterInformation[self::DATA_PARAMETER_TYPE] = $parameterType;
} else {
$builtinType = $parameter->getBuiltinType();
if ($builtinType !== null) {
Expand Down
14 changes: 7 additions & 7 deletions Neos.Flow/Tests/Unit/SignalSlot/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function dispatchPassesTheSignalArgumentsToTheSlotMethod(): void
$dispatcher->connect('Foo', 'bar', $mockSlot, '', false);
$dispatcher->injectObjectManager($mockObjectManager);

$dispatcher->dispatch('Foo', 'bar', ['bar', 'quux']);
$dispatcher->dispatch('Foo', 'bar', ['foo' => 'bar', 'baz' => 'quux']);
self::assertSame(['bar', 'quux'], $arguments);
}

Expand All @@ -160,7 +160,7 @@ public function dispatchPassesTheSignalArgumentsToTheStaticSlotMethod(): void
$dispatcher->connect('Foo', 'bar', get_class($this), '::staticSlot', false);
$dispatcher->injectObjectManager($mockObjectManager);

$dispatcher->dispatch('Foo', 'bar', ['bar', 'quux']);
$dispatcher->dispatch('Foo', 'bar', ['foo' => 'bar', 'baz' => 'quux']);
self::assertSame(['bar', 'quux'], self::$arguments);
}

Expand All @@ -172,8 +172,8 @@ public function dispatchPassesTheSignalArgumentsToTheStaticSlotMethodIfNoObjectm
$dispatcher = new Dispatcher();
$dispatcher->connect('Foo', 'bar', get_class($this), '::staticSlot', false);

$dispatcher->dispatch('Foo', 'bar', ['no', 'object', 'manager', 'exists']);
self::assertSame(['no', 'object', 'manager', 'exists'], self::$arguments);
$dispatcher->dispatch('Foo', 'bar', ['no' => 'object', 'manager' => 'exists']);
self::assertSame(['object', 'exists'], self::$arguments);
}

/**
Expand Down Expand Up @@ -210,7 +210,7 @@ public function dispatchRetrievesSlotInstanceFromTheObjectManagerIfOnlyAClassNam
$dispatcher->injectObjectManager($mockObjectManager);
$dispatcher->connect('Foo', 'bar', $slotClassName, 'slot', false);

$dispatcher->dispatch('Foo', 'bar', ['bar', 'quux']);
$dispatcher->dispatch('Foo', 'bar', ['foo' => 'bar', 'baz' => 'quux']);
self::assertSame($mockSlot->arguments, ['bar', 'quux']);
}

Expand Down Expand Up @@ -247,7 +247,7 @@ public function dispatchThrowsAnExceptionIfTheSpecifiedSlotMethodDoesNotExist():
$dispatcher->injectObjectManager($mockObjectManager);
$dispatcher->connect('Foo', 'bar', $slotClassName, 'unknownMethodName', true);

$dispatcher->dispatch('Foo', 'bar', ['bar', 'quux']);
$dispatcher->dispatch('Foo', 'bar', ['foo' => 'bar', 'baz' => 'quux']);
}

/**
Expand All @@ -266,7 +266,7 @@ public function dispatchPassesArgumentContainingSlotInformationLastIfTheConnecti
$dispatcher->connect('SignalClassName', 'methodName', $mockSlot, '', true);
$dispatcher->injectObjectManager($mockObjectManager);

$dispatcher->dispatch('SignalClassName', 'methodName', ['bar', 'quux']);
$dispatcher->dispatch('SignalClassName', 'methodName', ['foo' => 'bar', 'baz' => 'quux']);
self::assertSame(['bar', 'quux', 'SignalClassName::methodName'], $arguments);
}

Expand Down

0 comments on commit 23f4bc3

Please sign in to comment.