PluginProbe
Packeta / 2.1
Packeta v2.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
← All changes | src/Packetery/Module/QueryProcessor.php +12 -11 1.6.22.1 View file →
@@ -6,9 +6,8 @@
6 6 */
7 7
8 8 declare( strict_types=1 );
9 9
10 -
11 10 namespace Packetery\Module;
12 11
13 12 use Packetery\Nette\Http\Request;
14 13
@@ -65,15 +64,15 @@
65 64 * Extends WP_Query to include custom table.
66 65 *
67 66 * @link https://wordpress.stackexchange.com/questions/50305/how-to-extend-wp-query-to-include-custom-table-in-query
68 67 *
69 - * @param array $clauses Clauses.
70 - * @param \WP_Query $queryObject WP_Query.
68 + * @param array<string, string> $clauses Clauses.
69 + * @param \WP_Query $queryObject WP_Query.
71 70 *
72 - * @return array
71 + * @return array<string, string>
73 72 */
74 73 public function processClauses( array $clauses, \WP_Query $queryObject ): array {
75 - if ( false === $this->contextResolver->isOrderGridPage() ) {
74 + if ( $this->contextResolver->isOrderGridPage() === false ) {
76 75 return $clauses;
77 76 }
78 77
79 78 $isOrderPostQueryCall =
@@ -78,12 +77,12 @@
78 77
79 78 $isOrderPostQueryCall =
80 79 isset( $queryObject->query['post_type'] ) &&
81 80 (
82 - 'shop_order' === $queryObject->query['post_type'] ||
81 + $queryObject->query['post_type'] === 'shop_order' ||
83 82 ( is_array( $queryObject->query['post_type'] ) && in_array( 'shop_order', $queryObject->query['post_type'], true ) )
84 83 );
85 - if ( false === $isOrderPostQueryCall ) {
84 + if ( $isOrderPostQueryCall === false ) {
86 85 return $clauses;
87 86 }
88 87
89 88 return $this->orderRepository->processClauses(
@@ -95,14 +94,14 @@
95 94
96 95 /**
97 96 * Extends High-Performance order storage grid filters.
98 97 *
99 - * @param array $clauses Clauses.
98 + * @param array<string, string> $clauses Clauses.
100 99 *
101 - * @return array
100 + * @return array<string, string>
102 101 */
103 102 public function processHposClauses( array $clauses ): array {
104 - if ( false === $this->contextResolver->isOrderGridPage() ) {
103 + if ( $this->contextResolver->isOrderGridPage() === false ) {
105 104 return $clauses;
106 105 }
107 106
108 107 return $this->orderRepository->processClauses(
@@ -114,9 +113,9 @@
114 113
115 114 /**
116 115 * Gets param values.
117 116 *
118 - * @return null[]
117 + * @return array<string,null>
119 118 */
120 119 private function getParamValues(): array {
121 120 $paramValues = [
122 121 'packetery_carrier_id' => null,
@@ -122,8 +121,10 @@
122 121 'packetery_carrier_id' => null,
123 122 'packetery_to_submit' => null,
124 123 'packetery_to_print' => null,
125 124 'packetery_order_type' => null,
125 + 'orderby' => null,
126 + 'order' => null,
126 127 ];
127 128
128 129 foreach ( $paramValues as $key => $value ) {
129 130 $paramValues[ $key ] = $this->httpRequest->getQuery( $key );