Skip to content

Commit

Permalink
feat: php7 support dropped
Browse files Browse the repository at this point in the history
- reafactored for php8.0
- php 8.2 support added
  • Loading branch information
mkorkmaz committed Dec 10, 2022
1 parent 9f3e701 commit e1a2bfa
Show file tree
Hide file tree
Showing 10 changed files with 245 additions and 611 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build:
docker: true
redis: false
php:
version: 7.4
version: 8.0
pecl_extensions:
- igbinary
- redis
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ sudo: false
services:
- docker
php:
- 7.4
- 8.0
- 8.1
- nightly
before_install:
- pecl install -f redis <<< ''
before_script:
Expand All @@ -17,7 +18,7 @@ script:
- composer run phpcs
- composer run psalm
after_script:
- if [ $TRAVIS_PHP_VERSION = '7.4' ]; then php vendor/bin/php-coveralls; fi
- if [ $TRAVIS_PHP_VERSION = '8.1' ]; then php vendor/bin/php-coveralls; fi
after_success:
- travis_retry php vendor/bin/php-coveralls -v
- vendor/bin/test-reporter
3 changes: 3 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ paths:
output: tests/_output
support: tests/_support
data: tests
extensions:
enabled:
- Codeception\Extension\DotReporter
coverage:
enabled: true
include:
Expand Down
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
],
"minimum-stability": "stable",
"require": {
"php": "^7.4|^8.0",
"mkorkmaz/redislabs-common": "^0.2.2",
"php": "^8.0",
"mkorkmaz/redislabs-common": "^1.1",
"sevenecks/tableify": "^0.0.5"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"codeception/codeception": "^4.2.1",
"php-coveralls/php-coveralls": "^v2.5.2",
"codeception/codeception": "^5.0.5",
"php-coveralls/php-coveralls": "^v2.5.3",
"squizlabs/php_codesniffer": "^3.7.1",
"predis/predis": "^v1.1.10",
"predis/predis": "^v2.0.3",
"ext-redis": "*",
"codeception/module-asserts": "^1.3.1",
"codeception/module-asserts": "^3.0.0",
"malukenho/mcbumpface": "^1.1.5",
"damianopetrungaro/php-commitizen": "^0.2.0",
"vimeo/psalm": "^4.24.0"
"vimeo/psalm": "^5.1.0"
},
"suggest": {
"predis/predis": "If your application depends on predis.",
Expand All @@ -46,5 +46,10 @@
"psalm": "vendor/bin/psalm",
"phpcs": "vendor/bin/phpcs --standard=PSR12 src tests",
"phpcbf": "vendor/bin/phpcbf --standard=PSR12 src tests"
},
"config": {
"allow-plugins": {
"malukenho/mcbumpface": true
}
}
}
21 changes: 5 additions & 16 deletions src/RedisGraph/Edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@

final class Edge
{
private string $type;
private Node $sourceNode;
private Node $destinationNode;
private ?string $relation;
private ?iterable $properties = [];

public function __construct(
string $type,
Node $sourceNode,
?string $relation,
Node $destinationNode,
?iterable $properties = []
private string $type,
private Node $sourceNode,
private ?string $relation,
private Node $destinationNode,
private ?iterable $properties = []
) {
$this->type = $type;
$this->sourceNode = $sourceNode;
$this->destinationNode = $destinationNode;
$this->relation = $relation;
$this->properties = $properties;
}

public static function create(Node $sourceNode, string $relation, Node $destinationNode): self
Expand Down
4 changes: 1 addition & 3 deletions src/RedisGraph/GraphConstructor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

class GraphConstructor
{
private string $name;
private array $nodes = [];
private array $edges = [];

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

public function addNode(Node $node): void
Expand Down
6 changes: 1 addition & 5 deletions src/RedisGraph/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@

final class Node
{
private ?string $label;
private ?iterable $properties;
private string $alias;

public function __construct(?string $label = null, ?iterable $properties = null)
public function __construct(private ?string $label = null, private ?iterable $properties = null)
{
$this->label = $label;
$this->alias = randomString();
$this->properties = $properties;
}

public static function create(): self
Expand Down
7 changes: 1 addition & 6 deletions src/RedisGraph/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@

final class Query implements QueryInterface
{
private string $name;
private string $queryString;

public function __construct(string $name, string $queryString)
public function __construct(private string $name, private string $queryString)
{
$this->name = $name;
$this->queryString = $queryString;
}

public function getName(): string
Expand Down
6 changes: 1 addition & 5 deletions src/RedisGraph/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@

class Result
{
private ?array $resultSet;
private array $statistics;
private ?array $labels;

public function __construct(?array $labels, ?array $resultSet, Statistics $statistics)
public function __construct(private ?array $labels, private ?array $resultSet, Statistics $statistics)
{
$this->labels = $labels;
$this->resultSet = $resultSet;
$this->statistics = $statistics->getResultStatistics();
}

Expand Down

0 comments on commit e1a2bfa

Please sign in to comment.