@@ -91,6 +91,9 @@ discard block |
||
91 | 91 | $this->data = apply_filters( 'amp_post_template_data', $this->data, $this->post ); |
92 | 92 | } |
93 | 93 | |
94 | + /** |
|
95 | + * @param string $property |
|
96 | + */ |
|
94 | 97 | public function get( $property, $default = null ) { |
95 | 98 | if ( isset( $this->data[ $property ] ) ) { |
96 | 99 | return $this->data[ $property ]; |
@@ -114,6 +117,9 @@ discard block |
||
114 | 117 | $this->load_parts( array( 'single' ) ); |
115 | 118 | } |
116 | 119 | |
120 | + /** |
|
121 | + * @param string[] $templates |
|
122 | + */ |
|
117 | 123 | public function load_parts( $templates ) { |
118 | 124 | foreach ( $templates as $template ) { |
119 | 125 | $file = $this->get_template_path( $template ); |
@@ -133,6 +139,9 @@ discard block |
||
133 | 139 | $this->data[ $key ] = $value; |
134 | 140 | } |
135 | 141 | |
142 | + /** |
|
143 | + * @param string $key |
|
144 | + */ |
|
136 | 145 | private function merge_data_for_key( $key, $value ) { |
137 | 146 | if ( is_array( $this->data[ $key ] ) ) { |
138 | 147 | $this->data[ $key ] = array_merge( $this->data[ $key ], $value ); |
@@ -373,6 +382,9 @@ discard block |
||
373 | 382 | $this->add_data_by_key( 'html_tag_attributes', $attributes ); |
374 | 383 | } |
375 | 384 | |
385 | + /** |
|
386 | + * @param string $file |
|
387 | + */ |
|
376 | 388 | private function verify_and_include( $file, $template_type ) { |
377 | 389 | $located_file = $this->locate_template( $file ); |
378 | 390 | if ( $located_file ) { |
@@ -78,6 +78,9 @@ |
||
78 | 78 | ); |
79 | 79 | } |
80 | 80 | |
81 | + /** |
|
82 | + * @param string $url |
|
83 | + */ |
|
81 | 84 | private function get_instagram_id_from_url( $url ) { |
82 | 85 | $found = preg_match( self::URL_PATTERN, $url, $matches ); |
83 | 86 |
@@ -90,6 +90,9 @@ |
||
90 | 90 | ); |
91 | 91 | } |
92 | 92 | |
93 | + /** |
|
94 | + * @param string $url |
|
95 | + */ |
|
93 | 96 | private function get_video_id_from_url( $url ) { |
94 | 97 | $video_id = false; |
95 | 98 | $parsed_url = parse_url( $url ); |
@@ -197,6 +197,9 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | |
200 | + /** |
|
201 | + * @param integer $n |
|
202 | + */ |
|
200 | 203 | private function getChars($n) |
201 | 204 | { |
202 | 205 | $response = null; |
@@ -238,6 +241,9 @@ discard block |
||
238 | 241 | } |
239 | 242 | |
240 | 243 | |
244 | + /** |
|
245 | + * @param false|string $str |
|
246 | + */ |
|
241 | 247 | private function readInt($str) |
242 | 248 | { |
243 | 249 | $size = unpack("C*", $str); |