Skip to content

Commit

Permalink
Merge pull request #7 from skaut/WP_Widget
Browse files Browse the repository at this point in the history
Added stubs for WP_Widget
  • Loading branch information
marekdedic authored Dec 8, 2019
2 parents f8966c6 + 32a7db1 commit 9dd927a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
42 changes: 42 additions & 0 deletions stubs/WordPress/class-wp-widget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* @package phan-wordpress-stubs
*/

/**
*/
class WP_Widget {
/**
* @param string $id_base
* @param string $name
* @param array $widget_options {
* @type string $classname
* @type string $description
* }
* @param array $control_options {
* @type int $height
* @type int $width
* @type int|string $id_base
* }
*/
public function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
}

/**
* @param array $args {
* @type string after_title
* @type string after_widget
* @type string before_title
* @type string before_widget
* @type string class
* @type string description
* @type string id
* @type string name
* @type string widget_id
* @type string widget_name
* }
* @param array $instance
*/
public function widget( $args, $instance ) {
}
}
6 changes: 6 additions & 0 deletions stubs/WordPress/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ function register_block_type( $name, $args = [] ) {
function register_setting( $option_group, $option_name, $args = [] ) {
}

/**
* @param string|WP_Widget $widget
*/
function register_widget( $widget ) {
}

/**
* @param string $tag
* @param callable $function_to_remove
Expand Down

0 comments on commit 9dd927a

Please sign in to comment.