first commit

This commit is contained in:
2024-11-05 12:22:50 +01:00
commit e5682a3912
19641 changed files with 2948548 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,91 @@
name: PsAccountsInstaller Quality Control PHP
on: [push]
jobs:
php-linter:
name: PHP Syntax check 5.6|7.2|7.3
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
php-cs-fixer:
name: PHP-CS-FIXER
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
phpstan:
name: PHPSTAN
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['latest', '1.7.0.3', '1.6.1.21','1.6.1.0']
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Cache vendor folder
uses: actions/cache@v1
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
- name: Cache composer folder
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-composer-cache
- name: git clone ps_accounts
run: |
git clone https://${{ secrets.ACCESS_TOKEN }}@github.com/PrestaShopCorp/ps_accounts.git ~/ps_accounts
cd ~/ps_accounts
- name: composer install
run: composer install && cd ~/ps_accounts && composer install
- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }})
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}
- name: Select .neon file to run with PHPStan
id: neon
run: |
PS_VERSION=$(docker exec temp-ps bash -c 'echo "$PS_VERSION"')
[[ "${PS_VERSION:0:3}" != '1.7' ]] && echo ::set-output name=filename::phpstan-PS-1.6.neon || echo ::set-output name=filename::phpstan-PS-1.7.neon
- name : Run PHPStan
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -v ~/ps_accounts:/web/ps_accounts -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/${{steps.neon.outputs.filename}}
phpunit:
name: PHPUNIT
runs-on: ubuntu-latest
steps:
- name: checkout project
uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: composer install missing files
run: composer install
- name: PHPUnit tests
run: composer test

View File

@@ -0,0 +1,7 @@
### IDE ###
.idea
### composer ###
vendor
composer-dev.json
composer-dev.lock

View File

