From 834531e08567e1020cecead6d0db440105fddafc Mon Sep 17 00:00:00 2001 From: Julie Varisellaz <70583503+Julievrz@users.noreply.github.com> Date: Mon, 26 Oct 2020 12:01:00 +0100 Subject: [PATCH 01/19] Update About section of README --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 7a21b5f..ecb5119 100644 --- a/Readme.md +++ b/Readme.md @@ -2,7 +2,7 @@ ## About -Adds a block with a table of your latest orders and a ranking of your products. +Enrich your stats, display a table of your latest orders and a ranking of your products. ## Reporting issues From 53245f4eb668b7f941048d92baf68e368618b034 Mon Sep 17 00:00:00 2001 From: Julie Varisellaz <70583503+Julievrz@users.noreply.github.com> Date: Mon, 26 Oct 2020 12:01:29 +0100 Subject: [PATCH 02/19] Update short description --- dashproducts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashproducts.php b/dashproducts.php index d26d77f..34288e0 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -42,7 +42,7 @@ public function __construct() parent::__construct(); $this->displayName = $this->trans('Dashboard Products', array(), 'Modules.Dashproducts.Admin'); - $this->description = $this->trans('Adds a block with a table of your latest orders and a ranking of your products', array(), 'Modules.Dashproducts.Admin'); + $this->description = $this->trans('Enrich your stats, display a table of your latest orders and a ranking of your products.', array(), 'Modules.Dashproducts.Admin'); $this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_); } From b9ce6ea283a0a62eb5ed857a6dc5692609edf879 Mon Sep 17 00:00:00 2001 From: Julie Varisellaz <70583503+Julievrz@users.noreply.github.com> Date: Mon, 26 Oct 2020 12:02:38 +0100 Subject: [PATCH 03/19] Update logo --- logo.png | Bin 610 -> 3812 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/logo.png b/logo.png index 7f78c95cc0515c0bfddb2e8ef43a98c68cde1934..30f501c8365d8aec7434a1384a9e9709bbe78106 100644 GIT binary patch literal 3812 zcmVPx@o=HSORCodHoqKE?#U00gduN~Dc5LTiCn1moXyXJ@LJENt6hd3I1&II!sp>y1 zs8Xu}fu^abDwTwyiZ&9D(gNxqNr9H4QW7H-DxjpLJOUx0MkJ|8Nb@4(L7c>IpM8)1 zew!P!UhnShWA^Um_BWEfvoo_Z^ZU-{W_D+1cQvqZ*=)9QSO3V0Y$me;G;J|tVR{y_ z^%hAvs7w^lK{VjB`jYn}EUS$P*dJ{L5Sn!z4OMqzZ<8Sfyk!OK6o|!QH^=l#XS);}&I%Y5AXZ}fJc}Way{v$(0yrlZqe(g21RTK%7!^QP zVmyOuRD}Ib3J@zXrvx0w3YZmOV9bi}zM}#RjH5gpX;y%NF)PCRjtVd^j`DD%Spf#d ztO)NrD!{-v%EOUn1;&;)m?L<rU+iJuSkXbdAFtzGTQ;Orm0*8Td+cFZqt@<5YT3_sqwq;eiEh(3+?SWkxh;{Yv$CrOsjY4~|HIg&JcZ zm4Ww859yboqK6UNQf;hKsFxDJh=xq2<;{$e_`^7?iOH@~XbctVpad{NNCA%654zR! z!=a9ydj*sN#=TiCQ|4wy2^`rlx~ze6$)XJmHW!29jaj9D!G6G-b(~td0!jfR-FnW@ zvjPl^XUU>{00R^4_V;W(1LIk;Xdl49M7#YxThG9FmMq!_Ffh?>f6vx4FrFog_5ln` zwA$)bG#0~77`_iQ}_<5{w3AE3+<%|bR)Sa-0?Va+fDV9U2B^tT{jP+}Cvs4h{xiX#Q6B0950H2}|$^1p!J} zz1L^857)=%FeZKb@X-Vru!wAT^bD2Nx?u)Jv}|sh%F116p2Byx6yh};CNo0YWnfIw z${sQ(KjWXNIOTR3n6R4+SCz_!FzhNj<Ip;Tgw^qg>7ROXL!>lKDPVU=k2FAB^@(*mUu7FEh z>R<`Jpm}y}0xGHTOUyAaCD0&CTkGJ)8BK5wLQ?9Efhl4OUD#9&tInUI1Smo#21Y1R z;4PhNd~bGZflCcu90LT3Rt> zW<5-u)ezWP1}3nC?lPc8i^cL!dmY)|3tL|JAH4g@0XVX+$6e+wQ#DMghHtID7%snd zuFE4PCSzbGY9c*^V2R_LijyNyIv?8(TVL9Ty@^vw|8ae%hvD}>dlL@t?SY$CF7lNT z1LI3J_XoA$Yh5d=5;&J;KNh|A+#Y!9{&yfXB6ls0T`gbSumdjq(hT_A#nbGP*oI33 zrd;mE+A8HE;w=2M-gRd+JHqm(Uu}g~p6>FIyZ=L|2YciBkBSG3fTiun;oOB&L$FkVZ$6g#P~--dKm1~gv|)%S`1*GiK>In3 zwm{$r4&S|JiEVt42q`^GkP4`L?Af?}CEwK$!Sb)a?vZMyn+dlWb0(E>F%(|c(5DcH09c&N)H z7#L$KSolj37GpIJ?KuVXS189rl7rHv4vRz8LyO`b#ztC#Wi2jIXsEFNO>HRfFl1BJ zf(A1%7IM3RW&N7B;NP1*vN&3epvr{(S{)|~?0-H^N0o709B;(r>seHXg_^HYlS0si>*1g!xOR8-rZ?omFz3jk*and>SzxcRm3uCs?SZmfdhZ zR3!X0y}zT>z@B5UV?jJM6;Gv%7_6Oy_LfJ+Rm{y$0r9Uh8=XKkxf|U&;SY-7q zLWIZx(`<9o?bE~kp*~_N1TWO~f~C`?!$Nhp{;3tpsv?wAZS%6^FrP;*w3%V_EW(D! z^)RRL1E5xJ#+*r3!ODe&)w2j8A_q+ONE)mj1E>2d3oiF}e?^E{>@C5v@}cEYu7>Pv zi5xIP=?r|>H*BfLEkC~uYVk!zD!M|zLb^l_7&3ax$wAsoa4qe1aMy2_1Kn>?$t?)! z1lLM~NCNZnu|7Cub1rk<7pB6GAN#U0&=4#uaZ=9jl1nQnoWddrOcLL2_2dEjM>BM2 z9xZ)n3JnW^6iHyn@YhcC!`?poS9_gz5%x4C3=N&27qVv|&B#R-7&88YQv;AmTVG~V zJVCSScUPC(@T9}?aK2&4>ROPj3g#jW3`sgVI;wxU-cH8z7fmZEXxzX;?+2v2?qRq{ z10w`Y(~GDb6dr@7rnpy6ZeU5LQ%(7S=1lqP6? zM8i{&pjmKPJFIjVhDNdeBO~-~W7#b+USDaz%&fLw8#}(p{ChE6HrbZDNoaiZqa7P7 zZgVdvf36c#Ovg8k8y!ilgJTRd`03qp#ehbK9qHMn+iHC#Qp4k{`t@YA~ZdEMN1hB7#GZ2q(l zHqu9@QvSuE8<1B_s)C!_>-8rFL>UApmC>8ZLbC}bqv#*LcMKl*;j54wN*RMg@w4V*HRZ{|{)g*Mi=qU)Y#rR{BRXJ(EkkE9+LEw--i+_HcZX_B@MvI0Nz!02z{<(5! z2ob<~EsGv6p?r?RJY-wLA_@YkIM+nN*)*zT7aT& zeKw{rlp0Jls`#Z8stmmxgi^p%3~1&r!E+WIhUg{Eb}pI3Py6M5m`1(GPfqA&cf6nQ zzVN&<_mfF&28Z#@0O-i4elfJL`TWeITfgt@YHzuSMgGDuKSj`2`Y25l)`G=MRU z@ON!H1`pEkG%Rm;asx{$MbiPfvx%He;>RXH5nEAL8C$8qP=!cj;f#I}mTzk`(&#rH zXUx~=H>Pp&8}l{#&ButmDUDM)nb5d_#rUH%*2~UswkycK6kwQOq(# z9qj5T0~$B5VE>9@+tuPsc)q$iAMG3~4H)NQq7mEmE)Gw(`5T@(E^UK5@q-gi=Pae5 zqO^IKQZT02b@==jr{Q`UoZPD(KfjZ&UaG)Cb}%scTGL~^S7=m%g@N%1gWKc;&7F@p zUlLPZs=-2a<{pMr2*J&}qzzW#%DtAhI?LQI{n~6L&RNWr=aXKuB9ixq`bXiVKkkB$ zwtoseCx&3=xy`WnE3@EY{8poij)76J)rweW9+HYEzKTUNFezEv5pc0?eq+@lO}LN<-f!*n!M-ObRHQ!~r4MTZ615V=iwGHh3G@_KwWXC0r@2#KP(rE?a9Wwq#8 zgbEXYp$Iw=-qk;{0#~H3z{RYKaY^8G1jzc;*&-+2Dy@J%flG68cmC`00009a7bBm000ie000ie0hKEb8vp*_Mtbez_$i^{@x;A0d$<1-kxmoVnB@XT>_k^3_rhgk* zI=;Su#j_5LMgyA7=B=WgmWB1}3ru+fK+|fq*pJ%nHp_pOs6o4EraXb07YKzyfL{h= zG8vX7Nn%+I+SPM`STqVYs}*v&9Ls*cpJg>@SI-6RVg?0zDiDc8z$}XJBb#M;b!CNR zHE37=eFcL%aPI{^ClcUtIw7CWv%D1yvaAN}>c2}^uh*ekt+GE8np&;KvKq8&a0z=Z zkV>V%=kr0aSY$aa%PgxwyZY}ERw@-J6bev3J7f9h=_$)<(5@R7FiUGtDwUvIF5fEJ zDZ1B`3(#YM9wtNK6VQ5-pj}39xh1s7dAK*|H7B80+yZ*Zy+HGvI|)OpMdgRd#na4a wI~p@je;X4On7S}_G1 Date: Wed, 25 Aug 2021 17:00:22 +0200 Subject: [PATCH 04/19] Removed link when customer is deleted --- dashproducts.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dashproducts.php b/dashproducts.php index 34288e0..9e65132 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -116,10 +116,17 @@ public function getTableRecentOrders() foreach ($orders as $order) { $currency = Currency::getCurrency((int)$order['id_currency']); $tr = array(); - $customerLinkParams = ['route' => 'admin_customers_view', 'customerId' => $order['id_customer']]; $tr[] = array( 'id' => 'firstname_lastname', - 'value' => ''.Tools::htmlentitiesUTF8($order['firstname']).' '.Tools::htmlentitiesUTF8($order['lastname']).'', + 'value' => !empty($order['id_customer']) ? sprintf( + '%s %s', + $this->context->link->getAdminLink('AdminCustomers', true, [ + 'route' => 'admin_customers_view', + 'customerId' => $order['id_customer'] + ]), + Tools::htmlentitiesUTF8($order['firstname']), + Tools::htmlentitiesUTF8($order['lastname']) + ) : '', 'class' => 'text-left', ); $tr[] = array( From 05d58346d37741fb680c8d61087eb39e35b659fb Mon Sep 17 00:00:00 2001 From: Khouloud BELGUITH Date: Wed, 13 Oct 2021 10:51:06 +0100 Subject: [PATCH 05/19] Fix bad display in the Dashboard page --- views/templates/hook/dashboard_zone_two.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/templates/hook/dashboard_zone_two.tpl b/views/templates/hook/dashboard_zone_two.tpl index 58cd298..0b1e864 100644 --- a/views/templates/hook/dashboard_zone_two.tpl +++ b/views/templates/hook/dashboard_zone_two.tpl @@ -77,7 +77,9 @@
-

