@@ -13,30 +13,18 @@ class SplitManager implements SplitManagerInterface
1313{
1414 public function splitNames ()
1515 {
16- try {
17- $ cache = new SplitCache ();
18- return $ cache ->getSplitNames ();
19- } catch (\Exception $ e ) {
20- SplitApp::logger ()->critical ('splitNames method is throwing exceptions ' );
21- SplitApp::logger ()->critical ($ e ->getMessage ());
22- return [];
23- }
16+ $ cache = new SplitCache ();
17+ return $ cache ->getSplitNames ();
2418 }
2519
2620 /**
2721 * @return array
2822 */
2923 public function splits ()
3024 {
31- try {
32- $ cache = new SplitCache ();
33- $ rawSplits = $ cache ->getAllSplits ();
34- return array_map ('self::parseSplitView ' , $ rawSplits );
35- } catch (\Exception $ e ) {
36- SplitApp::logger ()->critical ('splits method is throwing exceptions ' );
37- SplitApp::logger ()->critical ($ e ->getMessage ());
38- return [];
39- }
25+ $ cache = new SplitCache ();
26+ $ rawSplits = $ cache ->getAllSplits ();
27+ return array_map ('self::parseSplitView ' , $ rawSplits );
4028 }
4129
4230 /**
@@ -45,26 +33,20 @@ public function splits()
4533 */
4634 public function split ($ featureName )
4735 {
48- try {
49- $ featureName = InputValidator::validateFeatureName ($ featureName , 'split ' );
50- if (is_null ($ featureName )) {
51- return null ;
52- }
36+ $ featureName = InputValidator::validateFeatureName ($ featureName , 'split ' );
37+ if (is_null ($ featureName )) {
38+ return null ;
39+ }
5340
54- $ cache = new SplitCache ();
55- $ raw = $ cache ->getSplit ($ featureName );
56- if (is_null ($ raw )) {
57- SplitApp::logger ()->warning ("split: you passed " . $ featureName
58- . " that does not exist in this environment, please double check what Splits exist "
59- . " in the web console. " );
60- return null ;
61- }
62- return self ::parseSplitView ($ raw );
63- } catch (\Exception $ e ) {
64- SplitApp::logger ()->critical ('split method is throwing exceptions ' );
65- SplitApp::logger ()->critical ($ e ->getMessage ());
41+ $ cache = new SplitCache ();
42+ $ raw = $ cache ->getSplit ($ featureName );
43+ if (is_null ($ raw )) {
44+ SplitApp::logger ()->warning ("split: you passed " . $ featureName
45+ . " that does not exist in this environment, please double check what Splits exist "
46+ . " in the web console. " );
6647 return null ;
6748 }
49+ return self ::parseSplitView ($ raw );
6850 }
6951
7052 /**
0 commit comments