Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Remove set attribute via method
Browse files Browse the repository at this point in the history
  • Loading branch information
anhskohbo committed Apr 26, 2018
1 parent f3df187 commit 3d3f9bf
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/Object_Attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ public function get_attribute( $key ) {
* @return $this
*/
public function set_attribute( $key, $value ) {
$method = 'set_' . str_replace( '-', '_', $key );

// First, we'll check present of `set_$key()` method,
// if available just call that method.
if ( method_exists( $this, $method ) ) {
return $this->{$method}( $value );
}

// If not just set attribute by normally.
$this->attributes[ $key ] = $this->sanitize_attribute( $key, $value );

return $this;
Expand Down

0 comments on commit 3d3f9bf

Please sign in to comment.