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

Do some repo maintenance #3

Merged
merged 9 commits into from
Sep 7, 2022
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
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig helps maintain consistent coding styles for developers working on the same project across various editors and IDEs.
# See https://editorconfig.org.

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.xml]
indent_size = 4
31 changes: 0 additions & 31 deletions .github/workflows/composer.yml

This file was deleted.

10 changes: 2 additions & 8 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1]
php: [ 8.1 ]
steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -24,15 +24,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Install composer dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer install
uses: ramsey/composer-install@v2

- name: Run PHPCS
run: composer run-script phpcs
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.1, 8.0, 7.4]
can_fail: [false]

php: [ 8.1, 8.0, 7.4 ]
can_fail: [ false ]
name: PHP ${{ matrix.php }}
steps:
- name: Check out code
Expand All @@ -21,15 +20,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Install Composer dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer install
- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPUnit
shell: bash
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/en/1.0.0/).

## Unreleased

Nothing yet.

## 1.1.0

### Added
Expand All @@ -10,7 +14,7 @@ This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a C

### Fixed

- Incorrect value being passed to `BaseValidator::testValue()` in `BaseValidator::isValid()`.
- Incorrect value being passed to `BaseValidator::testValue()` in `BaseValidator::isValid()`.

## 1.0.0

Expand Down
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

This package provides additional validation classes for [the Laminas Validator framework](https://docs.laminas.dev/laminas-validator/), plus a custom base validation class.

For more information about what validators do, how to use them, and how to write your own, [visit the Laminas documentation](https://docs.laminas.dev/laminas-validator/).
## Installation

## Base Validator
Install the latest version with:

```bash
$ composer require alleyinteractive/laminas-validator-extensions
```

## Basic usage

For more information about what validators do, how to use them, and how to write your own, [visit the Laminas documentation](https://docs.laminas.dev/laminas-validator/).

## Base validator

The abstract `Alley\Validator\BaseValidator` class standardizes the implementation of custom validators with `\Laminas\Validator\AbstractValidator`.

Expand Down Expand Up @@ -59,7 +69,7 @@ class Float extends \Alley\Validator\BaseValidator
}
```

## "Any Validator" Chains
## "Any Validator" chains

`\Alley\Validator\AnyValidator` is like a [validator chain](https://docs.laminas.dev/laminas-validator/validator-chains/) except that it connects the validators with "OR," marking input as valid as soon it passes one of the given validators.

Expand Down Expand Up @@ -195,3 +205,13 @@ $valid->isValid('date_create_immutable'); // true
$valid = new \Alley\Validator\Type(['type' => 'bool']);
$valid->isValid([]); // false
```

## About

### License

[GPL-2.0-or-later](https://github.com/alleyinteractive/laminas-validator-extensions/blob/main/LICENSE)

### Maintainers

[Alley Interactive](https://github.com/alleyinteractive)
75 changes: 37 additions & 38 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
{
"name": "alleyinteractive/laminas-validator-extensions",
"description": "Additional validation classes for the laminas-validator framework.",
"type": "library",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Alley",
"email": "info@alley.co"
}
],
"autoload": {
"psr-4": {
"Alley\\": "src/Alley/"
}
},
"autoload-dev": {
"psr-4": {
"Alley\\": "tests/Alley/"
}
},
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"require": {
"php": "^7.4 || ^8.0",
"laminas/laminas-validator": "^2.20"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.8",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6"
},
"scripts": {
"fixer": "php-cs-fixer -v fix --allow-risky=yes",
"phpcbf": "phpcbf",
"phpcs": "phpcs",
"phpunit": "phpunit"
"name": "alleyinteractive/laminas-validator-extensions",
"description": "Additional validation classes for the laminas-validator framework.",
"type": "library",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Alley",
"email": "info@alley.co"
}
],
"autoload": {
"psr-4": {
"Alley\\": "src/Alley/"
}
},
"autoload-dev": {
"psr-4": {
"Alley\\": "tests/Alley/"
}
},
"config": {
"lock": false
},
"require": {
"php": "^7.4 || ^8.0",
"laminas/laminas-validator": "^2.20"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.8",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6"
},
"scripts": {
"fixer": "php-cs-fixer -v fix --allow-risky=yes",
"phpcbf": "phpcbf",
"phpcs": "phpcs",
"phpunit": "phpunit"
}
}
4 changes: 2 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="laminas-validator-extensions" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>The coding standard for laminas-validator-extensions.</description>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="alleyinteractive/laminas-validator-extensions" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>The coding standard for alleyinteractive/laminas-validator-extensions.</description>

<file>src/</file>
<file>tests/</file>
Expand Down