Skip to content

Commit

Permalink
lowered minimum required PHP version to 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bethrezen committed Dec 9, 2017
1 parent 0ceba34 commit c4f3abb
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 28 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM php:7.0-cli
RUN apt-get update -yqq
RUN apt-get install -yqq git libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions
RUN docker-php-ext-install curl json opcache
COPY ./ /var/www/html/
WORKDIR /var/www/html/

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# php-dreamkas
Фискализация чека для Дримкас-Ф для PHP 7.2
Фискализация чека для Дримкас-Ф для PHP 7.0

Для более старых версий PHP придётся править код на предмет типов у функций.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Фискализация чека для Дримкас-Ф на php",
"type": "library",
"require": {
"php": "~7.2.0",
"php": "~7.0",
"guzzlehttp/guzzle": "~6.3.0"
},
"require-dev": {
Expand Down
6 changes: 4 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*/
class Api
{
public const MODE_PRODUCTION = 0;
public const MODE_MOCK = 1;
public const MODE_DEBUG = 2;
const MODE_PRODUCTION = 0;
const MODE_MOCK = 1;
const MODE_DEBUG = 2;

public $accessToken = '';
public $deviceId = 0;
Expand Down Expand Up @@ -40,7 +40,7 @@ public function __construct(string $accessToken, int $deviceId, int $mode = self
$this->createClient();
}

protected function createClient(): void
protected function createClient()
{
$baseUri = static::$baseUri[$this->mode] ?? null;
if ($baseUri === null) {
Expand Down
4 changes: 2 additions & 2 deletions src/PaymentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class PaymentType
{
// нал
public const TYPE_CASH = 'CASH';
const TYPE_CASH = 'CASH';
// безнал
public const TYPE_CASHLESS = 'CASHLESS';
const TYPE_CASHLESS = 'CASHLESS';
}
4 changes: 2 additions & 2 deletions src/Position.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
class Position extends Configurable
{
public const TYPE_COUNTABLE = 'COUNTABLE';
public const TYPE_SCALABLE = 'SCALABLE';
const TYPE_COUNTABLE = 'COUNTABLE';
const TYPE_SCALABLE = 'SCALABLE';

public $name = '';

Expand Down
8 changes: 4 additions & 4 deletions src/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/
class Receipt extends Configurable
{
public const TYPE_SALE = 'SALE';
public const TYPE_REFUND = 'REFUND';
public const TYPE_OUTFLOW = 'OUTFLOW';
public const TYPE_OUTFLOW_REFUND = 'OUTFLOW_REFUND';
const TYPE_SALE = 'SALE';
const TYPE_REFUND = 'REFUND';
const TYPE_OUTFLOW = 'OUTFLOW';
const TYPE_OUTFLOW_REFUND = 'OUTFLOW_REFUND';

// Тип чека
public $type = self::TYPE_SALE;
Expand Down
12 changes: 6 additions & 6 deletions src/TaxMode.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class TaxMode
{
// ОСНО
public const MODE_DEFAULT = 'DEFAULT';
const MODE_DEFAULT = 'DEFAULT';
// УСН доход
public const MODE_SIMPLE = 'SIMPLE';
const MODE_SIMPLE = 'SIMPLE';
// УСН Доход-расход
public const MODE_SIMPLE_WO = 'SIMPLE_WO';
const MODE_SIMPLE_WO = 'SIMPLE_WO';
// ЕНВД
public const MODE_ENVD = 'ENVD';
const MODE_ENVD = 'ENVD';
// ЕСХН
public const MODE_AGRICULT = 'AGRICULT';
const MODE_AGRICULT = 'AGRICULT';
// Патент
public const MODE_PATENT = 'PATENT';
const MODE_PATENT = 'PATENT';
}
12 changes: 6 additions & 6 deletions src/TaxType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
class TaxType
{
// Без НДС
public const TYPE_NDS_NO_TAX = 'NDS_NO_TAX';
const TYPE_NDS_NO_TAX = 'NDS_NO_TAX';

// НДС 0
public const TYPE_NDS_0 = 'NDS_0';
const TYPE_NDS_0 = 'NDS_0';

// НДС 10
public const TYPE_NDS_10 = 'NDS_10';
const TYPE_NDS_10 = 'NDS_10';

// НДС 18
public const TYPE_NDS_18 = 'NDS_18';
const TYPE_NDS_18 = 'NDS_18';

// НДС 10/110
public const TYPE_NDS_10_CALCULATED = 'NDS_10_CALCULATED';
const TYPE_NDS_10_CALCULATED = 'NDS_10_CALCULATED';

// НДС 18/118
public const TYPE_NDS_18_CALCULATED = 'NDS_18_CALCULATED';
const TYPE_NDS_18_CALCULATED = 'NDS_18_CALCULATED';


}
3 changes: 3 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
docker build -t php-dreamkas .
docker run -it php-dreamkas vendor/bin/phpunit

0 comments on commit c4f3abb

Please sign in to comment.