Skip to content

Commit

Permalink
Update stubs for version 3.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Screenfeed committed Jun 10, 2024
1 parent d5cc912 commit 0d3dde3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ These stubs can help plugin and theme developers leverage static analysis tools

Stubs are generated directly from the source using [php-stubs/generator](https://github.com/php-stubs/generator).

### Requirements
## Requirements

- PHP >=7.1

### Installation
## Installation

Require this package as a development dependency with Composer.

```bash
composer require --dev wpsyntex/polylang-stubs
```

### Usage in PHPStan
## Usage in PHPStan

Include the stubs in the PHPStan configuration file.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"homepage": "https://polylang.pro",
"type": "library",
"require-dev": {
"php": "~7.1",
"php-stubs/generator": "^0.8.1"
"php": ">=7.1",
"php-stubs/generator": "^0.8.4"
},
"suggest": {
"wpsyntex/polylang-phpstan": "Polylang extension for PHPStan"
Expand Down
26 changes: 9 additions & 17 deletions polylang-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,9 @@ class Data extends \PLL_Export_Data
{
/**
* Adds a source string to exported data and optionally a pre-existing translated one.
*
* @todo What should we do for encoding?
* New types or objects are prepended to data arrays, assuming they are linked to previously added ones.
* Once translated, this allows to import linked objects before the objects they are linked to.
* For example, a category is imported before the post it is linked to.
*
* @since 3.6
*
Expand Down Expand Up @@ -3633,7 +3634,7 @@ public function __construct(&$rest_api, $content_types)
{
}
/**
* Filters the query per language according to the 'lang' parameter.
* Filters the query per language according to the 'lang' parameter from the REST request.
*
* @since 2.6.9
*
Expand All @@ -3644,12 +3645,13 @@ public function parse_query($query)
{
}
/**
* Whether or not the given query is filterable by language.
* Tells whether or not the given query is filterable by language.
*
* @since 3.2
*
* @param WP_Query $query The query to check.
* @return boolean
* @return bool True if filterable by language. False if the query is already filtered,
* no language has been passed in the request or the post type is not supported.
*/
protected function can_filter_query($query)
{
Expand Down Expand Up @@ -18037,16 +18039,6 @@ public function get_language_from_url($url = '')
public function home_url($language)
{
}
/**
* Optionally removes 'language' in permalinks so that we get http://www.myblog/en/ instead of http://www.myblog/language/en/.
*
* @since 1.2
*
* @return void
*/
public function add_permastruct()
{
}
/**
* Prepares the rewrite rules filters.
*
Expand Down Expand Up @@ -21517,7 +21509,7 @@ protected function remove_add_meta_action()
*
* @return void
*/
protected function remove_all_meta_actions()
public function remove_all_meta_actions()
{
}
/**
Expand All @@ -21537,7 +21529,7 @@ protected function restore_add_meta_action()
*
* @return void
*/
protected function add_all_meta_actions()
public function add_all_meta_actions()
{
}
/**
Expand Down

0 comments on commit 0d3dde3

Please sign in to comment.