Skip to content

Commit

Permalink
refactor: remove superfluous type checks
Browse files Browse the repository at this point in the history
Types are now checked at function call, so we can assume the type is
always correct at time of execution.
  • Loading branch information
stklcode committed Mar 24, 2024
1 parent 59fc283 commit dc406b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/Helpers/InterfaceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function class_implements_interface( string $class_name, string $i
* @return bool
*/
public static function class_implements_interfaces( string $class_name, array $interfaces ): bool {
if ( ! is_string( $class_name ) || ! class_exists( $class_name ) ) {
if ( ! class_exists( $class_name ) ) {
return false;
}

Expand Down
4 changes: 0 additions & 4 deletions src/Helpers/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ public static function get_option( string $option_name, string $type = 'general'
* @return null|mixed Value at given path, if present.
*/
public static function get_array_value_by_path( string $path, array $array ) {
if ( ! is_array( $array ) ) {
return null;
}

$path_array = self::get_path_parts( $path );
if ( empty( $path_array ) ) {
return null;
Expand Down

0 comments on commit dc406b3

Please sign in to comment.