| Conditions | 4 |
| Paths | 2 |
| Total Lines | 30 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| 1 | <?php |
||
| 22 | public function replyToLoadTab( $oAdminPage ) { |
||
| 23 | |||
| 24 | $_aItems = $this->getContentsByHeader( $this->getReadmeContents(), 3 ); |
||
| 25 | $_iLastIndex = count( $_aItems ) - 1; |
||
| 26 | foreach( $_aItems as $_iIndex => $_aContent ) { |
||
| 27 | |||
| 28 | $_oParser = new AdminPageFramework_WPReadmeParser; |
||
| 29 | $_oParser->setText( $_aContent[ 1 ] ); |
||
| 30 | $_sContent = $_oParser->get(); |
||
| 31 | $oAdminPage->addSettingSections( |
||
| 32 | $this->sPageSlug, // the target page slug |
||
| 33 | array( |
||
| 34 | 'section_id' => 'examples_' . $_iIndex, |
||
| 35 | 'title' => $_aContent[ 0 ], |
||
| 36 | 'collapsible' => array( |
||
| 37 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
||
| 38 | ? array( 'bottom-right' ) |
||
| 39 | : ( 0 === $_iIndex |
||
| 40 | ? array( 'top-right' ) |
||
| 41 | : false |
||
| 42 | ), |
||
| 43 | ), |
||
| 44 | 'content' => $_sContent, |
||
| 45 | |||
| 46 | ) |
||
| 47 | ); |
||
| 48 | |||
| 49 | } |
||
| 50 | |||
| 51 | } |
||
| 52 | /** |
||
| 63 | } |
||
|
1 ignored issue
–
show
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.