Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
DomPixie committed May 4, 2022
2 parents c92c732 + f8cdd5b commit e817570
Showing 10 changed files with 35 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/phpcompatibility.yml
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: 7.0-7.4
run: docker run --rm -v $PWD:/code domw/phpcompatibility phpcs --standard=PHPCompatibility --runtime-set testVersion 7.0-7.4 --colors --warning-severity=0 --report=full,summary --extensions=php,phtml ./
- name: 7.1-8-0
run: docker run --rm -v $PWD:/code domw/phpcompatibility:8.0-cli phpcs --standard=PHPCompatibility --runtime-set testVersion 7.1-8.0 --colors --warning-severity=0 --report=full,summary --extensions=php,phtml ./
13 changes: 7 additions & 6 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: phpcs
on: [push]
name: M2 Coding Standard
on: [push, pull_request]

jobs:
build:
static:
name: M2 Coding Standard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Magento 2 Ruleset
run: docker run --rm -v $PWD:/code domw/phpcs phpcs --colors --standard=Magento2 --report=full,summary,gitblame --extensions=php,phtml ./
- uses: actions/checkout@v2
- uses: extdn/github-actions-m2/magento-coding-standard@master
2 changes: 1 addition & 1 deletion .github/workflows/phpcsfixer.yml
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@ jobs:
steps:
- uses: actions/checkout@master
- name: PHP CS Fixer
run: docker run --rm -v $PWD:/code domw/php-cs-fixer php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes ./
run: docker run --rm -v $PWD:/code domw/php-cs-fixer php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes ./
20 changes: 9 additions & 11 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: PHPStan
on: [push]
name: M2 PHPStan
on: [push, pull_request]

jobs:
build:
phpstan:
name: M2 PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: MilesChou/composer-action@master
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
args: install --prefer-dist --no-dev --ignore-platform-reqs
- name: PHPStan
run: docker run --rm -v $PWD:/code domw/phpstan phpstan analyze ./
- uses: actions/checkout@v2
- uses: extdn/github-actions-m2/magento-phpstan@master
with:
composer_name: dominicwatts/faker
2 changes: 1 addition & 1 deletion Helper/Category.php
Original file line number Diff line number Diff line change
@@ -96,12 +96,12 @@ public function createCategory($storeId = 0)

try {
$category->save();

return $category;
} catch (\Exception $e) {
$this->logger->critical($e);
}
}
return false;
}

/**
12 changes: 6 additions & 6 deletions Helper/Product.php
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ public function __construct(
* @param int $websiteId
* @param string $typeId
* @param bool $applyImage
* @return \Magento\Catalog\Model\Product\Interceptor|false
* @return Interceptor|false
*/
public function createProduct(
$websiteId = 1,
@@ -214,7 +214,7 @@ public function createProduct(
* @param $product
* @return \Magento\Product\Model\Data\Product|false
*/
public function reloadProduct(Interceptor $product)
public function reloadProduct($product)
{
if ($product && $product->getId()) {
try {
@@ -262,11 +262,11 @@ public function getRandomLink()

/**
* Create array of random product links.
* @param \Magento\Product\Model\Data\Product $product
* @param $product
* @param int $limit
* @return array
*/
public function createProductLinkArray(Interceptor $product, $limit = 1)
public function createProductLinkArray($product, $limit = 1)
{
$linkData = [];
$linkSkus = $this->getRandomSku($limit);
@@ -354,11 +354,11 @@ public function getRandomProduct($limit = 1, $inStockOnly = false, $simpleOnly =

/**
* Add dummy images.
* @param \Magento\Catalog\Model\Product\Interceptor $product
* @param $product
* @param int $limit
* @return void
*/
public function addImages(Interceptor $product, $limit = 1)
public function addImages($product, $limit = 1)
{
for ($generate = 1; $generate <= $limit; $generate++) {
$imageUrl = self::PLACEHOLDER_SOURCE . 'image-' . str_pad(rand(1, 20), 3, 0, STR_PAD_LEFT) . '.jpg';
3 changes: 2 additions & 1 deletion Helper/Review.php
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@ public function createReview($storeId = 1)
$product = $this->productHelper
->getRandomIds(1);

$website = null;
$stores = $this->storeManagerInterface->getStores(true, false);
foreach ($stores as $store) {
if ($store->getStoreId() == $storeId) {
@@ -114,10 +115,10 @@ public function createReview($storeId = 1)

try {
$review->save();

return $review;
} catch (\Exception $e) {
$this->logger->critical($e);
}
return false;
}
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Faker extension #

![phpcs](https://github.com/DominicWatts/Faker/workflows/phpcs/badge.svg)
[![php-cs-fixer](https://github.com/DominicWatts/Faker/actions/workflows/phpcsfixer.yml/badge.svg)](https://github.com/DominicWatts/Faker/actions/workflows/phpcsfixer.yml)

![PHPCompatibility](https://github.com/DominicWatts/Faker/workflows/PHPCompatibility/badge.svg)
[![php-cs-fixer](https://github.com/DominicWatts/Faker/actions/workflows/phpcsfixer.yml/badge.svg)](https://github.com/DominicWatts/Faker/actions/workflows/phpcsfixer.yml)

![PHPStan](https://github.com/DominicWatts/Faker/workflows/PHPStan/badge.svg)
[![M2 Coding Standard](https://github.com/DominicWatts/Faker/actions/workflows/phpcs.yml/badge.svg)](https://github.com/DominicWatts/Faker/actions/workflows/phpcs.yml)

[![M2 PHPStan](https://github.com/DominicWatts/Faker/actions/workflows/phpstan.yml/badge.svg)](https://github.com/DominicWatts/Faker/actions/workflows/phpstan.yml)

Magento 2 extension to generate fake data.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"description": "Console based fake data generator - just generate what you need",
"type": "magento2-module",
"license": "proprietary",
"version": "1.2.2",
"version": "1.2.3",
"authors": [
{
"name": "Dominic Xigen",
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Xigen_Faker" setup_version="1.2.2"/>
<module name="Xigen_Faker" setup_version="1.2.3"/>
</config>

0 comments on commit e817570

Please sign in to comment.