@@ -0,0 +1,12 @@
<?php
$config = new PrestaShop\CodingStandards\CsFixer\Config();
$config
->setUsingCache(false)
->getFinder()
->in(__DIR__)
->exclude('vendor')
->exclude('tests');
return $config;

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 PrestaShopCorp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,90 @@
# prestashop-accounts-installer
Utility package to install `ps_accounts` module or present data to trigger manual install from psx configuration page.
This module also give you access to `ps_accounts` services through its module service container dealing with the installation status of the module.
## Installation
This package is available on [Packagist](https://packagist.org/packages/prestashop/prestashop-accounts-installer),
you can install it via [Composer](https://getcomposer.org).
```shell script
composer require prestashop/prestashop-accounts-installer
```
## Register as a service in your PSx container (recommended)
Example :
```yaml
services:
ps_accounts.installer:
class: 'PrestaShop\PsAccountsInstaller\Installer\Installer'
arguments:
- '4.0.0'
ps_accounts.facade:
class: 'PrestaShop\PsAccountsInstaller\Installer\Facade\PsAccounts'
arguments:
- '@ps_accounts.installer'
```
## How to use it
### Installer
In your module main class `install` method. (Will only do something on PrestaShop 1.7 and above)
```php
$this->getService('ps_accounts.installer')->install();
```
### Presenter
For example in your main module's class `getContent` method.
```php
Media::addJsDef([
'contextPsAccounts' => $this->getService('ps_accounts.facade')
->getPsAccountsPresenter()
->present($this->name),
]);
```
This presenter will serve as default minimal presenter and switch to PsAccountsPresenter data when `ps_accounts` module is installed.
### Accessing PsAccounts Services
Installer class includes accessors to get instances of services from PsAccounts Module :
* getPsAccountsService
* getPsBillingService
The methods above will throw an exception in case `ps_accounts` module is not installed.
Example :
```php
use PrestaShop\PsAccountsInstaller\Installer\Exception\ModuleVersionException;
use PrestaShop\PsAccountsInstaller\Installer\Exception\ModuleNotInstalledException;
try {
$psAccountsService = $this->getService('ps_accounts.facade')->getPsAccountsService();
$shopJwt = $psAccountsService->getOrRefreshToken();
$shopUuid = $psAccountsService->getShopUuidV4();
$apiUrl = $psAccountsService->getAdminAjaxUrl();
// Your code here
} catch (ModuleNotInstalledException $e) {
// You handle exception here
} catch (ModuleVersionException $e) {
// You handle exception here
}
```

View File

@@ -0,0 +1,28 @@
{
"name": "prestashop/prestashop-accounts-installer",
"type": "library",
"description": "Utility package to install `ps_accounts` module or present data to trigger manual install from psx configuration page.",
"license": "MIT",
"autoload": {
"psr-4": {
"PrestaShop\\PsAccountsInstaller\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"PrestaShop\\PsAccountsInstaller\\Tests\\": "tests/"
}
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"prestashop/php-dev-tools": "3.*",
"friendsofphp/php-cs-fixer": "^2.16",
"fzaninotto/faker": "^1.9"
},
"scripts": {
"test": "./vendor/phpunit/phpunit/phpunit --configuration './phpunit.xml' --bootstrap './tests/bootstrap.php' --test-suffix 'Test.php,.phpt'"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php" colors="true" stopOnFailure="false">
<testsuites>
<testsuite name="prestashop-accounts-installer tests">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@@ -0,0 +1,7 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Installer\Exception;
class InstallerException extends \Exception
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Installer\Exception;
class ModuleNotInstalledException extends InstallerException
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Installer\Exception;
class ModuleVersionException extends InstallerException
{
}

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,93 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Installer\Facade;
use PrestaShop\PsAccountsInstaller\Installer\Exception\ModuleNotInstalledException;
use PrestaShop\PsAccountsInstaller\Installer\Exception\ModuleVersionException;
use PrestaShop\PsAccountsInstaller\Installer\Installer;
use PrestaShop\PsAccountsInstaller\Installer\Presenter\InstallerPresenter;
class PsAccounts
{
/**
* Available services class names
*/
const PS_ACCOUNTS_PRESENTER = 'PrestaShop\Module\PsAccounts\Presenter\PsAccountsPresenter';
const PS_ACCOUNTS_SERVICE = 'PrestaShop\Module\PsAccounts\Service\PsAccountsService';
const PS_BILLING_SERVICE = 'PrestaShop\Module\PsAccounts\Service\PsBillingService';
/**
* @var Installer
*/
private $installer;
/**
* PsAccounts constructor.
*
* @param Installer $installer
*/
public function __construct(Installer $installer)
{
$this->installer = $installer;
}
/**
* @param string $serviceName
*
* @return mixed
*
* @throws ModuleNotInstalledException
* @throws ModuleVersionException
*/
public function getService($serviceName)
{
if ($this->installer->isModuleInstalled()) {
if ($this->installer->checkModuleVersion()) {
return \Module::getInstanceByName($this->installer->getModuleName())
->getService($serviceName);
}
throw new ModuleVersionException('Module version expected : ' . $this->installer->getModuleVersion());
}
throw new ModuleNotInstalledException('Module not installed : ' . $this->installer->getModuleName());
}
/**
* @return mixed
*
* @throws ModuleNotInstalledException
* @throws ModuleVersionException
*/
public function getPsAccountsService()
{
return $this->getService(self::PS_ACCOUNTS_SERVICE);
}
/**
* @return mixed
*
* @throws ModuleNotInstalledException
* @throws ModuleVersionException
*/
public function getPsBillingService()
{
return $this->getService(self::PS_BILLING_SERVICE);
}
/**
* @return mixed
*
* @throws ModuleNotInstalledException
* @throws ModuleVersionException
*/
public function getPsAccountsPresenter()
{
if ($this->installer->isModuleInstalled() &&
$this->installer->checkModuleVersion() &&
$this->installer->isModuleEnabled()
) {
return $this->getService(self::PS_ACCOUNTS_PRESENTER);
} else {
return new InstallerPresenter($this->installer);
}
}
}

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,234 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Installer;
use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
use PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder;
class Installer
{
const PS_ACCOUNTS_MODULE_NAME = 'ps_accounts';
/**
* @var string required version
*/
private $moduleVersion;
/**
* @var string
*/
private $moduleName = self::PS_ACCOUNTS_MODULE_NAME;
/**
* @var \Link
*/
private $link;
/**
* @var mixed
*/
private $moduleManager;
/**
* Installer constructor.
*
* @param string $psAccountsVersion
* @param \Link|null $link
*/
public function __construct($psAccountsVersion, \Link $link = null)
{
$this->moduleVersion = $psAccountsVersion;
if (null === $link) {
$link = new \Link();
}
$this->link = $link;
if (true === $this->isShopVersion17()) {
$moduleManagerBuilder = ModuleManagerBuilder::getInstance();
$this->moduleManager = $moduleManagerBuilder->build();
}
}
/**
* Install ps_accounts module if not installed
* Method to call in every psx modules during the installation process
*
* @return bool
*
* @throws \Exception
*/
public function install()
{
if (true === $this->isModuleInstalled()) {
return true;
}
if (false === $this->isShopVersion17()) {
return true;
}
return $this->moduleManager->install($this->getModuleName());
}
/**
* @return bool
*/
public function isModuleInstalled()
{
if (false === $this->isShopVersion17()) {
return \Module::isInstalled($this->getModuleName());
}
return $this->moduleManager->isInstalled($this->getModuleName());
}
/**
* @return bool
*/
public function isModuleEnabled()
{
if (false === $this->isShopVersion17()) {
return \Module::isEnabled($this->getModuleName());
}
return $this->moduleManager->isEnabled($this->getModuleName());
}
/**
* @return string | null
*
* @throws \PrestaShopException
*/
public function getInstallLink()
{
if ($this->isShopVersion17()) {
$router = SymfonyContainer::getInstance()->get('router');
return \Tools::getHttpHost(true) . $router->generate('admin_module_manage_action', [
'action' => 'install',
'module_name' => $this->moduleName,
]);
}
return $this->getAdminLink('AdminModules', true, [], [
'module_name' => $this->moduleName,
'install' => $this->moduleName,
]);
}
/**
* @return string | null
*
* @throws \PrestaShopException
*/
public function getEnableLink()
{
if ($this->isShopVersion17()) {
$router = SymfonyContainer::getInstance()->get('router');
return \Tools::getHttpHost(true) . $router->generate('admin_module_manage_action', [
'action' => 'enable',
'module_name' => $this->moduleName,
]);
}
return $this->getAdminLink('AdminModules', true, [], [
'module_name' => $this->moduleName,
'enable' => 1,
]);
}
/**
* @return string | null
*
* @throws \PrestaShopException
*/
public function getUpgradeLink()
{
if ($this->isShopVersion17()) {
$router = SymfonyContainer::getInstance()->get('router');
return \Tools::getHttpHost(true) . $router->generate('admin_module_manage_action', [
'action' => 'upgrade',
'module_name' => $this->moduleName,
]);
}
return $this->getAdminLink('AdminModules', true, [], [
'module_name' => $this->moduleName,
'upgrade' => $this->moduleName,
]);
}
/**
* @return bool
*/
public function isShopVersion17()
{
return version_compare(_PS_VERSION_, '1.7.0.0', '>=');
}
/**
* @return bool
*/
public function checkModuleVersion()
{
$module = \Module::getInstanceByName($this->getModuleName());
if ($module instanceof \Ps_accounts) {
return version_compare(
$module->version,
$this->moduleVersion,
'>='
);
}
return false;
}
/**
* @return string
*/
public function getModuleVersion()
{
return $this->moduleVersion;
}
/**
* @return string
*/
public function getModuleName()
{
return $this->moduleName;
}
/**
* Adapter for getAdminLink from prestashop link class
*
* @param string $controller controller name
* @param bool $withToken include or not the token in the url
* @param array $sfRouteParams
* @param array $params
*
* @return string
*
* @throws \PrestaShopException
*/
protected function getAdminLink($controller, $withToken = true, $sfRouteParams = [], $params = [])
{
if ($this->isShopVersion17()) {
return $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params);
}
$paramsAsString = '';
foreach ($params as $key => $value) {
$paramsAsString .= "&$key=$value";
}
return \Tools::getShopDomainSsl(true)
. __PS_BASE_URI__
. basename(_PS_ADMIN_DIR_)
. '/' . $this->link->getAdminLink($controller, $withToken)
. $paramsAsString;
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Installer\Presenter;
use PrestaShop\PsAccountsInstaller\Installer\Installer;
class InstallerPresenter
{
/**
* @var Installer
*/
private $installer;
/**
* @var \Context
*/
private $context;
/**
* InstallerPresenter constructor.
*
* @param Installer $installer
* @param \Context|null $context
*/
public function __construct(Installer $installer, \Context $context = null)
{
$this->installer = $installer;
if (null === $context) {
$context = \Context::getContext();
}
$this->context = $context;
}
/**
* @return array
*
* @throws \Exception
*/
public function present()
{
// Fallback minimal Presenter
return [
'psIs17' => $this->installer->isShopVersion17(),
'psAccountsInstallLink' => $this->installer->getInstallLink(),
'psAccountsEnableLink' => $this->installer->getEnableLink(),
'psAccountsUpdateLink' => $this->installer->getUpgradeLink(),
'psAccountsIsInstalled' => $this->installer->isModuleInstalled(),
'psAccountsIsEnabled' => $this->installer->isModuleEnabled(),
'psAccountsIsUptodate' => $this->installer->checkModuleVersion(),
'onboardingLink' => null,
'user' => [
'email' => null,
'emailIsValidated' => false,
'isSuperAdmin' => $this->isEmployeeSuperAdmin(),
],
'currentShop' => null,
'shops' => [],
'superAdminEmail' => null,
'ssoResendVerificationEmail' => null,
'manageAccountLink' => null,
];
}
/**
* @return bool
*/
public function isEmployeeSuperAdmin()
{
return $this->context->employee->isSuperAdmin();
}
}

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,23 @@
<?php
namespace PrestaShop\PsAccountsInstaller\Tests;
use Faker\Generator;
class TestCase extends \PHPUnit\Framework\TestCase
{
/**
* @var Generator
*/
public $faker;
/**
* @return void
*/
protected function setUp()
{
parent::setUp();
$this->faker = \Faker\Factory::create();
}
}

View File

@@ -0,0 +1,86 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA <contact@prestashop.com>
* @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
*/
namespace PrestaShop\PsAccountsInstaller\Tests\Unit\Installer\Presenter\InstallerPresenter;
use PrestaShop\PsAccountsInstaller\Installer\Installer;
use PrestaShop\PsAccountsInstaller\Installer\Presenter\InstallerPresenter;
use PrestaShop\PsAccountsInstaller\Tests\TestCase;
class PresentTest extends TestCase
{
/**
* @test
*
* @throws \Exception
*/
public function itShouldBeCompliantWithPsAccountsPresenter()
{
$expected = [
'psIs17' => $this->faker->boolean,
'psAccountsInstallLink' => $this->faker->url,
'psAccountsEnableLink' => $this->faker->url,
'psAccountsUpdateLink' => $this->faker->url,
'psAccountsIsInstalled' => $this->faker->boolean,
'psAccountsIsEnabled' => $this->faker->boolean,
'psAccountsIsUptodate' => $this->faker->boolean,
'onboardingLink' => null,
'user' => [
'email' => null,
'emailIsValidated' => false,
'isSuperAdmin' => true,
],
'currentShop' => null,
'shops' => [],
'superAdminEmail' => null,
'ssoResendVerificationEmail' => null,
'manageAccountLink' => null,
];
$installer = $this->createConfiguredMock(Installer::class, [
'isShopVersion17' => $expected['psIs17'],
'isModuleInstalled' => $expected['psAccountsIsInstalled'],
'getInstallLink' => $expected['psAccountsInstallLink'],
'isModuleEnabled' => $expected['psAccountsIsEnabled'],
'getEnableLink' => $expected['psAccountsEnableLink'],
'checkModuleVersion' => $expected['psAccountsIsUptodate'],
'getUpgradeLink' => $expected['psAccountsUpdateLink'],
]);
$presenter = $this->getMockBuilder(InstallerPresenter::class)
//->disableOriginalConstructor()
->setConstructorArgs([$installer, new \Context()])
->disableOriginalClone()
->disableArgumentCloning()
->disallowMockingUnknownTypes()
->setMethods([
'isEmployeeSuperAdmin',
])
->getMock();
$presenter->method('isEmployeeSuperAdmin')
->willReturn(true);
/** @var InstallerPresenter $presenter */
$presenterData = $presenter->present();
$this->assertArraySubset($expected, $presenterData);
}
}

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,6 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php';
// Empty shell for mocking
class Context {}

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,11 @@
<?php
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;

View File

@@ -0,0 +1,27 @@
includes:
- %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon
parameters:
autoload_files:
- /web/ps_accounts/vendor/autoload.php
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: false
paths:
- ../../src
dynamicConstantNames:
- _PS_VERSION_
ignoreErrors:
- '#Result of \|\| is always false.#'
- '#Strict comparison using === between false and string will always evaluate to false.#'
- '#Access to an undefined property Language::\$locale.#'
- '#Call to static method getInstance\(\) on an unknown class PrestaShop\\PrestaShop\\Adapter\\SymfonyContainer.#'
- '#Call to static method getInstance\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Addon\\Module\\ModuleManagerBuilder.#'
- '#Call to method get\(\) on an unknown class Symfony\\Component\\DependencyInjection\\ContainerInterface.#'
- '#Property PrestaShop\\AccountsAuth\\Service\\PsAccountsService::\$container has unknown class Symfony\\Component\\DependencyInjection\\ContainerInterface as its type.#'
- '#Property PrestaShop\\AccountsAuth\\Service\\PsBillingService::\$container has unknown class Symfony\\Component\\DependencyInjection\\ContainerInterface as its type.#'
- '#Method LinkCore::getAdminLink\(\) invoked with 4 parameters, 1-2 required.#'
- '#Cannot call method getService\(\) on Module\|false.#'
- '#Class PrestaShop\\Module\\PsAccounts\\Presenter\\PsAccountsPresenter not found.#'
- '#Call to method get\(\) on an unknown class PrestaShop\\PrestaShop\\Adapter\\SymfonyContainer.#'
- '#Call to an undefined method object::generate\(\).#'
level: 7

View File

@@ -0,0 +1,22 @@
includes:
- %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon
parameters:
autoload_files:
- /web/ps_accounts/vendor/autoload.php
checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: false
paths:
- ../../src
dynamicConstantNames:
- _PS_VERSION_
ignoreErrors:
- '#Result of \|\| is always false.#'
- '#Strict comparison using === between false and string will always evaluate to false.#'
- '#Call to static method getInstance\(\) on an unknown class PrestaShop\\PrestaShop\\Adapter\\SymfonyContainer.#'
- '#Method LinkCore::getAdminLink\(\) invoked with 4 parameters, 1-2 required.#'
- '#Cannot call method getService\(\) on Module\|false.#'
- '#Class PrestaShop\\Module\\PsAccounts\\Presenter\\PsAccountsPresenter not found.#'
- '#Call to method get\(\) on an unknown class PrestaShop\\PrestaShop\\Adapter\\SymfonyContainer.#'
- '#Call to an undefined method object::generate\(\).#'
level: 7