Completed
Push — hotfix/issues-cleanup ( e704f7 )
by Todd
08:40
created

IQuery.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace pQuery;
4
5
interface IQuery {
6
   /// Methods ///
7
8
   /**
9
    * Adds the specified class(es) to each of the set of matched elements.
10
    * @param string $classname The name of the class to add. You can add multiple classes by separating them with spaces.
11
    * @return IQuery
12
    */
13
   function addClass($classname);
14
15
   /**
16
    * Insert content, specified by the parameter, after each element in the set of matched elements.
17
    * @param string $content The content to add.
18
    * @return IQuery
19
    */
20
   function after($content);
21
22
   /**
23
    * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
24
    * @param string $content The content to append.
25
    * @return IQuery
26
    */
27
   function append($content);
28
29
   /**
30
    * Get the value of an attribute for the first element in the set of matched elements or set one
31
    * or more attributes for every matched element.
32
    * @param string $name The name of the attribute.
33
    * @param null|string $value The value to set or null to get the current attribute value.
34
    * @return string|IQuery
35
    */
36
   function attr($name, $value = null);
37
38
   /**
39
    * Insert content, specified by the parameter, before each element in the set of matched elements.
40
    * @param string $content The content to add.
41
    * @return IQuery
42
    */
43
   function before($content);
44
45
   /**
46
    * Remove all child nodes of the set of matched elements from the DOM.
47
    * @return IQuery;
0 ignored issues
show
The doc-type IQuery; could not be parsed: Expected "|" or "end of type", but got ";" at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
48
    */
49
   function clear();
50
51
   /**
52
    * Gets the count of matched elements.
53
    * @return int Returns the number of matched elements.
54
    */
55
   function count();
56
57
   /**
58
    * Get the value of a style property for the first element in the set of matched elements or
59
    * set one or more CSS properties for every matched element.
60
    */
61
//   function css($name, $value = null);
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
62
63
   /**
64
    * Determine whether any of the matched elements are assigned the given class.
65
    * @param string $classname The name of the class to check.
66
    */
67
   function hasClass($classname);
68
69
   /**
70
    * Get the HTML contents of the first element in the set of matched elements
71
    * or set the HTML contents of every matched element.
72
    * @param string|null $value The value to set.
73
    */
74
   function html($value = null);
75
76
   /**
77
    * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
78
    * @param string $content The content to add.
79
    */
80
   function prepend($content);
81
82
   /**
83
    * Get the value of a property for the first element in the set of matched elements
84
    * or set one or more properties for every matched element.
85
    * @param string $name The name of the property.
86
    * The currently supported properties are `tagname`, `selected`, and `checked`.
87
    * @param null|string $value The value to set or null to get the current property value.
88
    */
89
   function prop($name, $value = null);
90
91
   /**
92
    * Remove the set of matched elements from the DOM.
93
    * @param null|string $selector A css query to filter the set of removed nodes.
94
    */
95
   function remove($selector = null);
96
97
   /**
98
    * Remove an attribute from each element in the set of matched elements.
99
    * @param string $name The name of the attribute to remove.
100
    */
101
   function removeAttr($name);
102
103
   /**
104
    * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
105
    * @param string $classname The name of the class to remove.
106
    */
107
   function removeClass($classname);
108
109
   /**
110
    * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
111
    * @param string $content The content that will replace the nodes.
112
    */
113
   function replaceWith($content);
114
115
   /**
116
    * Returns the name of the element.
117
    * @param null|string $tagName A new tag name or null to return the current tag name.
0 ignored issues
show
There is no parameter named $tagName. Was it maybe removed?

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 method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
118
    */
119
   function tagName($value = null);
120
121
   /**
122
    * Get the combined text contents of each element in the set of matched elements, including their descendants, or set the text contents of the matched elements.
123
    * @param null|string $value A string to set the text or null to return the current text.
124
    */
125
   function text($value = null);
126
127
   /**
128
    * Add or remove one or more classes from each element in the set of matched elements,
129
    * depending on either the class’s presence or the value of the switch argument.
130
    * @param string $classname
131
    * @param bool|null
132
    */
133
   function toggleClass($classname, $switch = null);
134
135
   /**
136
    * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
137
    */
138
   function unwrap();
139
140
   /**
141
    * Get the current value of the first element in the set of matched elements or set the value of every matched element.
142
    * @param string|null $value The new value of the element or null to return the current value.
143
    */
144
   function val($value = null);
145
146
   /**
147
    * Wrap an HTML structure around each element in the set of matched elements.
148
    * @param string A tag name or html string specifying the structure to wrap around the matched elements.
149
    */
150
   function wrap($wrapping_element);
151
152
   /**
153
    * Wrap an HTML structure around the content of each element in the set of matched elements.
154
    * @param string A tag name or html string specifying the structure to wrap around the content of the matched elements.
155
    */
156
   function wrapInner($wrapping_element);
157
}
158
159