Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Rename documentation directory: doc -> docs
Browse files Browse the repository at this point in the history
Add PR and ISSUE templates
Update CONTRIBUTING and CODE_OF_CONDUCT files
  • Loading branch information
michalbundyra committed Oct 12, 2019
1 parent c5c14ec commit 5de98ae
Show file tree
Hide file tree
Showing 61 changed files with 150 additions and 126 deletions.
2 changes: 1 addition & 1 deletion CONDUCT.md → docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributor Code of Conduct

The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com)
This project adheres to [The Code Manifesto](http://codemanifesto.com)
as its guidelines for contributor interactions.

## The Code Manifesto
Expand Down
91 changes: 23 additions & 68 deletions CONTRIBUTING.md → docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,43 @@

## RESOURCES

If you wish to contribute to Zend Framework, please be sure to
If you wish to contribute to this project, please be sure to
read/subscribe to the following resources:

- [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards)
- [Contributor's Guide](http://framework.zend.com/participate/contributor-guide)
- ZF Contributor's mailing list:
Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html
Subscribe: [email protected]
- ZF Contributor's IRC channel:
#zftalk.dev on Freenode.net
- [Coding Standards](https://github.com/zendframework/zend-coding-standard)
- [Forums](https://discourse.zendframework.com/c/contributors)
- [Chat](https://zendframework-slack.herokuapp.com)
- [Code of Conduct](CODE_OF_CONDUCT.md)

If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-validator/issues/new).

## Reporting Potential Security Issues

If you have encountered a potential security vulnerability, please **DO NOT** report it on the public
issue tracker: send it to us at [[email protected]](mailto:[email protected]) instead.
We will work with you to verify the vulnerability and patch it as soon as possible.

When reporting issues, please provide the following information:

- Component(s) affected
- A description indicating how to reproduce the issue
- A summary of the security vulnerability and impact

We request that you contact us via the email address above and give the project
contributors a chance to resolve the vulnerability and issue a new release prior
to any public exposure; this helps protect users and provides them with a chance
to upgrade and/or update in order to protect their applications.

For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).
If you are working on new features or refactoring
[create a proposal](https://github.com/zendframework/zend-validator/issues/new).

## RUNNING TESTS

> ### Note: testing versions prior to 2.4
>
> This component originates with Zend Framework 2. During the lifetime of ZF2,
> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no
> changes were necessary. However, due to the migration, tests may not run on
> versions < 2.4. As such, you may need to change the PHPUnit dependency if
> attempting a fix on such a version.
To run tests:

- Clone the repository:

```console
$ git clone git@github.com:zendframework/zend-validator.git
$ cd
$ git clone git://github.com/zendframework/zend-validator.git
$ cd zend-validator
```

- Install dependencies via composer:

```console
$ curl -sS https://getcomposer.org/installer | php --
$ ./composer.phar install
$ composer install
```

If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
If you don't have `composer` installed, please download it from https://getcomposer.org/download/

- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
- Run the tests using the "test" command shipped in the `composer.json`:

```console
$ ./vendor/bin/phpunit
$ composer test
```

You can turn on conditional tests with the phpunit.xml file.
You can turn on conditional tests with the `phpunit.xml` file.
To do so:

- Copy `phpunit.xml.dist` file to `phpunit.xml`
Expand All @@ -77,24 +47,22 @@ To do so:

## Running Coding Standards Checks

This component uses [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for coding
standards checks, and provides configuration for our selected checks.
`phpcs` is installed by default via Composer.
First, ensure you've installed dependencies via composer, per the previous
section on running tests.

To run checks only:
To run CS checks only:

```console
$ composer cs-check
```

`phpcs` also includes a tool for fixing most CS violations, `phpcbf`:

To attempt to automatically fix common CS issues:

```console
$ composer cs-fix
```

If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure
If the above fixes any CS issues, please re-run the tests to ensure
they pass, and make sure you add and commit the changes after verification.

## Recommended Workflow for Contributions
Expand All @@ -103,12 +71,12 @@ Your first step is to establish a public repository from which we can
pull your work into the master repository. We recommend using
[GitHub](https://github.com), as that is where the component is already hosted.

1. Setup a [GitHub account](http://github.com/), if you haven't yet
2. Fork the repository (http://github.com/zendframework/zend-validator)
1. Setup a [GitHub account](https://github.com/), if you haven't yet
2. Fork the repository (https://github.com/zendframework/zend-validator)
3. Clone the canonical repository locally and enter it.

```console
$ git clone git://github.com:zendframework/zend-validator.git
$ git clone git://github.com/zendframework/zend-validator.git
$ cd zend-validator
```

Expand Down Expand Up @@ -188,15 +156,7 @@ To send a pull request, you have two options.
If using GitHub, you can do the pull request from there. Navigate to
your repository, select the branch you just created, and then select the
"Pull Request" button in the upper right. Select the user/organization
"zendframework" as the recipient.

If using your own repository - or even if using GitHub - you can use `git
format-patch` to create a patchset for us to apply; in fact, this is
**recommended** for security-related patches. If you use `format-patch`, please
send the patches as attachments to:

- [email protected] for patches without security implications
- [email protected] for security patches
"zendframework" (or whatever the upstream organization is) as the recipient.

#### What branch to issue the pull request against?

Expand Down Expand Up @@ -227,8 +187,3 @@ repository, we suggest doing some cleanup of these branches.
```console
$ git push {username} :<branchname>
```


## Conduct

Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project.
19 changes: 19 additions & 0 deletions docs/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- [ ] I was not able to find an [open](https://github.com/zendframework/zend-validator/issues?q=is%3Aopen) or [closed](https://github.com/zendframework/zend-validator/issues?q=is%3Aclosed) issue matching what I'm seeing.
- [ ] This is not a question. (Questions should be asked on [chat](https://zendframework.slack.com/) ([Signup here](https://zendframework-slack.herokuapp.com/)) or our [forums](https://discourse.zendframework.com/).)

Provide a narrative description of what you are trying to accomplish.

### Code to reproduce the issue

<!-- Please provide the minimum code necessary to recreate the issue -->

```php
```

### Expected results

<!-- What do you think should have happened? -->

### Actual results

<!-- What did you actually observe? -->
25 changes: 25 additions & 0 deletions docs/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Provide a narrative description of what you are trying to accomplish:

- [ ] Are you fixing a bug?
- [ ] Detail how the bug is invoked currently.
- [ ] Detail the original, incorrect behavior.
- [ ] Detail the new, expected behavior.
- [ ] Base your feature on the `master` branch, and submit against that branch.
- [ ] Add a regression test that demonstrates the bug, and proves the fix.
- [ ] Add a `CHANGELOG.md` entry for the fix.

- [ ] Are you creating a new feature?
- [ ] Why is the new feature needed? What purpose does it serve?
- [ ] How will users use the new feature?
- [ ] Base your feature on the `develop` branch, and submit against that branch.
- [ ] Add only one feature per pull request; split multiple features over multiple pull requests
- [ ] Add tests for the new feature.
- [ ] Add documentation for the new feature.
- [ ] Add a `CHANGELOG.md` entry for the new feature.

- [ ] Is this related to quality assurance?
<!-- Detail why the changes are necessary -->

- [ ] Is this related to documentation?
<!-- Is it a typographical and/or grammatical fix? -->
<!-- Is it new documentation? -->
25 changes: 25 additions & 0 deletions docs/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Getting Support

Zend Framework offers three support channels:

- For real-time questions, use our
[chat](https://zendframework-slack.herokuapp.com)
- For detailed questions (e.g., those requiring examples) use our
[forums](https://discourse.zendframework.com/c/questions/components)
- To report issues, use this repository's
[issue tracker](https://github.com/zendframework/zend-validator/issues/new)

**DO NOT** use the issue tracker to ask questions; use chat or the forums for
that. Questions posed to the issue tracker will be closed.

When reporting an issue, please include the following details:

- A narrative description of what you are trying to accomplish.
- The minimum code necessary to reproduce the issue.
- The expected results of exercising that code.
- The actual results received.

We may ask for additional details: what version of the library you are using,
and what PHP version was used to reproduce the issue.

You may also submit a failing test case as a pull request.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/book/validators/db.md → docs/book/validators/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ given value.

> ### Installation requirements
>
> `Zend\Validator\Db\NoRecordExists` and `Zend\Validator\Db\RecordExists`
> `Zend\Validator\Db\NoRecordExists` and `Zend\Validator\Db\RecordExists`
> depends on the zend-db component, so be sure to have it installed before
> getting started:
>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ at instantiation, by giving an array with the related options, or afterwards, by
using `setOptions()`. The following options are supported:

- `allow`: Defines which type of domain names are accepted. This option is used
in conjunction with the hostnameValidator option to set the hostname validator.
Possible values of this option defined in [Hostname](hostname.md) validator's
in conjunction with the hostnameValidator option to set the hostname validator.
Possible values of this option defined in [Hostname](hostname.md) validator's
`ALLOW_*` constants:
- `ALLOW_DNS` (default) - Allows Internet domain names _(e.g. example.com)_
- `ALLOW_IP` - Allows IP addresses _(e.g. 192.168.0.1)_
- `ALLOW_LOCAL` - Allows local network such as _localhost_ or _www.localdomain_
- `ALLOW_URI` - Allows hostnames in URI generic syntax. See [RFC 3986](https://www.ietf.org/rfc/rfc3986.txt)
- `ALLOW_ALL` - Allows all types of hostnames

- `useDeepMxCheck`: Defines if the servers MX records should be verified by a deep check.
When this option is set to `true` then additionally to MX records also the `A`,
`A6` and `AAAA` records are used to verify if the server accepts emails. This
Expand Down
96 changes: 48 additions & 48 deletions doc/book/validators/explode.md → docs/book/validators/explode.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# Explode Validator

`Zend\Validator\Explode` executes a validator for each item exploded from an
array.

## Supported options

The following options are supported for `Zend\Validator\Explode`:

- `valueDelimiter`: Defines the delimiter used to explode values from an array.
It defaults to `,`. If the given value is an array, this option isn't used.
- `validator`: Sets the validator that will be executed on each exploded item.
This may be a validator instance, or a validator service name.

## Basic usage

To validate if every item in an array is in a specified haystack:

```php
$inArrayValidator = new Zend\Validator\InArray([
'haystack' => [1, 2, 3, 4, 5, 6],
]);

$explodeValidator = new Zend\Validator\Explode([
'validator' => $inArrayValidator
]);

$explodeValidator->isValid([1, 4, 6]); // returns true
$explodeValidator->isValid([1, 4, 6, 8]); // returns false
```

## Exploding strings

To validate if every e-mail in a string is contained in a list of names:

```php
$inEmailListValidator = new Zend\Validator\InArray([
'haystack' => ['[email protected]', '[email protected]', '[email protected]'],
]);

$explodeValidator = new Zend\Validator\Explode([
'validator' => $inEmailListValidator,
'valueDelimiter' => ','
]);

$explodeValidator->isValid('[email protected],[email protected]'); // returns true
$explodeValidator->isValid('[email protected],[email protected]'); // returns false
```
# Explode Validator

`Zend\Validator\Explode` executes a validator for each item exploded from an
array.

## Supported options

The following options are supported for `Zend\Validator\Explode`:

- `valueDelimiter`: Defines the delimiter used to explode values from an array.
It defaults to `,`. If the given value is an array, this option isn't used.
- `validator`: Sets the validator that will be executed on each exploded item.
This may be a validator instance, or a validator service name.

## Basic usage

To validate if every item in an array is in a specified haystack:

```php
$inArrayValidator = new Zend\Validator\InArray([
'haystack' => [1, 2, 3, 4, 5, 6],
]);

$explodeValidator = new Zend\Validator\Explode([
'validator' => $inArrayValidator
]);

$explodeValidator->isValid([1, 4, 6]); // returns true
$explodeValidator->isValid([1, 4, 6, 8]); // returns false
```

## Exploding strings

To validate if every e-mail in a string is contained in a list of names:

```php
$inEmailListValidator = new Zend\Validator\InArray([
'haystack' => ['[email protected]', '[email protected]', '[email protected]'],
]);

$explodeValidator = new Zend\Validator\Explode([
'validator' => $inEmailListValidator,
'valueDelimiter' => ','
]);

$explodeValidator->isValid('[email protected],[email protected]'); // returns true
$explodeValidator->isValid('[email protected],[email protected]'); // returns false
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ within an array. It is also able to validate multidimensional arrays.

The following options are supported for `Zend\Validator\InArray`:

- `haystack`: Sets the haystack for the validation.
- `haystack`: Sets the haystack for the validation.
- `recursive`: Defines if the validation should be done recursively. This option
defaults to `false`.
- `strict`: Three modes of comparison are offered owing to an often overlooked,
Expand Down Expand Up @@ -92,15 +92,15 @@ $validator = new Zend\Validator\InArray([
'strict' => InArray::COMPARE_STRICT, // equates to ``true``
]);

// set non-strict mode
// set non-strict mode
$validator = new Zend\Validator\InArray([
'haystack' => ['value1', 'value2', /* ... */ 'valueN'],
'strict' => InArray:COMPARE_NOT_STRICT, // equates to ``false``
]);

// or

$validator->setStrict(InArray::COMPARE_STRICT);
$validator->setStrict(InArray::COMPARE_STRICT);
$validator->setStrict(InArray::COMPARE_NOT_STRICT);
$validator->setStrict(InArray::COMPARE_NOT_STRICT_AND_PREVENT_STR_TO_INT_VULNERABILITY);
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docs_dir: doc/book
site_dir: doc/html
docs_dir: docs/book
site_dir: docs/html
pages:
- Home: index.md
- Introduction: intro.md
Expand Down

0 comments on commit 5de98ae

Please sign in to comment.