Skip to content

Commit

Permalink
Repository normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
zoilomora committed Sep 24, 2020
1 parent 8a75cae commit 7e52c10
Show file tree
Hide file tree
Showing 14 changed files with 751 additions and 211 deletions.
26 changes: 23 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# phpstorm project files
.idea

# netbeans project files
nbproject/*

# zend studio for eclipse project files
.buildpath
.project
.settings

# windows thumbnail cache
Thumbs.db

# Mac DS_Store Files
.DS_Store

# Composer
/vendor/
/.idea/
/vendor/
.phpunit.result.cache

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM php:7.4-cli-alpine3.11

RUN apk add --no-cache \
libzip-dev \
openssl-dev && \
docker-php-ext-install -j$(nproc) \
zip

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

ENV PATH /var/app/bin:/var/app/vendor/bin:$PATH

WORKDIR /var/app
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 PcComponentes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
UID=$(shell id -u)
GID=$(shell id -g)
DOCKER_PHP_SERVICE=php

start: erase cache-folders build composer-install bash

erase:
docker-compose down -v

build:
docker-compose build && \
docker-compose pull

cache-folders:
mkdir -p ~/.composer && chown ${UID}:${GID} ~/.composer

composer-install:
docker-compose run --rm -u ${UID}:${GID} ${DOCKER_PHP_SERVICE} composer install

bash:
docker-compose run --rm -u ${UID}:${GID} ${DOCKER_PHP_SERVICE} sh

logs:
docker-compose logs -f ${DOCKER_PHP_SERVICE}
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Criteria Array Adapter

This an implementation of [pccomponentes/criteria](https://github.com/PcComponentes/criteria) with [Array](https://www.php.net/manual/es/language.types.array.php).
For example in memory repositories where an array contains the entities.

## Installation

1) Install via [composer](https://getcomposer.org/)

```shell script
composer require pccomponentes/criteria-array-adapter
```

## Usage

In the [pccomponentes/criteria](https://github.com/PcComponentes/criteria) repository you will get the necessary information to use **Criteria**.

## License
Licensed under the [MIT license](http://opensource.org/licenses/MIT)

Read [LICENSE](LICENSE) for more information
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "pccomponentes/criteria-array-adapter",
"description": "Adapter for array for implement filter/criteria pattern",
"description": "Implementation of pccomponentes/criteria for Array",
"type": "library",
"license": "MIT",
"require": {
"php": "^7.4",
"pccomponentes/criteria": "^0.1.1"
"pccomponentes/criteria": "^0.1.3"
},
"autoload": {
"psr-4": {
Expand All @@ -14,11 +14,12 @@
},
"autoload-dev": {
"psr-4": {
"PcComponentes\\CriteriaDBALAdapter\\Tests\\": "tests/"
"PcComponentes\\CriteriaArrayAdapter\\Tests\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^9.2",
"fzaninotto/faker": "^1.9"
"fzaninotto/faker": "^1.9",
"pccomponentes/coding-standard": "^1.2"
}
}
Loading

0 comments on commit 7e52c10

Please sign in to comment.