Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
Themes
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 get
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 get_approved
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 check_approved
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2namespace NewfoldLabs\WP\Module\Installer\Data;
3
4/**
5 * Class containing Theme related data.
6 */
7final class Themes {
8    /*
9    A value of true indicates that the slug has been approved.
10    A value of null indicates that the slug has not been approved
11    (or) has been temporarily deactivated.
12    */
13
14    /**
15     * Contains a list of zipped theme url's with a unique "nfd_slug" for each.
16     *
17     * @var array
18     */
19    protected static $nfd_slugs = array(
20        'nfd_slug_yith_wonder' => array(
21            'approved'   => true,
22            'url'        => 'https://hiive.cloud/workers/plugin-downloads/yith-wonder-theme',
23            'stylesheet' => 'yith-wonder',
24        ),
25        'nfd_slug_bluehost_blueprint' => array(
26            'approved'   => true,
27            'url'        => 'https://hiive.cloud/workers/plugin-downloads/bluehost-blueprint-theme',
28            'stylesheet' => 'bluehost-blueprint',
29        ),
30    );
31
32    /**
33     * Use this return value for a faster search of slugs.
34     *
35     * @return array
36     */
37    public static function get() {
38        return array(
39            'nfd_slugs' => self::$nfd_slugs,
40        );
41    }
42
43    /**
44     * Get approved theme slugs.
45     *
46     * @return array
47     */
48    public static function get_approved() {
49        return array(
50            'nfd_slugs' => array_keys( array_filter( self::$nfd_slugs, array( __CLASS__, 'check_approved' ) ) ),
51        );
52    }
53    /**
54     * Checks if $value has been approved.
55     *
56     * @param array $value The value to check for.
57     * @return boolean
58     */
59    private static function check_approved( $value ) {
60        return true === $value['approved'];
61    }
62}