57 public function register( $name, $displayName, $callback ) {
58 if ( !is_callable( $callback ) ) {
59 throw new InvalidArgumentException(
'Invalid callback provided' );
61 $this->factoryFunctions[$name] = $callback;
62 $this->displayNames[$name] = $displayName;
83 if ( !isset( $this->factoryFunctions[$name] ) ) {
84 throw new SkinException(
"No registered builder available for $name." );
86 $skin = call_user_func( $this->factoryFunctions[$name], $name );
87 if ( $skin instanceof
Skin ) {
90 throw new UnexpectedValueException(
"The builder for $name returned a non-Skin object." );