| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | public static function get_block_attributes() { |
||
| 62 | $reflector = new \ReflectionClass( get_called_class() ); |
||
| 63 | $attributes_file = dirname( $reflector->getFileName() ) . '/config.json'; |
||
| 64 | |||
| 65 | if ( ! file_exists( $attributes_file ) ) { |
||
| 66 | return array(); |
||
| 67 | } |
||
| 68 | |||
| 69 | try { |
||
| 70 | $attributes = json_decode( file_get_contents( $attributes_file ), true ); |
||
| 71 | } catch ( \Exception $e ) { |
||
| 72 | $attributes = array(); |
||
| 73 | } |
||
| 74 | |||
| 75 | return $attributes; |
||
| 76 | } |
||
| 77 | } |
||
| 78 |