2023/06/24
Jump to navigation
Jump to search
Saturday, June 24, 2023 (#175)
|
Notes
the problem flows like this: in if ( is_array( $rec ) || is_string( $rec ) || is_callable( $rec ) ) {
$page = $this->objectFactory->createObject( $rec, [ 'allowClassName' => true,'allowCallable' => true ]);
}
...which implies that it should be perfectly okay to call createObject() with a string, but then we have if ( is_string( $spec ) && class_exists( $spec ) ) {
if ( empty( $options['allowClassName'] ) ) {
throw new InvalidArgumentException('Passing a raw class name is not allowed here. Use [ \'class\' => $classname ] instead.');
}
return [ 'class' => $spec ];
}
if ( !is_array( $spec ) ) {
throw new InvalidArgumentException( 'Provided specification is not an array.' );
}
...so I think what I'm getting from that is that it's only okay to call So then we have the questions:
|