Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI config #111

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ on:

jobs:
testsuite:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4', '8.0']
php-version: ['7.4', '8.0', '8.3']
db-type: ['mysql', 'pgsql']
prefer-lowest: ['']
include:
- php-version: '7.2'
- php-version: '7.4'
db-type: 'sqlite'
prefer-lowest: 'prefer-lowest'

Expand All @@ -31,7 +31,7 @@ jobs:
POSTGRES_PASSWORD: postgres

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Service
if: matrix.db-type == 'mysql'
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:

cs-stan:
name: Coding Standard & Static Analysis
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
Expand All @@ -84,7 +84,7 @@ jobs:
php-version: '7.4'
extensions: mbstring, intl
coverage: none
tools: psalm:4.7, phpstan:0.12
tools: psalm:4, phpstan:1

- name: Composer Install
run: composer require cakephp/cakephp-codesniffer:^4.2
Expand Down
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
"irc": "irc://irc.freenode.org/muffin"
},
"require": {
"cakephp/orm": "^4.2"
"cakephp/orm": "^4.5"
},
"require-dev": {
"cakephp/cakephp": "^4.2",
"cakephp/cakephp-codesniffer": "^4.0",
"phpunit/phpunit": "^8.5 || ^9.3"
"cakephp/cakephp": "^4.5",
"cakephp/cakephp-codesniffer": "^4.2",
"phpunit/phpunit": "^9.3"
},
"autoload": {
"psr-4": {
Expand All @@ -58,5 +58,10 @@
"SomeVendor\\SomePlugin\\": "tests/test_app/plugins/SomeVendor/SomePlugin/src",
"TestPlugin\\": "tests/test_app/plugins/TestPlugin/src"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
13 changes: 3 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@
</testsuite>
</testsuites>

<!-- Setup a listener for fixtures -->
<listeners>
<listener
class="\Cake\TestSuite\Fixture\FixtureInjector"
file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
<arguments>
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
</arguments>
</listener>
</listeners>
<extensions>
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
</extensions>

<filter>
<whitelist>
Expand Down
1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<psalm
totallyTyped="false"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
2 changes: 1 addition & 1 deletion src/Datasource/Marshaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function merge(EntityInterface $entity, array $data, array $options = [])
* the accessible fields list in the entity will be used.
* - accessibleFields: A list of fields to allow or deny in entity accessible fields.
*
* @param array|\Traversable $entities the entities that will get the
* @param iterable<\Cake\Datasource\EntityInterface> $entities the entities that will get the
* data merged in
* @param array $data list of arrays to be merged into the entities
* @param array $options List of options.
Expand Down
8 changes: 4 additions & 4 deletions src/Datasource/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function clause(string $name)
*/
public function setEndpoint(Endpoint $endpoint)
{
$this->repository($endpoint);
$this->setRepository($endpoint);

return $this;
}
Expand Down Expand Up @@ -262,7 +262,7 @@ public function firstOrFail()
*
* @param string $field The field to alias.
* @param string|null $alias Not being used
* @return array The field prefixed with the endpoint alias.
* @return array<string, string> The field prefixed with the endpoint alias.
*/
public function aliasField(string $field, ?string $alias = null): array
{
Expand Down Expand Up @@ -396,9 +396,9 @@ public function set($fields = null)
/**
* @inheritDoc
*/
public function offset($num)
public function offset($offset)
{
$this->_parts['offset'] = $num;
$this->_parts['offset'] = $offset;

return $this;
}
Expand Down
12 changes: 9 additions & 3 deletions src/Datasource/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use Cake\Collection\CollectionTrait;
use Cake\Datasource\ResultSetInterface;

/**
* @template T of \Cake\Datasource\EntityInterface|array
* @implements \Cake\Datasource\ResultSetInterface<T>
*/
class ResultSet implements ResultSetInterface
{
use CollectionTrait;
Expand All @@ -20,7 +24,8 @@ class ResultSet implements ResultSetInterface
/**
* Last record fetched from the statement
*
* @var array
* @var \Cake\Datasource\EntityInterface|array
* @psalm-var T
*/
protected $_current;

Expand Down Expand Up @@ -55,8 +60,10 @@ public function __construct(array $resources, ?int $total = null)
*
* Part of Iterator interface.
*
* @return array|object
* @return \Cake\Datasource\EntityInterface|array
* @psalm-return T
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->_current;
Expand All @@ -67,7 +74,6 @@ public function current()
*
* Part of Iterator interface.
*
* @throws \Cake\Database\Exception
* @return void
*/
public function rewind()
Expand Down
10 changes: 5 additions & 5 deletions src/Datasource/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function columns(): array
* Get column data in the endpoint.
*
* @param string $name The column name.
* @return array|null Column data or null.
* @return array<string, mixed>|null Column data or null.
*/
public function getColumn(string $name): ?array
{
Expand Down Expand Up @@ -289,7 +289,7 @@ public function baseColumnType(string $column): ?string
* Returns an array where the keys are the column names in the schema
* and the values the schema type they have.
*
* @return array
* @return array<string, string>
*/
public function typeMap(): array
{
Expand All @@ -316,7 +316,7 @@ public function isNullable(string $name): bool
/**
* Get a hash of columns and their default values.
*
* @return array
* @return array<string, mixed>
*/
public function defaultValues(): array
{
Expand Down Expand Up @@ -357,7 +357,7 @@ public function getPrimaryKey(): array
/**
* Set the schema options for an endpoint
*
* @param array $options Array of options to set
* @param array<string, mixed> $options Array of options to set
* @return $this
*/
public function setOptions(array $options)
Expand All @@ -370,7 +370,7 @@ public function setOptions(array $options)
/**
* Get the schema options
*
* @return array
* @return array<string, mixed>
*/
public function getOptions(): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ public function patchEntity(EntityInterface $entity, array $data, array $options
* $article = $this->Articles->patchEntities($articles, $this->request->data());
* ```
*
* @param array|\Traversable $entities the entities that will get the
* @param iterable<\Cake\Datasource\EntityInterface> $entities the entities that will get the
* data merged in
* @param array $data list of arrays to be merged into the entities
* @param array $options A list of options for the objects hydration.
Expand Down Expand Up @@ -1218,7 +1218,7 @@ public function patchEntities(iterable $entities, array $data, array $options =
* - Model.beforeRules => beforeRules
* - Model.afterRules => afterRules
*
* @return array
* @return array<string, mixed>
*/
public function implementedEvents(): array
{
Expand Down
4 changes: 4 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,7 @@
'file' => 'error',
],
]);

Configure::write('Error.ignoredDeprecationPaths', [
'ests/TestCase/BootstrapTest.php',
]);
Loading