{l s='Last %d orders' sprintf=$DASHPRODUCT_NBR_SHOW_LAST_ORDER|intval d='Modules.Dashproducts.Admin'}

+
+ {l s='Last %d orders' sprintf=$DASHPRODUCT_NBR_SHOW_LAST_ORDER|intval d='Modules.Dashproducts.Admin'} +
From a311d161d7b94428254867cc414f201146db3242 Mon Sep 17 00:00:00 2001 From: Khouloud BELGUITH Date: Wed, 13 Oct 2021 11:42:16 +0100 Subject: [PATCH 06/19] Fix bad display of all tabs in the Dashboard page --- views/templates/hook/dashboard_zone_two.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/views/templates/hook/dashboard_zone_two.tpl b/views/templates/hook/dashboard_zone_two.tpl index 0b1e864..33459ac 100644 --- a/views/templates/hook/dashboard_zone_two.tpl +++ b/views/templates/hook/dashboard_zone_two.tpl @@ -88,10 +88,10 @@
-

+
{l s='Top %d products' sprintf=$DASHPRODUCT_NBR_SHOW_BEST_SELLER|intval d='Modules.Dashproducts.Admin'} {l s="From" d='Modules.Dashproducts.Admin'} {$date_from|escape:'htmlall':'UTF-8'} {l s="to" d='Modules.Dashproducts.Admin'} {$date_to|escape:'htmlall':'UTF-8'} -

+
@@ -100,10 +100,10 @@
-

+
{l s="Most Viewed" d='Modules.Dashproducts.Admin'} {l s="From" d='Modules.Dashproducts.Admin'} {$date_from|escape:'htmlall':'UTF-8'} {l s="to" d='Modules.Dashproducts.Admin'} {$date_to|escape:'htmlall':'UTF-8'} -

