Skip to content

Commit

Permalink
Merge 4fcd3a2 into 3884557
Browse files Browse the repository at this point in the history
  • Loading branch information
dakorpar committed May 17, 2021
2 parents 3884557 + 4fcd3a2 commit 6d12c84
Show file tree
Hide file tree
Showing 33 changed files with 345 additions and 372 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

strategy:
matrix:
php-version: ["7.4"]
php-version: ["8.0"]
operating-system: ["ubuntu-latest"]
fail-fast: false

Expand Down Expand Up @@ -80,20 +80,18 @@ jobs:
runs-on: "${{ matrix.operating-system }}"
strategy:
matrix:
php-version: ["7.4"]
php-version: ["8.0"]
operating-system: ["ubuntu-latest"]
composer-args: [ "" ]
include:
- php-version: "7.4"
- php-version: "8.0"
operating-system: "ubuntu-latest"
composer-args: "--prefer-lowest"
- php-version: "8.0"
operating-system: "ubuntu-latest"
composer-args: "--ignore-platform-reqs"
fail-fast: false

continue-on-error: "${{ matrix.php-version == '8.0' }}"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand Down Expand Up @@ -149,7 +147,7 @@ jobs:

strategy:
matrix:
php-version: ["7.4"]
php-version: ["8.0"]
operating-system: ["ubuntu-latest"]
fail-fast: false

Expand Down Expand Up @@ -205,7 +203,7 @@ jobs:

strategy:
matrix:
php-version: ["7.4"]
php-version: ["8.0"]
operating-system: ["ubuntu-latest"]
fail-fast: false

Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"description": "rest api",
"license": ["MIT"],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"psr/log": "^1.1",
"nette/di": "^3.0",
"nette/application": "^3.0",
"nette/forms": "^3.1.2",
"nette/reflection": "^2.4",
"wedo/utilities": "^1.0 || ^2.0"
"wedo/utilities": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
Expand All @@ -18,7 +17,7 @@
"phpstan/phpstan-dibi": "^0.12",
"phpstan/phpstan-nette": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"ninjify/qa": "^0.12"
"contributte/qa": "^0.1"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<ruleset>
<!-- Contributte Coding Standard -->
<rule ref="./vendor/ninjify/coding-standard/contributte.xml">
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix"></exclude>
<rule ref="./vendor/contributte/qa/ruleset.xml">
<exclude name="SlevomatCodingStandard.Classes.SuperfluousErrorNaming.SuperfluousSuffix"></exclude>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint" />
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint" />
Expand Down
25 changes: 25 additions & 0 deletions src/Attributes/ChoiceControlItems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute]
class ChoiceControlItems
{

/** @var mixed[] */
public array $items;

public bool $useKeys;

/**
* @param mixed[] $items
*/
public function __construct(array $items, bool $useKeys = false)
{
$this->items = $items;
$this->useKeys = $useKeys;
}

}
22 changes: 22 additions & 0 deletions src/Attributes/ContainerType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute]
class ContainerType
{

/** @var class-string */
public string $value;

/**
* @param class-string $value
*/
public function __construct(string $value)
{
$this->value = $value;
}

}
34 changes: 34 additions & 0 deletions src/Attributes/Control.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute]
class Control
{

public const TEXT = 'Text';
public const PASSWORD = 'Password';
public const TEXT_AREA = 'TextArea';
public const EMAIL = 'Email';
public const INTEGER = 'Integer';
public const UPLOAD = 'Upload';
public const MULTI_UPLOAD = 'MultiUpload';
public const HIDDEN = 'Hidden';
public const CHECKBOX = 'Checkbox';
public const RADIO_LIST = 'RadioList';
public const CHECKBOX_LIST = 'CheckboxList';
public const SELECT = 'Select';
public const MULTI_SELECT = 'MultiSelect';
public const IMAGE = 'Image';
public const CONTAINER = 'Container';

public string $value;

public function __construct(string $value)
{
$this->value = $value;
}

}
18 changes: 18 additions & 0 deletions src/Attributes/HttpMethod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute]
class HttpMethod
{

public string $value;

public function __construct(string $value)
{
$this->value = $value;
}

}
11 changes: 11 additions & 0 deletions src/Attributes/Internal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute]
class Internal
{

}
18 changes: 18 additions & 0 deletions src/Attributes/RequiredRule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute]
class RequiredRule
{

public bool $required;

public function __construct(bool $required = true)
{
$this->required = $required;
}

}
25 changes: 25 additions & 0 deletions src/Attributes/ValidationRule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php declare (strict_types = 1);

namespace Wedo\Api\Attributes;

use Attribute;

#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_PROPERTY)]
class ValidationRule
{

/** @var callable|string */
public $validator;

public string|object|null $errorMessage;

public mixed $args;

public function __construct(callable|string $validator, string|object|null $errorMessage = null, mixed $args = null)
{
$this->validator = $validator;
$this->errorMessage = $errorMessage;
$this->args = $args;
}

}

0 comments on commit 6d12c84

Please sign in to comment.