Skip to content

Commit

Permalink
[general] Fixing config (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 25, 2024
1 parent e85ec3f commit 681428b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
extensions: "json, intl, :php-psr"
cache-version: "1"
composer-version: "v2"
composer-options: "--no-interaction --no-progress --no-suggest --prefer-dist --prefer-stable"
composer-options: "--no-interaction --no-progress --prefer-dist --prefer-stable"
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ORGANIZATION_ACCESS_TOKEN }}"}}'

jobs:
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ lint:

phpstan: ## Analyse code with PHPStan
mkdir -p var/tools
$(PRE_PHP) "vendor/bin/phpstan" analyse src -c $(PHPSTAN_SRC_CONFIG) $(ARGS)
$(PRE_PHP) "vendor/bin/phpstan" analyse tests/cases -c $(PHPSTAN_TESTS_CONFIG) $(ARGS)
$(PRE_PHP) "vendor/bin/phpstan" analyse -c $(PHPSTAN_SRC_CONFIG) $(ARGS)
$(PRE_PHP) "vendor/bin/phpstan" analyse -c $(PHPSTAN_TESTS_CONFIG) $(ARGS)

# Tests

.PHONY: tests
tests: ## Run all tests
$(PRE_PHP) $(PARATEST_COMMAND) $(ARGS)

tests-simple: ## Run all tests
$(PRE_PHP) $(PHPUNIT_COMMAND) $(ARGS)

coverage-clover: ## Generate code coverage in XML format
Expand All @@ -47,7 +50,7 @@ mutations: ## Check code for mutants

mutations-tests:
mkdir -p var/coverage
$(PRE_PHP) $(PHPUNIT_COVERAGE) --coverage-xml=var/coverage/xml --log-junit=var/coverage/junit.xml
$(PRE_PHP) $(PHPUNIT_MUTATIONS) --coverage-xml=var/coverage/xml --log-junit=var/coverage/junit.xml

mutations-infection:
$(PRE_PHP) vendor/bin/infection \
Expand All @@ -68,7 +71,9 @@ list:

PRE_PHP=XDEBUG_MODE=off

PHPUNIT_COMMAND="vendor/bin/paratest" -c $(PHPUNIT_CONFIG) --runner=WrapperRunner -p$(LOGICAL_CORES)
PHPUNIT_COVERAGE=php -d pcov.enabled=1 -d pcov.directory=./src $(PHPUNIT_COMMAND)
PARATEST_COMMAND="vendor/bin/paratest" -c $(PHPUNIT_CONFIG) --runner=WrapperRunner -p$(LOGICAL_CORES)
PHPUNIT_COMMAND="vendor/bin/phpunit" -c $(PHPUNIT_CONFIG)
PHPUNIT_COVERAGE=php -d pcov.enabled=1 -d pcov.directory=./src $(PARATEST_COMMAND)
PHPUNIT_MUTATIONS=php -d pcov.enabled=1 -d pcov.directory=./src $(PARATEST_COMMAND)

LOGICAL_CORES=$(shell nproc || sysctl -n hw.logicalcpu || echo 4)
4 changes: 2 additions & 2 deletions src/Documents/Channels/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/Channels/Controls/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/Connectors/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/Connectors/Controls/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/Devices/Controls/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/Devices/Device.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/Documents/States/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public function __construct(
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('created_at')]
private readonly DateTimeInterface|null $createdAt = null,
protected readonly DateTimeInterface|null $createdAt = null,
#[ObjectMapper\Rules\AnyOf([
new ObjectMapper\Rules\DateTimeValue(format: DateTimeInterface::ATOM),
new ObjectMapper\Rules\NullValue(),
])]
#[ObjectMapper\Modifiers\FieldName('updated_at')]
private readonly DateTimeInterface|null $updatedAt = null,
protected readonly DateTimeInterface|null $updatedAt = null,
)
{
}
Expand Down

0 comments on commit 681428b

Please sign in to comment.