+
@@ -112,10 +112,10 @@
From cc1485ae5a6bfe435efdf3ccd9420343fbee50a0 Mon Sep 17 00:00:00 2001 From: Daniel Hlavacek Date: Tue, 19 Oct 2021 16:32:56 +0200 Subject: [PATCH 07/19] Remove deprecated functions --- dashproducts.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dashproducts.php b/dashproducts.php index 9e65132..2c9dac5 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -136,7 +136,7 @@ public function getTableRecentOrders() ); $tr[] = array( 'id' => 'total_paid', - 'value' => Tools::displayPrice((float)$order['total_paid_tax_excl'], $currency), + 'value' => $this->context->getCurrentLocale()->formatPrice((float)$order['total_paid_tax_excl'], $currency->iso_code), 'class' => 'text-center', 'wrapper_start' => $order['valid'] ? '' : '', 'wrapper_end' => '', @@ -250,7 +250,8 @@ public function getTableBestSellers($date_from, $date_to) ), array( 'id' => 'product', - 'value' => ''.Tools::htmlentitiesUTF8($product['product_name']).''.'
'.Tools::displayPrice($productPrice), + 'value' => ''.Tools::htmlentitiesUTF8($product['product_name']).''.'
' . + $this->context->getCurrentLocale()->formatPrice($productPrice, $this->context->currency->iso_code), 'class' => 'text-center' ), array( @@ -265,12 +266,12 @@ public function getTableBestSellers($date_from, $date_to) ), array( 'id' => 'sales', - 'value' => Tools::displayPrice($product['sales']), + 'value' => $this->context->getCurrentLocale()->formatPrice($product['sales'], $this->context->currency->iso_code), 'class' => 'text-center' ), array( 'id' => 'net_profit', - 'value' => Tools::displayPrice($product['sales'] - $product['expenses']), + 'value' => $this->context->getCurrentLocale()->formatPrice(($product['sales'] - $product['expenses']), $this->context->currency->iso_code), 'class' => 'text-center' ) ); @@ -344,7 +345,7 @@ public function getTableMostViewed($date_from, $date_to) ); $tr[] = array( 'id' => 'product', - 'value' => Tools::htmlentitiesUTF8($product_obj->name).'
'.Tools::displayPrice(Product::getPriceStatic((int)$product_obj->id)), + 'value' => Tools::htmlentitiesUTF8($product_obj->name).'
'. $this->context->getCurrentLocale()->formatPrice(Product::getPriceStatic((int)$product_obj->id), $this->context->currency->iso_code), 'class' => 'text-center', ); $tr[] = array( From 7b5f8c72008064f7b490e246239517758a1a36d7 Mon Sep 17 00:00:00 2001 From: Daniel Hlavacek Date: Mon, 25 Oct 2021 12:33:53 +0200 Subject: [PATCH 08/19] Update compatibility --- dashproducts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashproducts.php b/dashproducts.php index 2c9dac5..3300b8d 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -43,7 +43,7 @@ public function __construct() parent::__construct(); $this->displayName = $this->trans('Dashboard Products', array(), 'Modules.Dashproducts.Admin'); $this->description = $this->trans('Enrich your stats, display a table of your latest orders and a ranking of your products.', array(), 'Modules.Dashproducts.Admin'); - $this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_); + $this->ps_versions_compliancy = array('min' => '1.7.6.0', 'max' => _PS_VERSION_); } public function install() From faf511d87a307274e8d016afd8a79dc861796438 Mon Sep 17 00:00:00 2001 From: Thomas BACCELLI Date: Thu, 23 Dec 2021 10:26:51 +0100 Subject: [PATCH 09/19] Remove code related to live update (`push`) --- config.xml | 2 +- dashproducts.php | 19 ++---------- upgrade/upgrade-2.1.2.php | 34 +++++++++++++++++++++ views/templates/hook/dashboard_zone_two.tpl | 2 +- 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 upgrade/upgrade-2.1.2.php diff --git a/config.xml b/config.xml index a0acc6f..47082c6 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ dashproducts - + diff --git a/dashproducts.php b/dashproducts.php index 3300b8d..23dd90d 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -34,12 +34,9 @@ public function __construct() { $this->name = 'dashproducts'; $this->tab = 'dashboard'; - $this->version = '2.1.1'; + $this->version = '2.1.2'; $this->author = 'PrestaShop'; - $this->push_filename = _PS_CACHE_DIR_.'push/activity'; - $this->allow_push = true; - parent::__construct(); $this->displayName = $this->trans('Dashboard Products', array(), 'Modules.Dashproducts.Admin'); $this->description = $this->trans('Enrich your stats, display a table of your latest orders and a ranking of your products.', array(), 'Modules.Dashproducts.Admin'); @@ -56,8 +53,6 @@ public function install() return (parent::install() && $this->registerHook('dashboardZoneTwo') && $this->registerHook('dashboardData') - && $this->registerHook('actionObjectOrderAddAfter') - && $this->registerHook('actionSearch') ); } @@ -250,7 +245,7 @@ public function getTableBestSellers($date_from, $date_to) ), array( 'id' => 'product', - 'value' => ''.Tools::htmlentitiesUTF8($product['product_name']).''.'
' . + 'value' => ''.Tools::htmlentitiesUTF8($product['product_name']).''.'
' . $this->context->getCurrentLocale()->formatPrice($productPrice, $this->context->currency->iso_code), 'class' => 'text-center' ), @@ -616,16 +611,6 @@ public function getConfigFieldsValues() ); } - public function hookActionObjectOrderAddAfter($params) - { - Tools::changeFileMTime($this->push_filename); - } - - public function hookActionSearch($params) - { - Tools::changeFileMTime($this->push_filename); - } - /** * Validate dashboard configuration * diff --git a/upgrade/upgrade-2.1.2.php b/upgrade/upgrade-2.1.2.php new file mode 100644 index 0000000..f2845cb --- /dev/null +++ b/upgrade/upgrade-2.1.2.php @@ -0,0 +1,34 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + */ +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_2_1_2($object) +{ + return $object->unregisterHook('actionObjectOrderAddAfter') + && $object->unregisterHook('actionSearch'); +} diff --git a/views/templates/hook/dashboard_zone_two.tpl b/views/templates/hook/dashboard_zone_two.tpl index 33459ac..f623d3f 100644 --- a/views/templates/hook/dashboard_zone_two.tpl +++ b/views/templates/hook/dashboard_zone_two.tpl @@ -23,7 +23,7 @@ * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) *} -
+
{l s='Products and Sales' d='Modules.Dashproducts.Admin'} From fe71a7a42c4dd57c24f34c839d6b9441bc546fb4 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Tue, 4 Jan 2022 10:57:56 +0100 Subject: [PATCH 10/19] Add build release --- .github/workflows/build-release.yml | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..eb16626 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,62 @@ +name: Build +on: [push, pull_request] + +jobs: + deploy: + name: build dependencies & create artifact + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.0.0 + - name: Install composer dependencies + run: composer install --no-dev -o + - name: Clean-up project + uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0 + - name: Prepare auto-index tool + run: | + composer global require prestashop/autoindex + - name: Generate index.php + run: | + ~/.composer/vendor/bin/autoindex + - name: Create & upload artifact + uses: actions/upload-artifact@v1 + with: + name: ${{ github.event.repository.name }} + path: ../ + update_release_draft: + runs-on: ubuntu-latest + needs: [deploy] + if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' + steps: + - name: Download artifact + uses: actions/download-artifact@v1 + with: + name: ${{ github.event.repository.name }} + - id: release_info + uses: toolmantim/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Prepare for Release + run: | + cd ${{ github.event.repository.name }} + zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} + - name: Clean existing assets + shell: bash + run: | + curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 + assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` + for asset in $assets + do + bin/hub api -X DELETE $asset + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish to GitHub Release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release_info.outputs.upload_url }} + asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip From 9254c2c44ef494cadedaa38028dfe6160098aa40 Mon Sep 17 00:00:00 2001 From: Jonathan Danse Date: Fri, 14 Jan 2022 10:25:41 +0100 Subject: [PATCH 11/19] Set tab property --- dashproducts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashproducts.php b/dashproducts.php index 23dd90d..72d131f 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -33,7 +33,7 @@ class dashproducts extends Module public function __construct() { $this->name = 'dashproducts'; - $this->tab = 'dashboard'; + $this->tab = 'administration'; $this->version = '2.1.2'; $this->author = 'PrestaShop'; From 849438a38aba0b4dada71aa71fa95c79cafe7675 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 7 Feb 2022 16:46:13 +0100 Subject: [PATCH 12/19] Renamed Readme.md in README.md --- Readme.md => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Readme.md => README.md (100%) diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md From 7eafc4dd80caa4e8318fa06c261296d7a3e634d7 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 7 Feb 2022 16:48:36 +0100 Subject: [PATCH 13/19] Added .gitignore --- .gitignore | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 848a58c..c016a5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -.idea -composer.lock -vendor/ \ No newline at end of file +/config_* +/node_modules +/vendor +/.php_cs.cache From 0d8ab82956b4b5de8676728155ffa7e179d0d35e Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 7 Feb 2022 16:49:00 +0100 Subject: [PATCH 14/19] Improved composer dependencies --- composer.json | 8 +- composer.lock | 2256 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2263 insertions(+), 1 deletion(-) create mode 100644 composer.lock diff --git a/composer.json b/composer.json index 26c879a..03f355b 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,14 @@ "require": { "php": ">=5.4" }, + "require-dev": { + "prestashop/php-dev-tools": "^3.4" + }, "config": { - "preferred-install": "dist" + "preferred-install": "dist", + "classmap-authoritative": true, + "optimize-autoloader": true, + "prepend-autoloader": false }, "type": "prestashop-module" } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..10c2bb7 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2256 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "520a769c064fa5cc808e9e6dbd673440", + "packages": [], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-21T20:24:37+00:00" + }, + { + "name": "composer/semver", + "version": "3.2.9", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.9" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-04T13:58:43+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "shasum": "" + }, + "require": { + "composer/pcre": "^1", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-04T17:06:45+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.13.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.2" + }, + "time": "2021-08-05T19:00:23+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-01-12T08:27:12+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.19.3", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.2 || ^2.0", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.6 || ^7.0 || ^8.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", + "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^3.0 || ^4.0 || ^5.0", + "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.4", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.4.2", + "php-cs-fixer/accessible-object": "^1.0", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", + "symfony/phpunit-bridge": "^5.2.1", + "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.19-dev" + } + }, + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/Test/IsIdenticalConstraint.php", + "tests/Test/TokensWithObservedTransformers.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2021-11-15T17:17:55+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v3.1.5" + }, + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + }, + "time": "2020-10-14T08:39:05+00:00" + }, + { + "name": "prestashop/autoindex", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/PrestaShopCorp/autoindex.git", + "reference": "92e10242f94a99163dece280f6bd7b7c2b79c158" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/92e10242f94a99163dece280f6bd7b7c2b79c158", + "reference": "92e10242f94a99163dece280f6bd7b7c2b79c158", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^3.1", + "php": ">=5.6", + "symfony/console": "^3.4", + "symfony/finder": "^3.4" + }, + "bin": [ + "bin/autoindex" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\AutoIndex\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AFL-3.0" + ], + "authors": [ + { + "name": "PrestaShop SA", + "email": "contact@prestashop.com" + } + ], + "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", + "homepage": "https://github.com/PrestaShopCorp/autoindex", + "support": { + "source": "https://github.com/PrestaShopCorp/autoindex/tree/v1.0.0" + }, + "time": "2020-03-11T13:37:03+00:00" + }, + { + "name": "prestashop/header-stamp", + "version": "v1.7", + "source": { + "type": "git", + "url": "https://github.com/PrestaShopCorp/header-stamp.git", + "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", + "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^3.1", + "php": ">=5.6", + "symfony/console": "^3.4 || ~4.0 || ~5.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0" + }, + "require-dev": { + "prestashop/php-dev-tools": "1.*" + }, + "bin": [ + "bin/header-stamp" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\HeaderStamp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AFL-3.0" + ], + "authors": [ + { + "name": "PrestaShop SA", + "email": "contact@prestashop.com" + } + ], + "description": "Rewrite your file headers to add the license or to make them up-to-date", + "homepage": "https://github.com/PrestaShopCorp/header-stamp", + "support": { + "issues": "https://github.com/PrestaShopCorp/header-stamp/issues", + "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v1.7" + }, + "time": "2020-12-09T16:40:38+00:00" + }, + { + "name": "prestashop/php-dev-tools", + "version": "v3.16.1", + "source": { + "type": "git", + "url": "https://github.com/PrestaShop/php-dev-tools.git", + "reference": "785108c29ef6f580930372d88b8f551740fdee98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/785108c29ef6f580930372d88b8f551740fdee98", + "reference": "785108c29ef6f580930372d88b8f551740fdee98", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^2.14", + "php": ">=5.6.0", + "prestashop/autoindex": "^1.0", + "prestashop/header-stamp": "^1.0", + "squizlabs/php_codesniffer": "^3.4", + "symfony/console": "~3.2 || ~4.0 || ~5.0", + "symfony/filesystem": "~3.2 || ~4.0 || ~5.0" + }, + "conflict": { + "friendsofphp/php-cs-fixer": "2.18.3" + }, + "bin": [ + "bin/prestashop-coding-standards" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\CodingStandards\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PrestaShop coding standards", + "support": { + "issues": "https://github.com/PrestaShop/php-dev-tools/issues", + "source": "https://github.com/PrestaShop/php-dev-tools/tree/v3.16.1" + }, + "time": "2021-10-18T07:48:21+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-12-12T21:44:58+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" + }, + { + "name": "symfony/debug", + "version": "v4.4.37", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "5de6c6e7f52b364840e53851c126be4d71e60470" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/5de6c6e7f52b364840e53851c126be4d71e60470", + "reference": "5de6c6e7f52b364840e53851c126be4d71e60470", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "psr/log": "^1|^2|^3" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "^3.4|^4.0|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v4.4.37" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:41:36+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", + "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-11-16T17:02:08+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", + "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "metapackage", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:33+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "553f50487389a977eb31cf6b37faae56da00f753" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/553f50487389a977eb31cf6b37faae56da00f753", + "reference": "553f50487389a977eb31cf6b37faae56da00f753", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-26T16:28:35+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "395220730edceb6bd745236ccb5c9125c748f779" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/395220730edceb6bd745236ccb5c9125c748f779", + "reference": "395220730edceb6bd745236ccb5c9125c748f779", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [], + "plugin-api-version": "2.2.0" +} From f8b128faa4d9ce7320bff23c68910547a4c4883a Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 7 Feb 2022 16:50:28 +0100 Subject: [PATCH 15/19] Added Github Action PHP --- .github/workflows/php.yml | 90 +++++++++++++++++++++++++++++++ .php_cs.dist | 11 ++++ tests/index.php | 34 ++++++++++++ tests/phpstan.sh | 28 ++++++++++ tests/phpstan/index.php | 34 ++++++++++++ tests/phpstan/phpstan-1.7.6.neon | 2 + tests/phpstan/phpstan-1.7.7.neon | 2 + tests/phpstan/phpstan-1.7.8.neon | 2 + tests/phpstan/phpstan-latest.neon | 2 + tests/phpstan/phpstan.neon | 8 +++ 10 files changed, 213 insertions(+) create mode 100644 .github/workflows/php.yml create mode 100644 .php_cs.dist create mode 100644 tests/index.php create mode 100755 tests/phpstan.sh create mode 100644 tests/phpstan/index.php create mode 100644 tests/phpstan/phpstan-1.7.6.neon create mode 100644 tests/phpstan/phpstan-1.7.7.neon create mode 100644 tests/phpstan/phpstan-1.7.8.neon create mode 100644 tests/phpstan/phpstan-latest.neon create mode 100644 tests/phpstan/phpstan.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..c19bfb3 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,90 @@ +--- +name: PHP tests +on: [push, pull_request] +jobs: + # Check there is no syntax errors in the project + php-linter: + name: PHP Syntax check 5.6 => 8.1 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.0.0 + + - name: PHP syntax checker 5.6 + uses: prestashop/github-action-php-lint/5.6@master + + - name: PHP syntax checker 7.2 + uses: prestashop/github-action-php-lint/7.2@master + + - name: PHP syntax checker 7.3 + uses: prestashop/github-action-php-lint/7.3@master + + - name: PHP syntax checker 7.4 + uses: prestashop/github-action-php-lint/7.4@master + + - name: PHP syntax checker 8.0 + uses: prestashop/github-action-php-lint/8.0@master + + - name: PHP syntax checker 8.1 + uses: prestashop/github-action-php-lint/8.1@master + + # Check the PHP code follow the coding standards + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - name: Checkout + uses: actions/checkout@v2.0.0 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: vendor + key: php-${{ hashFiles('composer.lock') }} + + - name: Install dependencies + run: composer install + + - name: Run PHP-CS-Fixer + run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff + + # Run PHPStan against the module and a PrestaShop release + phpstan: + name: PHPStan + runs-on: ubuntu-latest + strategy: + matrix: + presta-versions: ['1.7.6', '1.7.7', '1.7.8', 'latest'] + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - name: Checkout + uses: actions/checkout@v2.0.0 + + # Add vendor folder in cache to make next builds faster + - name: Cache vendor folder + uses: actions/cache@v1 + with: + path: vendor + key: php-${{ hashFiles('composer.lock') }} + + # Add composer local folder in cache to make next builds faster + - name: Cache composer folder + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: php-composer-cache + + - run: composer install + + # Docker images prestashop/prestashop may be used, even if the shop remains uninstalled + - name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }}) + run: ./tests/phpstan.sh ${{ matrix.presta-versions }} diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..9830d6d --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,11 @@ +setUsingCache(true) + ->getFinder() + ->in(__DIR__) + ->exclude('vendor'); + +return $config; diff --git a/tests/index.php b/tests/index.php new file mode 100644 index 0000000..6028c7f --- /dev/null +++ b/tests/index.php @@ -0,0 +1,34 @@ + + * @copyright 2007-2020 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/phpstan.sh b/tests/phpstan.sh new file mode 100755 index 0000000..8e0bf25 --- /dev/null +++ b/tests/phpstan.sh @@ -0,0 +1,28 @@ +#!/bin/bash +PS_VERSION=$1 + +set -e + +# Docker images prestashop/prestashop may be used, even if the shop remains uninstalled +echo "Pull PrestaShop files (Tag ${PS_VERSION})" + +docker rm -f temp-ps || true +docker volume rm -f ps-volume || true + +docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:$PS_VERSION + +# Clear previous instance of the module in the PrestaShop volume +echo "Clear previous module" + +docker exec -t temp-ps rm -rf /var/www/html/modules/dashproducts + +# Run a container for PHPStan, having access to the module content and PrestaShop sources. +# This tool is outside the composer.json because of the compatibility with PHP 5.6 +echo "Run PHPStan using phpstan-${PS_VERSION}.neon file" + +docker run --rm --volumes-from temp-ps \ + -v $PWD:/var/www/html/modules/dashproducts \ + -e _PS_ROOT_DIR_=/var/www/html \ + --workdir=/var/www/html/modules/dashproducts phpstan/phpstan:0.12 \ + analyse \ + --configuration=/var/www/html/modules/dashproducts/tests/phpstan/phpstan-$PS_VERSION.neon diff --git a/tests/phpstan/index.php b/tests/phpstan/index.php new file mode 100644 index 0000000..45df26c --- /dev/null +++ b/tests/phpstan/index.php @@ -0,0 +1,34 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/phpstan/phpstan-1.7.6.neon b/tests/phpstan/phpstan-1.7.6.neon new file mode 100644 index 0000000..c604f7c --- /dev/null +++ b/tests/phpstan/phpstan-1.7.6.neon @@ -0,0 +1,2 @@ +includes: + - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.7.neon b/tests/phpstan/phpstan-1.7.7.neon new file mode 100644 index 0000000..c604f7c --- /dev/null +++ b/tests/phpstan/phpstan-1.7.7.neon @@ -0,0 +1,2 @@ +includes: + - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.8.neon b/tests/phpstan/phpstan-1.7.8.neon new file mode 100644 index 0000000..c604f7c --- /dev/null +++ b/tests/phpstan/phpstan-1.7.8.neon @@ -0,0 +1,2 @@ +includes: + - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-latest.neon b/tests/phpstan/phpstan-latest.neon new file mode 100644 index 0000000..c604f7c --- /dev/null +++ b/tests/phpstan/phpstan-latest.neon @@ -0,0 +1,2 @@ +includes: + - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan.neon b/tests/phpstan/phpstan.neon new file mode 100644 index 0000000..f229aef --- /dev/null +++ b/tests/phpstan/phpstan.neon @@ -0,0 +1,8 @@ +includes: + - %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon +parameters: + paths: + # From PHPStan 0.12, paths to check are relative to the neon file + - ../../dashproducts.php + - ../../upgrade/ + level: 5 From 2151ec9b015077b1517dc566e098b0d850bf6e09 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 7 Feb 2022 16:50:59 +0100 Subject: [PATCH 16/19] Fixed PHPCSFixer --- dashproducts.php | 503 ++++++++++++++++----------------- index.php | 3 +- translations/index.php | 17 +- views/index.php | 3 +- views/templates/hook/index.php | 3 +- views/templates/index.php | 3 +- 6 files changed, 263 insertions(+), 269 deletions(-) diff --git a/dashproducts.php b/dashproducts.php index 72d131f..aafa101 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -23,7 +23,6 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ - if (!defined('_PS_VERSION_')) { exit; } @@ -38,9 +37,9 @@ public function __construct() $this->author = 'PrestaShop'; parent::__construct(); - $this->displayName = $this->trans('Dashboard Products', array(), 'Modules.Dashproducts.Admin'); - $this->description = $this->trans('Enrich your stats, display a table of your latest orders and a ranking of your products.', array(), 'Modules.Dashproducts.Admin'); - $this->ps_versions_compliancy = array('min' => '1.7.6.0', 'max' => _PS_VERSION_); + $this->displayName = $this->trans('Dashboard Products', [], 'Modules.Dashproducts.Admin'); + $this->description = $this->trans('Enrich your stats, display a table of your latest orders and a ranking of your products.', [], 'Modules.Dashproducts.Admin'); + $this->ps_versions_compliancy = ['min' => '1.7.6.0', 'max' => _PS_VERSION_]; } public function install() @@ -50,16 +49,16 @@ public function install() Configuration::updateValue('DASHPRODUCT_NBR_SHOW_MOST_VIEWED', 10); Configuration::updateValue('DASHPRODUCT_NBR_SHOW_TOP_SEARCH', 10); - return (parent::install() + return parent::install() && $this->registerHook('dashboardZoneTwo') && $this->registerHook('dashboardData') - ); + ; } public function hookDashboardZoneTwo($params) { $this->context->smarty->assign( - array( + [ 'DASHACTIVITY_CART_ACTIVE' => Configuration::get('DASHACTIVITY_CART_ACTIVE'), 'DASHACTIVITY_VISITOR_ONLINE' => Configuration::get('DASHACTIVITY_VISITOR_ONLINE'), 'DASHPRODUCT_NBR_SHOW_LAST_ORDER' => Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER'), @@ -68,7 +67,7 @@ public function hookDashboardZoneTwo($params) 'date_from' => Tools::displayDate($params['date_from']), 'date_to' => Tools::displayDate($params['date_to']), 'dashproducts_config_form' => $this->getPermission('configure') ? $this->renderConfigForm() : null, - ) + ] ); return $this->display(__FILE__, 'dashboard_zone_two.tpl'); @@ -82,118 +81,118 @@ public function hookDashboardData($params) $table_top_10_most_search = $this->getTableTop10MostSearch($params['date_from'], $params['date_to']); //$table_top_5_search = $this->getTableTop5Search(); - return array( - 'data_table' => array( + return [ + 'data_table' => [ 'table_recent_orders' => $table_recent_orders, 'table_best_sellers' => $table_best_sellers, 'table_most_viewed' => $table_most_viewed, 'table_top_10_most_search' => $table_top_10_most_search, //'table_top_5_search' => $table_top_5_search - ) - ); + ], + ]; } public function getTableRecentOrders() { - $header = array( - array('title' => $this->trans('Customer Name', array(), 'Modules.Dashproducts.Admin'), 'class' => 'text-left'), - array('title' => $this->trans('Products', array(), 'Admin.Global'), 'class' => 'text-center'), - array('title' => $this->trans('Total', array(), 'Admin.Global').' '.$this->trans('Tax excl.', array(), 'Admin.Global'), 'class' => 'text-center'), - array('title' => $this->trans('Date', array(), 'Admin.Global'), 'class' => 'text-center'), - array('title' => $this->trans('Status', array(), 'Admin.Global'), 'class' => 'text-center'), - array('title' => '', 'class' => 'text-right'), - ); - - $limit = (int)Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER') ? (int)Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER') : 10; + $header = [ + ['title' => $this->trans('Customer Name', [], 'Modules.Dashproducts.Admin'), 'class' => 'text-left'], + ['title' => $this->trans('Products', [], 'Admin.Global'), 'class' => 'text-center'], + ['title' => $this->trans('Total', [], 'Admin.Global') . ' ' . $this->trans('Tax excl.', [], 'Admin.Global'), 'class' => 'text-center'], + ['title' => $this->trans('Date', [], 'Admin.Global'), 'class' => 'text-center'], + ['title' => $this->trans('Status', [], 'Admin.Global'), 'class' => 'text-center'], + ['title' => '', 'class' => 'text-right'], + ]; + + $limit = (int) Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER') ? (int) Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER') : 10; $orders = Order::getOrdersWithInformations($limit); - $body = array(); + $body = []; foreach ($orders as $order) { - $currency = Currency::getCurrency((int)$order['id_currency']); - $tr = array(); - $tr[] = array( + $currency = Currency::getCurrency((int) $order['id_currency']); + $tr = []; + $tr[] = [ 'id' => 'firstname_lastname', 'value' => !empty($order['id_customer']) ? sprintf( '%s %s', $this->context->link->getAdminLink('AdminCustomers', true, [ 'route' => 'admin_customers_view', - 'customerId' => $order['id_customer'] + 'customerId' => $order['id_customer'], ]), Tools::htmlentitiesUTF8($order['firstname']), Tools::htmlentitiesUTF8($order['lastname']) ) : '', 'class' => 'text-left', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'total_products', - 'value' => count(OrderDetail::getList((int)$order['id_order'])), + 'value' => count(OrderDetail::getList((int) $order['id_order'])), 'class' => 'text-center', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'total_paid', - 'value' => $this->context->getCurrentLocale()->formatPrice((float)$order['total_paid_tax_excl'], $currency->iso_code), + 'value' => $this->context->getCurrentLocale()->formatPrice((float) $order['total_paid_tax_excl'], $currency->iso_code), 'class' => 'text-center', 'wrapper_start' => $order['valid'] ? '' : '', 'wrapper_end' => '', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'date_add', 'value' => Tools::displayDate($order['date_add']), 'class' => 'text-center', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'status', 'value' => Tools::htmlentitiesUTF8($order['state_name']), 'class' => 'text-center', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'details', 'value' => '', 'class' => 'text-right', - 'wrapper_start' => '', - 'wrapper_end' => '' - ); + 'wrapper_start' => '', + 'wrapper_end' => '', + ]; $body[] = $tr; } - return array('header' => $header, 'body' => $body); + return ['header' => $header, 'body' => $body]; } public function getTableBestSellers($date_from, $date_to) { - $header = array( - array( + $header = [ + [ 'id' => 'image', - 'title' => $this->trans('Image', array(), 'Admin.Global'), + 'title' => $this->trans('Image', [], 'Admin.Global'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'product', - 'title' => $this->trans('Product', array(), 'Admin.Global'), + 'title' => $this->trans('Product', [], 'Admin.Global'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'category', - 'title' => $this->trans('Category', array(), 'Admin.Catalog.Feature'), + 'title' => $this->trans('Category', [], 'Admin.Catalog.Feature'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'total_sold', - 'title' => $this->trans('Total sold', array(), 'Modules.Dashproducts.Admin'), + 'title' => $this->trans('Total sold', [], 'Modules.Dashproducts.Admin'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'sales', - 'title' => $this->trans('Sales', array(), 'Admin.Global'), + 'title' => $this->trans('Sales', [], 'Admin.Global'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'net_profit', - 'title' => $this->trans('Net profit', array(), 'Modules.Dashproducts.Admin'), + 'title' => $this->trans('Net profit', [], 'Modules.Dashproducts.Admin'), 'class' => 'text-center', - ) - ); + ], + ]; $products = Db::getInstance()->ExecuteS( ' @@ -205,21 +204,21 @@ public function getTableBestSellers($date_from, $date_to) pa.price as price_attribute, SUM(total_price_tax_excl / conversion_rate) as sales, SUM(product_quantity * purchase_supplier_price / conversion_rate) as expenses - FROM `'._DB_PREFIX_.'orders` o - LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON o.id_order = od.id_order - LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = product_id - LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.id_product_attribute = od.product_attribute_id + FROM `' . _DB_PREFIX_ . 'orders` o + LEFT JOIN `' . _DB_PREFIX_ . 'order_detail` od ON o.id_order = od.id_order + LEFT JOIN `' . _DB_PREFIX_ . 'product` p ON p.id_product = product_id + LEFT JOIN `' . _DB_PREFIX_ . 'product_attribute` pa ON pa.id_product_attribute = od.product_attribute_id WHERE `invoice_date` BETWEEN "' . pSQL($date_from) . ' 00:00:00" AND "' . pSQL($date_to) . ' 23:59:59" AND valid = 1 ' . Shop::addSqlRestriction(false, 'o') . ' GROUP BY product_id, product_attribute_id ORDER BY total DESC - LIMIT ' . (int)Configuration::get('DASHPRODUCT_NBR_SHOW_BEST_SELLER') + LIMIT ' . (int) Configuration::get('DASHPRODUCT_NBR_SHOW_BEST_SELLER') ); - $body = array(); + $body = []; foreach ($products as $product) { - $product_obj = new Product((int)$product['product_id'], false, $this->context->language->id); + $product_obj = new Product((int) $product['product_id'], false, $this->context->language->id); if (!Validate::isLoadedObject($product_obj)) { continue; } @@ -228,8 +227,8 @@ public function getTableBestSellers($date_from, $date_to) $img = ''; if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image']) { $image = new Image($row_image['id_image']); - $path_to_image = _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$this->context->controller->imageType; - $img = ImageManager::thumbnail($path_to_image, 'product_mini_'.$row_image['id_image'].'.'.$this->context->controller->imageType, 45, $this->context->controller->imageType); + $path_to_image = _PS_PROD_IMG_DIR_ . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; + $img = ImageManager::thumbnail($path_to_image, 'product_mini_' . $row_image['id_image'] . '.' . $this->context->controller->imageType, 45, $this->context->controller->imageType); } $productPrice = $product['price']; @@ -237,85 +236,85 @@ public function getTableBestSellers($date_from, $date_to) $productPrice = $product['price_attribute']; } - $body[] = array( - array( + $body[] = [ + [ 'id' => 'product', 'value' => $img, - 'class' => 'text-center' - ), - array( + 'class' => 'text-center', + ], + [ 'id' => 'product', - 'value' => ''.Tools::htmlentitiesUTF8($product['product_name']).''.'
' . - $this->context->getCurrentLocale()->formatPrice($productPrice, $this->context->currency->iso_code), - 'class' => 'text-center' - ), - array( + 'value' => '' . Tools::htmlentitiesUTF8($product['product_name']) . '' . '
' . + $this->context->getCurrentLocale()->formatPrice($productPrice, $this->context->currency->iso_code), + 'class' => 'text-center', + ], + [ 'id' => 'category', 'value' => $category->name, - 'class' => 'text-center' - ), - array( + 'class' => 'text-center', + ], + [ 'id' => 'total_sold', 'value' => $product['total'], - 'class' => 'text-center' - ), - array( + 'class' => 'text-center', + ], + [ 'id' => 'sales', 'value' => $this->context->getCurrentLocale()->formatPrice($product['sales'], $this->context->currency->iso_code), - 'class' => 'text-center' - ), - array( + 'class' => 'text-center', + ], + [ 'id' => 'net_profit', 'value' => $this->context->getCurrentLocale()->formatPrice(($product['sales'] - $product['expenses']), $this->context->currency->iso_code), - 'class' => 'text-center' - ) - ); + 'class' => 'text-center', + ], + ]; } - return array('header' => $header, 'body' => $body); + return ['header' => $header, 'body' => $body]; } public function getTableMostViewed($date_from, $date_to) { - $header = array( - array( + $header = [ + [ 'id' => 'image', - 'title' => $this->trans('Image', array(), 'Admin.Global'), + 'title' => $this->trans('Image', [], 'Admin.Global'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'product', - 'title' => $this->trans('Product', array(), 'Admin.Global'), + 'title' => $this->trans('Product', [], 'Admin.Global'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'views', - 'title' => $this->trans('Views', array(), 'Modules.Dashproducts.Admin'), + 'title' => $this->trans('Views', [], 'Modules.Dashproducts.Admin'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'added_to_cart', - 'title' => $this->trans('Added to cart', array(), 'Modules.Dashproducts.Admin'), + 'title' => $this->trans('Added to cart', [], 'Modules.Dashproducts.Admin'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'purchased', - 'title' => $this->trans('Purchased', array(), 'Modules.Dashproducts.Admin'), + 'title' => $this->trans('Purchased', [], 'Modules.Dashproducts.Admin'), 'class' => 'text-center', - ), - array( + ], + [ 'id' => 'rate', - 'title' => $this->trans('Percentage', array(), 'Admin.Global'), + 'title' => $this->trans('Percentage', [], 'Admin.Global'), 'class' => 'text-center', - ) - ); + ], + ]; if (Configuration::get('PS_STATSDATA_PAGESVIEWS')) { - $products = $this->getTotalViewed($date_from, $date_to, (int)Configuration::get('DASHPRODUCT_NBR_SHOW_MOST_VIEWED')); - $body = array(); + $products = $this->getTotalViewed($date_from, $date_to, (int) Configuration::get('DASHPRODUCT_NBR_SHOW_MOST_VIEWED')); + $body = []; if (is_array($products) && count($products)) { foreach ($products as $product) { - $product_obj = new Product((int)$product['id_object'], true, $this->context->language->id); + $product_obj = new Product((int) $product['id_object'], true, $this->context->language->id); if (!Validate::isLoadedObject($product_obj)) { continue; } @@ -323,158 +322,159 @@ public function getTableMostViewed($date_from, $date_to) $img = ''; if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image']) { $image = new Image($row_image['id_image']); - $path_to_image = _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$this->context->controller->imageType; + $path_to_image = _PS_PROD_IMG_DIR_ . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; $img = ImageManager::thumbnail( $path_to_image, - 'product_mini_'.$product_obj->id.'.'.$this->context->controller->imageType, + 'product_mini_' . $product_obj->id . '.' . $this->context->controller->imageType, 45, $this->context->controller->imageType ); } - $tr = array(); - $tr[] = array( + $tr = []; + $tr[] = [ 'id' => 'product', 'value' => $img, - 'class' => 'text-center' - ); - $tr[] = array( + 'class' => 'text-center', + ]; + $tr[] = [ 'id' => 'product', - 'value' => Tools::htmlentitiesUTF8($product_obj->name).'
'. $this->context->getCurrentLocale()->formatPrice(Product::getPriceStatic((int)$product_obj->id), $this->context->currency->iso_code), + 'value' => Tools::htmlentitiesUTF8($product_obj->name) . '
' . $this->context->getCurrentLocale()->formatPrice(Product::getPriceStatic((int) $product_obj->id), $this->context->currency->iso_code), 'class' => 'text-center', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'views', 'value' => $product['counter'], 'class' => 'text-center', - ); - $added_cart = $this->getTotalProductAddedCart($date_from, $date_to, (int)$product_obj->id); - $tr[] = array( + ]; + $added_cart = $this->getTotalProductAddedCart($date_from, $date_to, (int) $product_obj->id); + $tr[] = [ 'id' => 'added_to_cart', 'value' => $added_cart, 'class' => 'text-center', - ); - $purchased = $this->getTotalProductPurchased($date_from, $date_to, (int)$product_obj->id); - $tr[] = array( + ]; + $purchased = $this->getTotalProductPurchased($date_from, $date_to, (int) $product_obj->id); + $tr[] = [ 'id' => 'purchased', - 'value' => $this->getTotalProductPurchased($date_from, $date_to, (int)$product_obj->id), + 'value' => $this->getTotalProductPurchased($date_from, $date_to, (int) $product_obj->id), 'class' => 'text-center', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'rate', - 'value' => ($product['counter'] ? round(100 * $purchased / $product['counter'], 1).'%' : '-'), + 'value' => ($product['counter'] ? round(100 * $purchased / $product['counter'], 1) . '%' : '-'), 'class' => 'text-center', - ); + ]; $body[] = $tr; } } } else { - $body = '
'.$this->trans('You must enable the "Save global page views" option from the "Data mining for statistics" module in order to display the most viewed products, or use the Google Analytics module.', array(), 'Modules.Dashproducts.Admin').'
'; + $body = '
' . $this->trans('You must enable the "Save global page views" option from the "Data mining for statistics" module in order to display the most viewed products, or use the Google Analytics module.', [], 'Modules.Dashproducts.Admin') . '
'; } - return array('header' => $header, 'body' => $body); + + return ['header' => $header, 'body' => $body]; } public function getTableTop10MostSearch($date_from, $date_to) { - $header = array( - array( + $header = [ + [ 'id' => 'reference', - 'title' => $this->trans('Term', array(), 'Modules.Dashproducts.Admin'), - 'class' => 'text-left' - ), - array( + 'title' => $this->trans('Term', [], 'Modules.Dashproducts.Admin'), + 'class' => 'text-left', + ], + [ 'id' => 'name', - 'title' => $this->trans('Search', array(), 'Admin.Shopparameters.Feature'), - 'class' => 'text-center' - ), - array( + 'title' => $this->trans('Search', [], 'Admin.Shopparameters.Feature'), + 'class' => 'text-center', + ], + [ 'id' => 'totalQuantitySold', - 'title' => $this->trans('Results', array(), 'Modules.Dashproducts.Admin'), - 'class' => 'text-center' - ) - ); + 'title' => $this->trans('Results', [], 'Modules.Dashproducts.Admin'), + 'class' => 'text-center', + ], + ]; - $terms = $this->getMostSearchTerms($date_from, $date_to, (int)Configuration::get('DASHPRODUCT_NBR_SHOW_TOP_SEARCH')); - $body = array(); + $terms = $this->getMostSearchTerms($date_from, $date_to, (int) Configuration::get('DASHPRODUCT_NBR_SHOW_TOP_SEARCH')); + $body = []; if (is_array($terms) && count($terms)) { foreach ($terms as $term) { - $tr = array(); - $tr[] = array( + $tr = []; + $tr[] = [ 'id' => 'product', 'value' => $term['keywords'], 'class' => 'text-left', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'product', 'value' => $term['count_keywords'], 'class' => 'text-center', - ); - $tr[] = array( + ]; + $tr[] = [ 'id' => 'product', 'value' => $term['results'], 'class' => 'text-center', - ); + ]; $body[] = $tr; } } - return array('header' => $header, 'body' => $body); + return ['header' => $header, 'body' => $body]; } public function getTableTop5Search() { - $header = array( - array( + $header = [ + [ 'id' => 'reference', - 'title' => $this->trans('Product', array(), 'Admin.Global'), - ) - ); + 'title' => $this->trans('Product', [], 'Admin.Global'), + ], + ]; - $body = array(); + $body = []; - return array('header' => $header, 'body' => $body); + return ['header' => $header, 'body' => $body]; } public function getTotalProductSales($date_from, $date_to, $id_product) { $sql = 'SELECT SUM(od.`product_quantity` * od.`product_price`) AS total - FROM `'._DB_PREFIX_.'order_detail` od - JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = od.`id_order` - WHERE od.`product_id` = '.(int)$id_product.' - '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').' + FROM `' . _DB_PREFIX_ . 'order_detail` od + JOIN `' . _DB_PREFIX_ . 'orders` o ON o.`id_order` = od.`id_order` + WHERE od.`product_id` = ' . (int) $id_product . ' + ' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') . ' AND o.valid = 1 - AND o.`date_add` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"'; + AND o.`date_add` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '"'; - return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); + return (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } public function getTotalProductAddedCart($date_from, $date_to, $id_product) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT count(`id_product`) as count - FROM `'._DB_PREFIX_.'cart_product` cp - WHERE cp.`id_product` = '.(int)$id_product.' - '.Shop::addSqlRestriction(false, 'cp').' - AND cp.`date_add` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"'); + FROM `' . _DB_PREFIX_ . 'cart_product` cp + WHERE cp.`id_product` = ' . (int) $id_product . ' + ' . Shop::addSqlRestriction(false, 'cp') . ' + AND cp.`date_add` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '"'); } public function getTotalProductPurchased($date_from, $date_to, $id_product) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT count(`product_id`) as count - FROM `'._DB_PREFIX_.'order_detail` od - JOIN `'._DB_PREFIX_.'orders` o ON o.`id_order` = od.`id_order` - WHERE od.`product_id` = '.(int)$id_product.' - '.Shop::addSqlRestriction(false, 'od').' + FROM `' . _DB_PREFIX_ . 'order_detail` od + JOIN `' . _DB_PREFIX_ . 'orders` o ON o.`id_order` = od.`id_order` + WHERE od.`product_id` = ' . (int) $id_product . ' + ' . Shop::addSqlRestriction(false, 'od') . ' AND o.valid = 1 - AND o.`date_add` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"'); + AND o.`date_add` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '"'); } public function getTotalViewed($date_from, $date_to, $limit = 10) { $gapi = Module::isInstalled('gapi') ? Module::getInstanceByName('gapi') : false; if (Validate::isLoadedObject($gapi) && $gapi->isConfigured()) { - $products = array(); + $products = []; // Only works with the default product URL pattern at this time $result = $gapi->requestReportData( 'ga:pagePath', @@ -487,11 +487,10 @@ public function getTotalViewed($date_from, $date_to, $limit = 10) 10 ); - if ($result) { foreach ($result as $row) { if (preg_match('@/([a-z]{2}/)?([a-z]+/)?([0-9]+)\-.*\.html$@', $row['dimensions']['pagePath'], $matches)) { - $products[] = array('id_object' => (int)$matches[3], 'counter' => $row['metrics']['visits']); + $products[] = ['id_object' => (int) $matches[3], 'counter' => $row['metrics']['visits']]; } } } @@ -500,115 +499,115 @@ public function getTotalViewed($date_from, $date_to, $limit = 10) } else { return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT p.id_object, pv.counter - FROM `'._DB_PREFIX_.'page_viewed` pv - LEFT JOIN `'._DB_PREFIX_.'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` - LEFT JOIN `'._DB_PREFIX_.'page` p ON pv.`id_page` = p.`id_page` - LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON pt.`id_page_type` = p.`id_page_type` + FROM `' . _DB_PREFIX_ . 'page_viewed` pv + LEFT JOIN `' . _DB_PREFIX_ . 'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` + LEFT JOIN `' . _DB_PREFIX_ . 'page` p ON pv.`id_page` = p.`id_page` + LEFT JOIN `' . _DB_PREFIX_ . 'page_type` pt ON pt.`id_page_type` = p.`id_page_type` WHERE pt.`name` = \'product\' - '.Shop::addSqlRestriction(false, 'pv').' - AND dr.`time_start` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'" - AND dr.`time_end` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'" + ' . Shop::addSqlRestriction(false, 'pv') . ' + AND dr.`time_start` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" + AND dr.`time_end` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" ORDER BY pv.counter DESC - LIMIT '.(int)$limit); + LIMIT ' . (int) $limit); } } public function getMostSearchTerms($date_from, $date_to, $limit = 10) { if (!Module::isInstalled('statssearch')) { - return array(); + return []; } return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT `keywords`, count(`id_statssearch`) as count_keywords, `results` - FROM `'._DB_PREFIX_.'statssearch` ss - WHERE ss.`date_add` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'" - '.Shop::addSqlRestriction(false, 'ss').' + FROM `' . _DB_PREFIX_ . 'statssearch` ss + WHERE ss.`date_add` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" + ' . Shop::addSqlRestriction(false, 'ss') . ' GROUP BY ss.`keywords` ORDER BY `count_keywords` DESC - LIMIT '.(int)$limit); + LIMIT ' . (int) $limit); } public function renderConfigForm() { - $fields_form = array( - 'form' => array( - 'input' => array(), - 'submit' => array( - 'title' => $this->trans('Save', array(), 'Admin.Actions'), + $fields_form = [ + 'form' => [ + 'input' => [], + 'submit' => [ + 'title' => $this->trans('Save', [], 'Admin.Actions'), 'class' => 'btn btn-default pull-right submit_dash_config', - 'reset' => array( - 'title' => $this->trans('Cancel', array(), 'Admin.Actions'), + 'reset' => [ + 'title' => $this->trans('Cancel', [], 'Admin.Actions'), 'class' => 'btn btn-default cancel_dash_config', - ) - ) - ), - ); - - $inputs = array( - array( - 'label' => $this->trans('Number of "Recent Orders" to display', array(), 'Modules.Dashproducts.Admin'), - 'config_name' => 'DASHPRODUCT_NBR_SHOW_LAST_ORDER' - ), - array( - 'label' => $this->trans('Number of "Best Sellers" to display', array(), 'Modules.Dashproducts.Admin'), - 'config_name' => 'DASHPRODUCT_NBR_SHOW_BEST_SELLER' - ), - array( - 'label' => $this->trans('Number of "Most Viewed" to display', array(), 'Modules.Dashproducts.Admin'), - 'config_name' => 'DASHPRODUCT_NBR_SHOW_MOST_VIEWED' - ), - array( - 'label' => $this->trans('Number of "Top Searches" to display', array(), 'Modules.Dashproducts.Admin'), - 'config_name' => 'DASHPRODUCT_NBR_SHOW_TOP_SEARCH' - ), - ); + ], + ], + ], + ]; + + $inputs = [ + [ + 'label' => $this->trans('Number of "Recent Orders" to display', [], 'Modules.Dashproducts.Admin'), + 'config_name' => 'DASHPRODUCT_NBR_SHOW_LAST_ORDER', + ], + [ + 'label' => $this->trans('Number of "Best Sellers" to display', [], 'Modules.Dashproducts.Admin'), + 'config_name' => 'DASHPRODUCT_NBR_SHOW_BEST_SELLER', + ], + [ + 'label' => $this->trans('Number of "Most Viewed" to display', [], 'Modules.Dashproducts.Admin'), + 'config_name' => 'DASHPRODUCT_NBR_SHOW_MOST_VIEWED', + ], + [ + 'label' => $this->trans('Number of "Top Searches" to display', [], 'Modules.Dashproducts.Admin'), + 'config_name' => 'DASHPRODUCT_NBR_SHOW_TOP_SEARCH', + ], + ]; foreach ($inputs as $input) { - $fields_form['form']['input'][] = array( + $fields_form['form']['input'][] = [ 'type' => 'select', 'label' => $input['label'], 'name' => $input['config_name'], - 'options' => array( - 'query' => array( - array('id' => 5, 'name' => 5), - array('id' => 10, 'name' => 10), - array('id' => 20, 'name' => 20), - array('id' => 50, 'name' => 50), - ), + 'options' => [ + 'query' => [ + ['id' => 5, 'name' => 5], + ['id' => 10, 'name' => 10], + ['id' => 20, 'name' => 20], + ['id' => 50, 'name' => 50], + ], 'id' => 'id', 'name' => 'name', - ) - ); + ], + ]; } $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; - $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); + $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; - $this->fields_form = array(); - $helper->id = (int)Tools::getValue('id_carrier'); + $this->fields_form = []; + $helper->id = (int) Tools::getValue('id_carrier'); $helper->identifier = $this->identifier; $helper->submit_action = 'submitDashConfig'; - $helper->tpl_vars = array( + $helper->tpl_vars = [ 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), - 'id_language' => $this->context->language->id - ); + 'id_language' => $this->context->language->id, + ]; - return $helper->generateForm(array($fields_form)); + return $helper->generateForm([$fields_form]); } public function getConfigFieldsValues() { - return array( + return [ 'DASHPRODUCT_NBR_SHOW_LAST_ORDER' => Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER'), 'DASHPRODUCT_NBR_SHOW_BEST_SELLER' => Configuration::get('DASHPRODUCT_NBR_SHOW_BEST_SELLER'), 'DASHPRODUCT_NBR_SHOW_MOST_VIEWED' => Configuration::get('DASHPRODUCT_NBR_SHOW_MOST_VIEWED'), 'DASHPRODUCT_NBR_SHOW_TOP_SEARCH' => Configuration::get('DASHPRODUCT_NBR_SHOW_TOP_SEARCH'), - ); + ]; } /** diff --git a/index.php b/index.php index f574df3..45df26c 100644 --- a/index.php +++ b/index.php @@ -23,9 +23,8 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); diff --git a/translations/index.php b/translations/index.php index c61cf57..45df26c 100644 --- a/translations/index.php +++ b/translations/index.php @@ -23,13 +23,12 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ - -header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); -header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); - -header("Cache-Control: no-store, no-cache, must-revalidate"); -header("Cache-Control: post-check=0, pre-check=0", false); -header("Pragma: no-cache"); - -header("Location: ../"); +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); exit; diff --git a/views/index.php b/views/index.php index f574df3..45df26c 100644 --- a/views/index.php +++ b/views/index.php @@ -23,9 +23,8 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); diff --git a/views/templates/hook/index.php b/views/templates/hook/index.php index f574df3..45df26c 100644 --- a/views/templates/hook/index.php +++ b/views/templates/hook/index.php @@ -23,9 +23,8 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); diff --git a/views/templates/index.php b/views/templates/index.php index f574df3..45df26c 100644 --- a/views/templates/index.php +++ b/views/templates/index.php @@ -23,9 +23,8 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); From 786b6314a0abe1295f2f972cff8a19b1fd77800a Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 7 Feb 2022 17:00:00 +0100 Subject: [PATCH 17/19] Fixed PHPStan --- dashproducts.php | 84 ++++++++----------------------- tests/phpstan/phpstan-1.7.6.neon | 7 +++ tests/phpstan/phpstan-1.7.7.neon | 7 +++ tests/phpstan/phpstan-1.7.8.neon | 7 +++ tests/phpstan/phpstan-latest.neon | 7 +++ 5 files changed, 49 insertions(+), 63 deletions(-) diff --git a/dashproducts.php b/dashproducts.php index aafa101..45c2cb3 100755 --- a/dashproducts.php +++ b/dashproducts.php @@ -80,14 +80,12 @@ public function hookDashboardData($params) $table_most_viewed = $this->getTableMostViewed($params['date_from'], $params['date_to']); $table_top_10_most_search = $this->getTableTop10MostSearch($params['date_from'], $params['date_to']); - //$table_top_5_search = $this->getTableTop5Search(); return [ 'data_table' => [ 'table_recent_orders' => $table_recent_orders, 'table_best_sellers' => $table_best_sellers, 'table_most_viewed' => $table_most_viewed, 'table_top_10_most_search' => $table_top_10_most_search, - //'table_top_5_search' => $table_top_5_search ], ]; } @@ -108,6 +106,7 @@ public function getTableRecentOrders() $body = []; foreach ($orders as $order) { + /** @var array $currency */ $currency = Currency::getCurrency((int) $order['id_currency']); $tr = []; $tr[] = [ @@ -130,7 +129,7 @@ public function getTableRecentOrders() ]; $tr[] = [ 'id' => 'total_paid', - 'value' => $this->context->getCurrentLocale()->formatPrice((float) $order['total_paid_tax_excl'], $currency->iso_code), + 'value' => $this->context->getCurrentLocale()->formatPrice((float) $order['total_paid_tax_excl'], $currency['iso_code']), 'class' => 'text-center', 'wrapper_start' => $order['valid'] ? '' : '', 'wrapper_end' => '', @@ -222,11 +221,11 @@ public function getTableBestSellers($date_from, $date_to) if (!Validate::isLoadedObject($product_obj)) { continue; } - $category = new Category($product_obj->getDefaultCategory(), $this->context->language->id); + $category = new Category($product_obj->getDefaultCategory()['id_category_default'], $this->context->language->id); $img = ''; if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image']) { - $image = new Image($row_image['id_image']); + $image = new Image((int) $row_image['id_image']); $path_to_image = _PS_PROD_IMG_DIR_ . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; $img = ImageManager::thumbnail($path_to_image, 'product_mini_' . $row_image['id_image'] . '.' . $this->context->controller->imageType, 45, $this->context->controller->imageType); } @@ -321,7 +320,7 @@ public function getTableMostViewed($date_from, $date_to) $img = ''; if (($row_image = Product::getCover($product_obj->id)) && $row_image['id_image']) { - $image = new Image($row_image['id_image']); + $image = new Image((int) $row_image['id_image']); $path_to_image = _PS_PROD_IMG_DIR_ . $image->getExistingImgPath() . '.' . $this->context->controller->imageType; $img = ImageManager::thumbnail( $path_to_image, @@ -421,20 +420,6 @@ public function getTableTop10MostSearch($date_from, $date_to) return ['header' => $header, 'body' => $body]; } - public function getTableTop5Search() - { - $header = [ - [ - 'id' => 'reference', - 'title' => $this->trans('Product', [], 'Admin.Global'), - ], - ]; - - $body = []; - - return ['header' => $header, 'body' => $body]; - } - public function getTotalProductSales($date_from, $date_to, $id_product) { $sql = 'SELECT SUM(od.`product_quantity` * od.`product_price`) AS total @@ -445,12 +430,12 @@ public function getTotalProductSales($date_from, $date_to, $id_product) AND o.valid = 1 AND o.`date_add` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '"'; - return (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); + return (int) Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->getValue($sql); } public function getTotalProductAddedCart($date_from, $date_to, $id_product) { - return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + return Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->getValue(' SELECT count(`id_product`) as count FROM `' . _DB_PREFIX_ . 'cart_product` cp WHERE cp.`id_product` = ' . (int) $id_product . ' @@ -460,7 +445,7 @@ public function getTotalProductAddedCart($date_from, $date_to, $id_product) public function getTotalProductPurchased($date_from, $date_to, $id_product) { - return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + return Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->getValue(' SELECT count(`product_id`) as count FROM `' . _DB_PREFIX_ . 'order_detail` od JOIN `' . _DB_PREFIX_ . 'orders` o ON o.`id_order` = od.`id_order` @@ -472,44 +457,18 @@ public function getTotalProductPurchased($date_from, $date_to, $id_product) public function getTotalViewed($date_from, $date_to, $limit = 10) { - $gapi = Module::isInstalled('gapi') ? Module::getInstanceByName('gapi') : false; - if (Validate::isLoadedObject($gapi) && $gapi->isConfigured()) { - $products = []; - // Only works with the default product URL pattern at this time - $result = $gapi->requestReportData( - 'ga:pagePath', - 'ga:visits', - $date_from, - $date_to, - '-ga:visits', - 'ga:pagePath=~/([a-z]{2}/)?([a-z]+/)?[0-9][0-9]*\-.*\.html$', - 1, - 10 - ); - - if ($result) { - foreach ($result as $row) { - if (preg_match('@/([a-z]{2}/)?([a-z]+/)?([0-9]+)\-.*\.html$@', $row['dimensions']['pagePath'], $matches)) { - $products[] = ['id_object' => (int) $matches[3], 'counter' => $row['metrics']['visits']]; - } - } - } - - return $products; - } else { - return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT p.id_object, pv.counter - FROM `' . _DB_PREFIX_ . 'page_viewed` pv - LEFT JOIN `' . _DB_PREFIX_ . 'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` - LEFT JOIN `' . _DB_PREFIX_ . 'page` p ON pv.`id_page` = p.`id_page` - LEFT JOIN `' . _DB_PREFIX_ . 'page_type` pt ON pt.`id_page_type` = p.`id_page_type` - WHERE pt.`name` = \'product\' - ' . Shop::addSqlRestriction(false, 'pv') . ' - AND dr.`time_start` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" - AND dr.`time_end` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" - ORDER BY pv.counter DESC - LIMIT ' . (int) $limit); - } + return Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->executeS(' + SELECT p.id_object, pv.counter + FROM `' . _DB_PREFIX_ . 'page_viewed` pv + LEFT JOIN `' . _DB_PREFIX_ . 'date_range` dr ON pv.`id_date_range` = dr.`id_date_range` + LEFT JOIN `' . _DB_PREFIX_ . 'page` p ON pv.`id_page` = p.`id_page` + LEFT JOIN `' . _DB_PREFIX_ . 'page_type` pt ON pt.`id_page_type` = p.`id_page_type` + WHERE pt.`name` = \'product\' + ' . Shop::addSqlRestriction(false, 'pv') . ' + AND dr.`time_start` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" + AND dr.`time_end` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" + ORDER BY pv.counter DESC + LIMIT ' . (int) $limit); } public function getMostSearchTerms($date_from, $date_to, $limit = 10) @@ -518,7 +477,7 @@ public function getMostSearchTerms($date_from, $date_to, $limit = 10) return []; } - return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' + return Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->executeS(' SELECT `keywords`, count(`id_statssearch`) as count_keywords, `results` FROM `' . _DB_PREFIX_ . 'statssearch` ss WHERE ss.`date_add` BETWEEN "' . pSQL($date_from) . '" AND "' . pSQL($date_to) . '" @@ -587,7 +546,6 @@ public function renderConfigForm() $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; - $this->fields_form = []; $helper->id = (int) Tools::getValue('id_carrier'); $helper->identifier = $this->identifier; $helper->submit_action = 'submitDashConfig'; diff --git a/tests/phpstan/phpstan-1.7.6.neon b/tests/phpstan/phpstan-1.7.6.neon index c604f7c..d3a2c34 100644 --- a/tests/phpstan/phpstan-1.7.6.neon +++ b/tests/phpstan/phpstan-1.7.6.neon @@ -1,2 +1,9 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#Parameter \#1 \$id of class Image constructor expects null, int given#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' + - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#' diff --git a/tests/phpstan/phpstan-1.7.7.neon b/tests/phpstan/phpstan-1.7.7.neon index c604f7c..d3a2c34 100644 --- a/tests/phpstan/phpstan-1.7.7.neon +++ b/tests/phpstan/phpstan-1.7.7.neon @@ -1,2 +1,9 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#Parameter \#1 \$id of class Image constructor expects null, int given#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' + - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#' diff --git a/tests/phpstan/phpstan-1.7.8.neon b/tests/phpstan/phpstan-1.7.8.neon index c604f7c..d3a2c34 100644 --- a/tests/phpstan/phpstan-1.7.8.neon +++ b/tests/phpstan/phpstan-1.7.8.neon @@ -1,2 +1,9 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#Parameter \#1 \$id of class Image constructor expects null, int given#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' + - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#' diff --git a/tests/phpstan/phpstan-latest.neon b/tests/phpstan/phpstan-latest.neon index c604f7c..d3a2c34 100644 --- a/tests/phpstan/phpstan-latest.neon +++ b/tests/phpstan/phpstan-latest.neon @@ -1,2 +1,9 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#Parameter \#1 \$id of class Image constructor expects null, int given#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' + - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' + - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#' From 99d46347cfcdbc225498576f8b40edb1bd196e87 Mon Sep 17 00:00:00 2001 From: atomiix Date: Thu, 30 Jun 2022 13:01:30 +0200 Subject: [PATCH 18/19] Use Organization Build Release Github Action --- .github/workflows/build-release.yml | 61 ++--------------------------- 1 file changed, 3 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index eb16626..28ba23f 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -2,61 +2,6 @@ name: Build on: [push, pull_request] jobs: - deploy: - name: build dependencies & create artifact - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.0.0 - - name: Install composer dependencies - run: composer install --no-dev -o - - name: Clean-up project - uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0 - - name: Prepare auto-index tool - run: | - composer global require prestashop/autoindex - - name: Generate index.php - run: | - ~/.composer/vendor/bin/autoindex - - name: Create & upload artifact - uses: actions/upload-artifact@v1 - with: - name: ${{ github.event.repository.name }} - path: ../ - update_release_draft: - runs-on: ubuntu-latest - needs: [deploy] - if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' - steps: - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: ${{ github.event.repository.name }} - - id: release_info - uses: toolmantim/release-drafter@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Prepare for Release - run: | - cd ${{ github.event.repository.name }} - zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} - - name: Clean existing assets - shell: bash - run: | - curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 - assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` - for asset in $assets - do - bin/hub api -X DELETE $asset - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to GitHub Release - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.release_info.outputs.upload_url }} - asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip - asset_name: ${{ github.event.repository.name }}.zip - asset_content_type: application/zip + build-and-release-draft: + name: Build & Release draft + uses: PrestaShop/.github/.github/workflows/build-release.yml@master From af8736ab00d4e277deebb946a38ba37c02274045 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Thu, 24 Nov 2022 10:50:40 +0100 Subject: [PATCH 19/19] Support for PHP 8.2 & Added PHPStan for PS 8.0 --- .github/workflows/php.yml | 7 +++++-- tests/phpstan/phpstan-8.0.neon | 3 +++ tests/phpstan/phpstan-latest.neon | 7 ------- 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 tests/phpstan/phpstan-8.0.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c19bfb3..b3bbb2b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: # Check there is no syntax errors in the project php-linter: - name: PHP Syntax check 5.6 => 8.1 + name: PHP Syntax check 5.6 => 8.2 runs-on: ubuntu-latest steps: - name: Checkout @@ -28,6 +28,9 @@ jobs: - name: PHP syntax checker 8.1 uses: prestashop/github-action-php-lint/8.1@master + - name: PHP syntax checker 8.2 + uses: prestashop/github-action-php-lint/8.2@master + # Check the PHP code follow the coding standards php-cs-fixer: name: PHP-CS-Fixer @@ -59,7 +62,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - presta-versions: ['1.7.6', '1.7.7', '1.7.8', 'latest'] + presta-versions: ['1.7.6', '1.7.7', '1.7.8', '8.0', 'latest'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/tests/phpstan/phpstan-8.0.neon b/tests/phpstan/phpstan-8.0.neon new file mode 100644 index 0000000..3057aa9 --- /dev/null +++ b/tests/phpstan/phpstan-8.0.neon @@ -0,0 +1,3 @@ +includes: + - %currentWorkingDirectory%/tests/phpstan/phpstan.neon + diff --git a/tests/phpstan/phpstan-latest.neon b/tests/phpstan/phpstan-latest.neon index d3a2c34..c604f7c 100644 --- a/tests/phpstan/phpstan-latest.neon +++ b/tests/phpstan/phpstan-latest.neon @@ -1,9 +1,2 @@ includes: - %currentWorkingDirectory%/tests/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#Parameter \#1 \$id of class Image constructor expects null, int given#' - - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, false given.#' - - '#Parameter \#1 \$share of static method ShopCore::addSqlRestriction\(\) expects int, string given.#' - - '#Parameter \#1 \$variable of method ModuleCore::getPermission\(\) expects array, string given.#'