Skip to content

Commit

Permalink
Fix docblock for CMB2_Type_Base::__call
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed May 30, 2018
1 parent dd34a4d commit 96f43b9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions includes/types/CMB2_Type_Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,21 @@ protected function parse_args_from_overrides( $type_overrides = array() ) {
/**
* Fall back to CMB2_Types methods
*
* @param string $field
* @param string $method
* @param array $arguments
* @throws Exception Throws an exception if the field is invalid.
* @return mixed
*/
public function __call( $name, $arguments ) {
switch ( $name ) {
public function __call( $method, $arguments ) {
switch ( $method ) {
case '_id':
case '_name':
case '_desc':
case '_text':
case 'concat_attrs':
return call_user_func_array( array( $this->types, $name ), $arguments );
return call_user_func_array( array( $this->types, $method ), $arguments );
default:
throw new Exception( sprintf( esc_html__( 'Invalid %1$s method: %2$s', 'cmb2' ), __CLASS__, $name ) );
throw new Exception( sprintf( esc_html__( 'Invalid %1$s method: %2$s', 'cmb2' ), __CLASS__, $method ) );
}
}

Expand Down

0 comments on commit 96f43b9

Please sign in to comment.