Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
16 | array( |
||
17 | 'render_callback' => 'jetpack_tiled_gallery_load_block_assets', |
||
18 | ) |
||
19 | ); |
||
20 | |||
21 | /** |
||
22 | * Tiled gallery block registration/dependency declaration. |
||
23 | * |
||
24 | * @param array $attr Array containing the block attributes. |
||
25 | * @param string $content String containing the block content. |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | function jetpack_tiled_gallery_load_block_assets( $attr, $content ) { |
||
46 | } |
||
47 |