Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #37 from tuyennn/develop
Browse files Browse the repository at this point in the history
Bump to v1.1.9
  • Loading branch information
tuyennn authored Jun 22, 2020
2 parents b8efe0c + 42ab99a commit ad8c0c3
Show file tree
Hide file tree
Showing 37 changed files with 307 additions and 1,502 deletions.
3 changes: 3 additions & 0 deletions Api/Data/ItemInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace GhoSter\AutoInstagramPost\Api\Data;

/**
* Interface ItemInterface
*/
interface ItemInterface
{

Expand Down
3 changes: 3 additions & 0 deletions Api/Data/ItemSearchResultInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Magento\Framework\Api\SearchResultsInterface;

/**
* Interface ItemSearchResultInterface
*/
interface ItemSearchResultInterface extends SearchResultsInterface
{

Expand Down
3 changes: 3 additions & 0 deletions Api/ItemRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Magento\Framework\Api\SearchCriteriaInterface;
use GhoSter\AutoInstagramPost\Api\Data\ItemInterface;

/**
* Interface ItemRepositoryInterface
*/
interface ItemRepositoryInterface
{

Expand Down
3 changes: 3 additions & 0 deletions Api/WorkerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection;

/**
* Interface WorkerInterface
*/
interface WorkerInterface
{

Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Magento\Eav\Setup\EavSetup;

/**
* Product Widget Container
*
* Class Product
* @package GhoSter\AutoInstagramPost\Block\Adminhtml
*/
class Product extends \Magento\Backend\Block\Widget\Container
{
Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/System/Config/Hashtag.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
use GhoSter\AutoInstagramPost\Block\Adminhtml\System\Config\Hashtag\Activation;

/**
* Hashtag Field
*
* Class Hashtag
* @package GhoSter\AutoInstagramPost\Block\Adminhtml\System\Config
*/
class Hashtag extends AbstractFieldArray
{
Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/System/Config/Hashtag/Activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Magento\Config\Model\Config\Source\Enabledisable;

/**
* Activation Select Element
*
* Class Activation
* @package GhoSter\AutoInstagramPost\Block\Adminhtml\System\Config\Hashtag
*/
class Activation extends Select
{
Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/System/Config/TestConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Magento\Framework\Data\Form\Element\AbstractElement;

/**
* TestConnection Field
*
* Class TestConnection
* @package GhoSter\AutoInstagramPost\Block\Adminhtml\System\Config
*/
class TestConnection extends Field
{
Expand Down
3 changes: 2 additions & 1 deletion Controller/Adminhtml/Manage/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use Magento\Backend\Model\View\Result\Page;

/**
* Manager Index Controller
*
* Class Index
* @package GhoSter\AutoInstagramPost\Controller\Adminhtml\Manage
*/
class Index extends ProductController
{
Expand Down
3 changes: 2 additions & 1 deletion Controller/Adminhtml/Manage/MassPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
use GhoSter\AutoInstagramPost\Model\Config as InstagramConfig;

/**
* Manager MassPost Controller
*
* Class MassPost
* @package GhoSter\AutoInstagramPost\Controller\Adminhtml\Manage
*/
class MassPost extends Action
{
Expand Down
3 changes: 2 additions & 1 deletion Controller/Adminhtml/Manage/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
use GhoSter\AutoInstagramPost\Model\Instagram\Worker as InstagramWorker;

/**
* Manager Post Controller
*
* Class Post
* @package GhoSter\AutoInstagramPost\Controller\Adminhtml\Manage
*/
class Post extends Action
{
Expand Down
7 changes: 5 additions & 2 deletions Controller/Adminhtml/System/Config/TestConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
use Psr\Log\LoggerInterface;

/**
* Test Connection Controller
*
* Class TestConnection
* @package GhoSter\AutoInstagramPost\Controller\Adminhtml\System\Config
*/
class TestConnection extends Action
{
Expand Down Expand Up @@ -93,7 +94,9 @@ public function execute()

$responseData = [
'success' => $status,
'message' => $status ? __('Connection Success') : __('Unauthorized Instagram Account, check your user/password settings')
'message' => $status
? __('Connection Success')
: __('Unauthorized Instagram Account, check your user/password settings')
];

} else {
Expand Down
3 changes: 2 additions & 1 deletion Cron/SchedulePost.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use Psr\Log\LoggerInterface;

/**
* Cron for SchedulePost
*
* Class SchedulePost
* @package GhoSter\AutoInstagramPost\Cron
*/
class SchedulePost
{
Expand Down
5 changes: 3 additions & 2 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
use GhoSter\AutoInstagramPost\Model\Config as InstagramConfig;

/**
* AutoInstagramPost Data Helper
*
* Class Data
* @package GhoSter\AutoInstagramPost\Helper
*/
class Data extends AbstractHelper
{
Expand Down Expand Up @@ -265,7 +266,7 @@ public function getInstagramPostDescription($product)
$html = '';
$stringTemplate = $this->config->getInstagramPostTemplate();

if (preg_match_all("~\{\{\s*(.*?)\s*\}\}~", $stringTemplate, $matches)) {
if (preg_match_all("~{{\s*(.*?)\s*}}~", $stringTemplate, $matches)) {
if (isset($matches[1]) && is_array($matches[1])) {
foreach ($matches[1] as $key => $match) {
$addOnSpace = $key !== 0 ? self::SPACE_STRING : '';
Expand Down
23 changes: 18 additions & 5 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
use GhoSter\AutoInstagramPost\Model\Serialize\Serializer;

/**
* AutoInstagramPost Config
*
* Class Config
* @package GhoSter\AutoInstagramPost\Model
*/
class Config
{
Expand All @@ -24,6 +25,7 @@ class Config
const XML_PATH_INSTAGRAM_PASSWORD = 'auto_instagram_post/general/password';
const XML_PATH_DEFAULT_IMAGE = 'auto_instagram_post/general/upload_image_id';
const XML_PATH_ENABLE_OBSERVER = 'auto_instagram_post/general/enabled_observer';
const XML_PATH_ENABLE_DEBUG = 'auto_instagram_post/general/enable_debug';

const XML_PATH_COMMENT_ENABLED = 'auto_instagram_post/comment_hashtag/enabled';
const XML_PATH_COMMENT_PRODUCT_DESCRIPTION = 'auto_instagram_post/comment_hashtag/product_description';
Expand Down Expand Up @@ -184,11 +186,9 @@ public function getDefaultImage($store = null)
return '';
}

$imagePath = $this->directoryList->getPath('media')
return $this->directoryList->getPath('media')
. DIRECTORY_SEPARATOR . $uploadDir
. DIRECTORY_SEPARATOR . $image;

return $imagePath;
}

/**
Expand All @@ -199,13 +199,26 @@ public function getDefaultImage($store = null)
*/
public function isObserverEnabled($store = null)
{
return (bool)$this->scopeConfig->getValue(
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ENABLE_OBSERVER,
ScopeInterface::SCOPE_STORE,
$store
);
}

/**
* @param null $store
* @return bool
*/
public function isDebugEnabled($store = null)
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ENABLE_DEBUG,
ScopeInterface::SCOPE_STORE,
$store
);
}

/**
* Check if Hashtag was enabled
*
Expand Down
3 changes: 2 additions & 1 deletion Model/Config/Backend/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use GhoSter\AutoInstagramPost\Model\Config as InstagramConfig;

/**
* Config Value for Cron
*
* Class Cron
* @package GhoSter\AutoInstagramPost\Model\Config\Backend
*/
class Cron extends ConfigValue
{
Expand Down
3 changes: 2 additions & 1 deletion Model/Config/Backend/Hashtag.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Magento\Config\Model\Config\Backend\Serialized\ArraySerialized;

/**
* Config Value for Hashtag
*
* Class Hashtag
* @package GhoSter\AutoInstagramPost\Model\Config\Backend
*/
class Hashtag extends ArraySerialized
{
Expand Down
3 changes: 2 additions & 1 deletion Model/Config/Backend/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace GhoSter\AutoInstagramPost\Model\Config\Backend;

/**
* Config Value for Image
*
* Class Image
* @package GhoSter\AutoInstagramPost\Model\Config\Backend
*/
class Image extends \Magento\Config\Model\Config\Backend\Image
{
Expand Down
3 changes: 2 additions & 1 deletion Model/ImageProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
use GhoSter\AutoInstagramPost\Model\Config as InstagramConfig;

/**
* AutoInstagramPost ImageProcessor
*
* Class ImageProcessor
* @package GhoSter\AutoInstagramPost\Model
*/
class ImageProcessor
{
Expand Down
Loading

0 comments on commit ad8c0c3

Please sign in to comment.