From f359e1ed3afdb65f266b2846afe8120f0260bab3 Mon Sep 17 00:00:00 2001 From: Alex Slaughter Date: Sun, 31 Mar 2019 13:49:32 -0700 Subject: [PATCH 1/3] WIP --- .gitignore | 3 ++ .php_cs.dist | 41 ++++++++++++++++++++++++ CHANGELOG.md | 35 ++++++++++++++++++++ composer.json | 17 ++++++---- config/intercom.php | 31 ++++++++++++++++++ src/{Facade.php => Facades/Intercom.php} | 2 +- src/IntercomLaravel.php | 1 + src/ServiceProvider.php | 4 +-- 8 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 .php_cs.dist create mode 100644 CHANGELOG.md create mode 100644 config/intercom.php rename src/{Facade.php => Facades/Intercom.php} (82%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81b9258 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +composer.lock +phpunit.xml +vendor diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..0f6f75b --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,41 @@ +in(__DIR__); + +return PhpCsFixer\Config::create() + ->setRules([ + 'array_syntax' => ['syntax' => 'short'], + '@PSR2' => true, + 'array_indentation' => true, + 'blank_line_after_opening_tag' => true, + 'class_attributes_separation' => true, + 'concat_space' => ['spacing' => 'one'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'ordered_imports' => true, + 'trailing_comma_in_multiline_array' => true, + 'trim_array_spaces' => true, + 'ordered_class_elements' => [ + 'order' => [ + 'use_trait', + 'property_public_static', + 'property_protected_static', + 'property_private_static', + 'constant', + 'constant_public', + 'constant_protected', + 'constant_private', + 'property_public', + 'property_protected', + 'property_private', + 'construct', + 'destruct', + 'method_public', + 'method_protected', + 'method_private', + 'magic', + ], + 'sortAlgorithm' => 'alpha', + ], + ]) + ->setFinder($finder); diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..89b70f6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +CHANGE LOG +========== + + +## V4.0 (Mar 31, 2019) + +* Require PHP 7.0 or higher +* Require intercom/intercom-php v4.x +* Update facade location => `Facades/Intercom.php` +* CS formating file added +* Update composer.json file +* Changed config location from `services.intercom` => `intercom` +* Added sample config file + +## V3.2.0 (Sep 7, 2018) + +* Upgraded to laravel 5.0 +* Increased the minimum upstream version + + +## V3.1.8 (Aug 15, 2017) + +* Increased the minimum upstream version +* Moved to the MIT license + + +## V1.1.4 (May 24, 2016) + +* Increased the minimum upstream version +* Other minor tweaks + + +## V1.0 Alpha (May 24, 2016) + +* Initial testing release diff --git a/composer.json b/composer.json index 0097af8..708e529 100644 --- a/composer.json +++ b/composer.json @@ -8,22 +8,25 @@ "email": "alex@alexslaughter.com" }], "require": { - "intercom/intercom-php": "3.2.0", - "laravel/framework": ">=5.0" + "php": "^7.0", + "intercom/intercom-php": "4.0.2", + "laravel/framework": ">=5.1" }, "autoload": { "psr-4": { "Shadow\\IntercomLaravel\\": "src/" } }, + "config": { + "preferred-install": "dist" + }, "extra": { "laravel": { "providers": [ "Shadow\\IntercomLaravel\\ServiceProvider" - ], - "aliases": { - "Intercom": "Shadow\\IntercomLaravel\\Facade" - } + ] } - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/config/intercom.php b/config/intercom.php new file mode 100644 index 0000000..8f4fe8e --- /dev/null +++ b/config/intercom.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +return [ + /* + |-------------------------------------------------------------------------- + | Application ID + |-------------------------------------------------------------------------- + | + | Can be either an Application ID or a Token + | If you already have an access token you can find it [here](https://app.intercom.com/a/apps/_/developer-hub). + | If you want to create or learn more about access tokens then you can find more info [here](https://developers.intercom.com/building-apps/docs/authorization#section-access-tokens). + | + */ + 'app_id' => 'main', + /* + |-------------------------------------------------------------------------- + | Application Password + |-------------------------------------------------------------------------- + | + */ + 'api_key' => '', +]; diff --git a/src/Facade.php b/src/Facades/Intercom.php similarity index 82% rename from src/Facade.php rename to src/Facades/Intercom.php index 94de193..d828d8a 100644 --- a/src/Facade.php +++ b/src/Facades/Intercom.php @@ -1,6 +1,6 @@ intercom = new IntercomClient($id, $key); diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 0524e5d..c864c6b 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -10,8 +10,8 @@ class ServiceProvider extends IlluminateServiceProvider public function register() { $this->app->bind('intercom', function () { - $id = Config::get('services.intercom.app_id'); - $key = Config::get('services.intercom.api_key'); + $id = Config::get('intercom.app_id'); + $key = Config::get('intercom.api_key'); return new IntercomLaravel($id, $key); }); From 6d9de28d154f61e5d5d70232433b6d697ce2689c Mon Sep 17 00:00:00 2001 From: Alex Slaughter Date: Sun, 31 Mar 2019 13:51:13 -0700 Subject: [PATCH 2/3] Update .php_cs.dist --- .php_cs.dist | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index 0f6f75b..657bfea 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -6,36 +6,6 @@ return PhpCsFixer\Config::create() ->setRules([ 'array_syntax' => ['syntax' => 'short'], '@PSR2' => true, - 'array_indentation' => true, - 'blank_line_after_opening_tag' => true, - 'class_attributes_separation' => true, - 'concat_space' => ['spacing' => 'one'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'ordered_imports' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'constant', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public', - 'property_protected', - 'property_private', - 'construct', - 'destruct', - 'method_public', - 'method_protected', - 'method_private', - 'magic', - ], - 'sortAlgorithm' => 'alpha', - ], + '@Symfony' => true, ]) ->setFinder($finder); From ee27eb448ca6b40caa1f61e9233eaa938302f101 Mon Sep 17 00:00:00 2001 From: Alex Slaughter Date: Wed, 8 May 2019 15:45:55 -0700 Subject: [PATCH 3/3] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 708e529..ae769f9 100644 --- a/composer.json +++ b/composer.json @@ -8,8 +8,8 @@ "email": "alex@alexslaughter.com" }], "require": { - "php": "^7.0", - "intercom/intercom-php": "4.0.2", + "php": "^7.1", + "intercom/intercom-php": "^4.0", "laravel/framework": ">=5.1" }, "autoload": {