1 | <?php |
||
24 | class PrivacyPolicyManager |
||
25 | { |
||
26 | |||
27 | public function __construct() |
||
31 | |||
32 | |||
33 | /** |
||
34 | * For all the registered `PrivacyPolicyInterface`s, add their privacy policy content |
||
35 | * |
||
36 | * @param WP_Post $post |
||
|
|||
37 | */ |
||
38 | public function addPrivacyPolicy() |
||
39 | { |
||
40 | $policy_page_id = (int) get_option('wp_page_for_privacy_policy'); |
||
41 | if (! $policy_page_id) { |
||
42 | return; |
||
43 | } |
||
44 | // load all the privacy policy stuff |
||
45 | // add post policy text |
||
46 | foreach ($this->loadPrivacyPolicyCollection() as $privacy_policy) { |
||
47 | wp_add_privacy_policy_content($privacy_policy->getName(), $privacy_policy->getContent()); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | |||
52 | /** |
||
53 | * @return CollectionInterface|PrivacyPolicyInterface[] |
||
54 | * @throws InvalidIdentifierException |
||
55 | * @throws InvalidInterfaceException |
||
56 | * @throws InvalidFilePathException |
||
57 | * @throws InvalidEntityException |
||
58 | * @throws InvalidDataTypeException |
||
59 | * @throws InvalidClassException |
||
60 | */ |
||
61 | protected function loadPrivacyPolicyCollection() |
||
85 | } |
||
86 | // End of file PrivacyPolicyManager.php |
||
88 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.