-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.php
38 lines (35 loc) · 1.13 KB
/
App.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Dfe\Zoho;
/**
* 2017-07-06
* @see \Dfe\ZohoBI\App
* @see \Dfe\ZohoCRM\App
*/
abstract class App {
/**
* 2017-07-06
* @final I do not use the PHP «final» keyword here to allow refine the return type using PHPDoc.
*/
function ss():Settings {return dfs($this);}
/**
* 2017-07-06 It returns one of the following strings: «Books», «CRM», «Inventory».
* @used-by self::titleLc()
* @used-by \Dfe\ZohoBI\API\Validator::title()
*/
final function title():string {return dfc($this, function():string {return df_assert_in(df_result_sne(
# 2017-07-09 An alternative implementation is: df_explode_camel(df_class_second($this))[1]
df_trim_text_left(df_class_second($this), 'Zoho')
), ['Books', 'CRM', 'Inventory']);});}
/**
* 2017-07-06 It returns one of the following strings: «books», «crm», «inventory»
* @used-by \Dfe\ZohoBI\API\Client::urlBase()
* @used-by \Dfe\Zoho\Settings::prefix()
*/
final function titleLc():string {return strtolower($this->title());}
/**
* 2017-07-07
* @used-by df_zoho_app()
* @param string|object $c
*/
final static function s($c):self {return dfs_con($c);}
}