Skip to content

Commit

Permalink
remove php 7.4 and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansoweb committed Sep 19, 2023
1 parent 7e705f2 commit d7ec4cf
Show file tree
Hide file tree
Showing 12 changed files with 228 additions and 145 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Check Coding Standards"

on:
pull_request:
push:
branches:
- "master"

jobs:
coding-standards:
name: "Check Coding Standards"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies:
- "highest"
php-version:
- "8.2"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2

- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"

- name: "phpcs"
run: "vendor/bin/phpcs"

- name: "phpstan"
run: "vendor/bin/phpstan analyze"
6 changes: 2 additions & 4 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Automatic Releases"

on:
Expand All @@ -14,14 +12,14 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"

- name: "Release"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
vendor
composer.lock
clover.xml
build
/build
/.phpunit.result.cache
23 changes: 14 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
}
],
"require": {
"php": "^7.1",
"psr/http-message": "^1.0"
"php": "^8.1",
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"laminas/laminas-db": "^2.9",
"laminas/laminas-coding-standard": "^1.0",
"squizlabs/php_codesniffer": "^2.7",
"phpstan/phpstan": "^0.9.2",
"phpunit/phpunit": "^7.1",
"laminas/laminas-diactoros": "^1.7",
"php-coveralls/php-coveralls": "^2.0"
"squizlabs/php_codesniffer": "^3.7",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.3",
"laminas/laminas-diactoros": "^3.2",
"php-coveralls/php-coveralls": "^2.6",
"doctrine/coding-standard": "^12.0"
},
"autoload": {
"psr-4": {
Expand All @@ -41,9 +41,14 @@
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"phpstan": "phpstan analyse -l max src",
"phpstan": "phpstan analyse",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"upload-coverage": "coveralls -v"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
7 changes: 0 additions & 7 deletions phpcs.xml

This file was deleted.

24 changes: 24 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/3.5.0/phpcs.xsd"
name="Vendor">

<description>Project coding standards</description>

<arg name="extensions" value="php"/>
<arg name="colors"/>
<arg value="sp"/>

<file>./src</file>

<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix" />
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix" />
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix" />
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint" />
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint" />
</rule>
</ruleset>
10 changes: 10 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
parameters:
level: max
tmpDir: ./build/cache/phpstan
checkMissingIterableValueType: false
paths:
- ./src
ignoreErrors:
- '#no type specified#'
- '#mixed#'
- '#on a separate line does not do anything#'
50 changes: 26 additions & 24 deletions src/BuilderInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace Los\Uql;
Expand All @@ -8,16 +9,16 @@
interface BuilderInterface
{
// Logical
const OP_NOT = '$not';
const OP_IN = '$in';
const OP_NOT_IN = '$nin';
const OP_LIKE = '$like';
const OP_OR = '$or';
const OP_AND = '$and';
const OP_NULL = '$null';
const OP_NOT_NULL = '$nnull';

const OP_LOGIC = [
public const OP_NOT = '$not';
public const OP_IN = '$in';
public const OP_NOT_IN = '$nin';
public const OP_LIKE = '$like';
public const OP_OR = '$or';
public const OP_AND = '$and';
public const OP_NULL = '$null';
public const OP_NOT_NULL = '$nnull';

public const OP_LOGIC = [
self::OP_NOT,
self::OP_IN,
self::OP_NOT_IN,
Expand All @@ -29,28 +30,29 @@ interface BuilderInterface
];

// Conditional
const OP_GREATER = '$gt';
const OP_GREATER_EQUAL = '$gte';
const OP_LESS = '$lt';
const OP_LESS_EQUAL = '$lte';
const OP_BETWEEN = '$bt';
public const OP_GREATER = '$gt';
public const OP_GREATER_EQUAL = '$gte';
public const OP_LESS = '$lt';
public const OP_LESS_EQUAL = '$lte';
public const OP_BETWEEN = '$bt';

const OP_CONDITIONAL = [
public const OP_CONDITIONAL = [
self::OP_GREATER,
self::OP_GREATER_EQUAL,
self::OP_LESS,
self::OP_LESS_EQUAL,
self::OP_BETWEEN
self::OP_BETWEEN,
];

// Hints
const HINT_SORT = '$sort';
const HINT_LIMIT = '$limit';
const HINT_SKIP = '$skip';
public const HINT_SORT = '$sort';
public const HINT_LIMIT = '$limit';
public const HINT_SKIP = '$skip';

public const HINT_ORDER_ASC = ['asc', 'ASC', 1, '1'];
public const HINT_ORDER_DESC = ['desc', 'DESC', -1, '-1'];

const HINT_ORDER_ASC = ['asc', 'ASC', 1, '1'];
const HINT_ORDER_DESC = ['desc', 'DESC', -1, '-1'];
public function fromRequest(ServerRequestInterface $request): mixed;

public function fromRequest(ServerRequestInterface $request);
public function fromParams(array $query, array $hint = []);
public function fromParams(array $query, array $hint = []): mixed;
}
Loading

0 comments on commit d7ec4cf

Please sign in to comment.