Skip to content

Commit

Permalink
0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jul 6, 2017
1 parent 18b3161 commit 00b790f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 40 deletions.
17 changes: 8 additions & 9 deletions API/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
abstract class Client extends \Df\API\Client {
/**
* 2017-07-06
* @return S
* @override
* @see \Df\API\Client::_construct()
* @used-by \Df\API\Client::__construct()
* @see \Df\ZohoBI\API\Client::_construct()
*/
final protected function ss() {return S::convention($this, S::class);}
protected function _construct() {parent::_construct(); $this->addFilterJsonDecode();}

/**
* 2017-07-05
* @override
* @see \Df\API\Client::responseFilterC()
* @used-by \Df\API\Client::p()
* @used-by p()
* @return string
* 2017-07-06
* @return S
*/
protected function responseFilterC() {return \Df\API\Response\Filter\JSON::class;}
final protected function ss() {return S::convention($this, S::class);}

/**
* 2017-07-06
Expand Down
41 changes: 41 additions & 0 deletions App.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
namespace Df\Zoho;
/**
* 2017-07-06
* @see \Df\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.
* @return Settings
*/
function ss() {return Settings::convention($this);}

/**
* 2017-07-06 It returns one of the following strings: «Books», «CRM», «Inventory».
* @used-by titleLc()
* @used-by \Df\ZohoBI\API\Validator::title()
* @return string
*/
final function title() {return dfc($this, function() {return df_assert_in(df_result_sne(
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 \Df\ZohoBI\API\Client::uriBase()
* @used-by \Df\Zoho\Settings::prefix()
* @return string
*/
final function titleLc() {return strtolower($this->title());}

/**
* 2017-07-06.
* @used-by df_zoho_app()
* @param string|object $c
* @return self
*/
final static function s($c) {return dfcf(function($c) {return df_new(df_con_heir($c, __CLASS__));}, [$c]);}
}
6 changes: 3 additions & 3 deletions Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
namespace Df\Zoho;
/**
* 2017-07-05
* @see \Df\ZohoBI\Settings
* @see \Dfe\ZohoBooks\Settings
* @see \Dfe\ZohoCRM\Settings
* @see \Dfe\ZohoInventory\Settings
* @method static Settings s()
*/
abstract class Settings extends \Df\Config\Settings {
/**
* 2017-07-05 «Authentication Token
* @used-by \Df\ZohoBI\API\Client::headers()
* @used-by \Df\ZohoBI\Source\Organization::isRequirementMet()
* @return string
*/
final function token() {return $this->p();}
Expand All @@ -23,6 +23,6 @@ final function token() {return $this->p();}
* @return string
*/
final protected function prefix() {return dfc($this, function() {return
'df_zoho/' . df_zoho_app_lc($this)
'df_zoho/' . df_zoho_app($this)->titleLc()
;});}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/zoho"
,"version": "0.0.4"
,"version": "0.0.5"
,"description": "A common Zoho applications library for my «Zoho CRM», «Zoho Inventory», and «Zoho Books» Magento 2 extensions."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/tags/zoho"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.7.38"}
,"require": {"mage2pro/core": ">=2.7.40"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Df\\Zoho\\": ""}}
,"keywords": [
"Zoho"
Expand Down
10 changes: 10 additions & 0 deletions lib/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
use Df\Zoho\App;
/**
* 2017-07-06
* @used-by \Df\ZohoBI\API\Validator::title()
* @used-by \Df\ZohoBI\Source\Organization::app()
* @param string|object $c
* @return App
*/
function df_zoho_app($c) {return App::s($c);}
26 changes: 0 additions & 26 deletions lib/reflection.php

This file was deleted.

0 comments on commit 00b790f

Please sign in to comment.