diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..1c663e8d2923b68cec44a60013e068e3bbcbb43b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,8 @@ +variables: + DISABLE_ACCEPTANCE: "1" + DISABLE_FUNCTIONAL: "1" + IS_LIBRARY: 1 + DISABLE_PHP_5_5: 1 + DISABLE_CODECEPTION: 1 + +include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml' diff --git a/README.md b/README.md index 1818a66aea545971c7fd735fa7053e97ab2fc126..c62a1311570ef3937f321874ad13ff3b820a554d 100644 --- a/README.md +++ b/README.md @@ -2,48 +2,59 @@ [](https://gitlab.com/wpdesk/wp-wpdesk-rating-petition/commits/master) [](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) [](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) -[](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) [](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition) WordPress Library to ask for good rate in repository. -=================================================== +==================================================== -### Usage +## Requirements -When using in shipping zones: +PHP 7.0 or later. + +## Installation via Composer + +In order to install the bindings via Composer run the following command: + +```bash +composer require wpdesk/wp-wpdesk-rating-petition +``` + +## Example usage + +### When using in shipping zones: ```php -private function init_repository_rating() { - $time_tracker = new ShippingMethodWatcher( +function init_repository_rating() { + $time_tracker = new \WPDesk\RepositoryRating\TimeWatcher\ShippingMethodInstanceWatcher( FedexShippingService::UNIQUE_ID, 'plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php', '28-11-2019', FedexShippingMethod::class ); - $this->add_hookable( $time_tracker ); - $this->add_hookable( - new RatingPetitionNotice( - $time_tracker, - FedexShippingService::UNIQUE_ID, - $this->plugin_info->get_plugin_name(), - 'https://wpde.sk/fs-fedex-rate' - ) - ); + $time_tracker->hooks(); + ( new \WPDesk\RepositoryRating\RatingPetitionNotice( + $time_tracker, + 'flexible_shipping_fedex', + $this->plugin_info->get_plugin_name(), + 'https://wpde.sk/fs-fedex-rate' + ) )->hooks(); } ``` -When using in shipping method: +### When using in shipping method: ```php -private function init_repository_rating() { - $time_tracker = new ShippingMethodGlobalSettingsWatcher( FedexShippingService::UNIQUE_ID ); - $this->add_hookable( $time_tracker ); - $this->add_hookable( - new RatingPetitionNotice( +<?php +function init_repository_rating() { + $time_tracker = new \WPDesk\RepositoryRating\TimeWatcher\ShippingMethodGlobalSettingsWatcher( + 'flexible_shipping_fedex' + ); + $time_tracker->hooks(); + ( new \WPDesk\RepositoryRating\RatingPetitionNotice( $time_tracker, - FedexShippingService::UNIQUE_ID, + 'flexible_shipping_fedex', $this->plugin_info->get_plugin_name(), 'https://wpde.sk/fs-fedex-rate' ) - ); + )->hooks(); } ``` diff --git a/composer.json b/composer.json index a9b56d8e7c9b52157d1c7c00269b16e7549c33e5..560e21a88c16dac53ea7c9b202d2d18b404caab6 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name": "wpdesk/wp-wpdesk-rating-petition", + "license": "MIT", "authors": [ { "name": "Krzysiek",