Skip to content
This repository was archived by the owner on Nov 26, 2022. It is now read-only.

Commit 61b315f

Browse files
committed
Require PHP 8
1 parent 372f573 commit 61b315f

7 files changed

Lines changed: 26 additions & 48 deletions

File tree

.cs.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
return (new PhpCsFixer\Config())
3+
use PhpCsFixer\Config;
4+
5+
return (new Config())
46
->setUsingCache(false)
57
->setRiskyAllowed(true)
68
->setRules(
@@ -35,6 +37,8 @@
3537
'imports_order' => ['class', 'const', 'function']
3638
],
3739
'single_line_throw' => false,
40+
'fully_qualified_strict_types' => true,
41+
'global_namespace_import' => false,
3842
]
3943
)
4044
->setFinder(

.github/workflows/build.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
runs-on: ${{ matrix.operating-system }}
88
strategy:
99
matrix:
10-
operating-system: [ubuntu-latest]
11-
php-versions: ['7.4', '8.0']
10+
operating-system: [ ubuntu-latest ]
11+
php-versions: [ '8.1' ]
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
services:
1515
mysql:
16-
image: mysql:5.7
16+
image: mysql:8.0.23
1717
env:
1818
MYSQL_ROOT_PASSWORD: root
1919
MYSQL_DATABASE: test
@@ -32,15 +32,18 @@ jobs:
3232
extensions: mbstring, pdo, pdo_mysql, intl, zip
3333
coverage: none
3434

35-
- name: Check PHP Version
35+
- name: Check PHP version
3636
run: php -v
3737

38-
- name: Check Composer Version
38+
- name: Check Composer version
3939
run: composer -V
4040

41-
- name: Check PHP Extensions
41+
- name: Check PHP extensions
4242
run: php -m
4343

44+
- name: Check MySQL version
45+
run: mysql -V
46+
4447
- name: Start MySQL
4548
run: sudo systemctl start mysql
4649

@@ -50,13 +53,8 @@ jobs:
5053
- name: Validate composer.json and composer.lock
5154
run: composer validate
5255

53-
- name: Install dependencies for PHP 7
54-
if: matrix.php-versions < '8.0'
55-
run: composer update --prefer-dist --no-progress
56-
57-
- name: Install dependencies for PHP 8
58-
if: matrix.php-versions >= '8.0'
59-
run: composer update --prefer-dist --no-progress --ignore-platform-req=php
56+
- name: Install dependencies
57+
run: composer install --prefer-dist --no-progress --no-suggest
6058

6159
- name: Run test suite
6260
run: composer test:all

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 odan
3+
Copyright (c) 2023 odan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ composer require selective/database
2222

2323
## Requirements
2424

25-
* PHP 7.4+ or 8.0+
25+
* PHP 8.0+
2626
* MySQL 5.7+ or MariaDB
2727

2828
## Documentation
@@ -31,10 +31,6 @@ The database query builder provides a convenient, fluent interface for creating
3131

3232
For more details how to build queries please read the **[documentation](https://selective-php.github.io/database/)**.
3333

34-
## Security
35-
36-
If you discover any security related issues, please email instead of using the issue tracker.
37-
3834
## Similar libraries
3935

4036
* [cycle/database](https://cycle-orm.dev/docs/query-builder-basic)

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
"friendsofphp/php-cs-fixer": "^3",
1616
"overtrue/phplint": "^2.3",
1717
"phpstan/phpstan": "0.*",
18-
"phpunit/phpunit": "^9",
18+
"phpunit/phpunit": "^9 || ^10",
1919
"squizlabs/php_codesniffer": "^3.5"
2020
},
2121
"require": {
22-
"php": "^7.4 || ^8.0",
23-
"ext-pdo": "*",
24-
"ext-json": "*"
22+
"php": "^8.0",
23+
"ext-pdo": "*"
2524
},
2625
"autoload": {
2726
"psr-4": {
@@ -42,7 +41,7 @@
4241
"cs:fix": "php-cs-fixer fix --config=.cs.php --ansi",
4342
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache --ansi",
4443
"phoenix": "phoenix --ansi",
45-
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
44+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi --xdebug",
4645
"schema:dump": "php bin/console.php schema-dump --ansi",
4746
"sniffer:check": "phpcs --standard=phpcs.xml",
4847
"sniffer:fix": "phpcbf --standard=phpcs.xml",

docs/selects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use Selective\Database\Connection;
2323

2424
$connection = new Connection($pdo);
2525

26-
$query = new \Odan\Database\SelectQuery($connection);
26+
$query = new \Selective\Database\SelectQuery($connection);
2727
```
2828

2929
## Inspecting The Query

docs/slim.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ nav_order: 8
88

99
## Requirements
1010

11-
* PHP 7.4+
11+
* PHP 8+
1212
* MySQL 5.7+
13-
* Composer
1413
* [A Slim 4 application](https://odan.github.io/2019/11/05/slim4-tutorial.html)
1514
* A DI container (PSR-11), e.g. PHP-DI
1615

@@ -74,7 +73,7 @@ return [
7473
},
7574

7675
PDO::class => function (ContainerInterface $container) {
77-
$settings = $container->get(Configuration::class)->getArray('db');
76+
$settings = $container->get('settings')['db'];
7877

7978
$driver = $settings['driver'];
8079
$host = $settings['host'];
@@ -102,33 +101,15 @@ namespace App\Domain\User\Repository;
102101
use DomainException;
103102
use Selective\Database\Connection;
104103

105-
/**
106-
* Repository.
107-
*/
108-
final class UserCreatorRepository
104+
final class UserReaderRepository
109105
{
110-
/**
111-
* @var Connection The database connection
112-
*/
113106
private Connection $connection;
114107

115-
/**
116-
* The constructor.
117-
*
118-
* @param Connection $connection The database connection
119-
*/
120108
public function __construct(Connection $connection)
121109
{
122110
$this->connection = $connection;
123111
}
124112

125-
/**
126-
* Get user by id.
127-
*
128-
* @param int $userId The user id
129-
*
130-
* @return array The user row
131-
*/
132113
public function getUserById(int $userId): array
133114
{
134115
$query = $this->connection->select()->from('users');

0 commit comments

Comments
 (0)