Skip to content

Commit 0e8a29e

Browse files
authored
Merge pull request #21 from hotline-emu/imp/swap-to-trader
[WIP] Version 3
2 parents d333e4d + 85c6cfc commit 0e8a29e

24 files changed

+219
-1971
lines changed

.coveralls.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
service_name: travis-ci
2-
src_dir: .
32
coverage_clover: clover.xml
43
json_path: coveralls-upload.json

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Enforce Unix newlines
2+
* text=lf
3+
4+
# Exclude unused files
5+
# see: https://redd.it/2jzp6k
6+
/tests export-ignore
7+
/.github export-ignore
8+
/.gitattributes export-ignore
9+
/.gitignore export-ignore
10+
/.*.yml export-ignore
11+
/phpcs.xml export-ignore
12+
/phpunit.xml.dist export-ignore
13+
/README.md export-ignore
14+

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @traderinteractive/opensource

.github/CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contribution Guidelines
2+
We welcome you to report [issues](/../../issues) or submit [pull requests](/../../pulls). While the below guidelines are necessary to get code merged, you can
3+
submit pull requests that do not adhere to them and we will try to take care of them in our spare time. We are a smallish group of developers,
4+
though, so if you can make sure the build is passing 100%, that would be very useful.
5+
6+
We recommend including details of your particular usecase(s) with any issues or pull requests. We love to hear how our libraries are being used
7+
and we can get things merged in quicker when we understand its expected usage.
8+
9+
## Pull Requests
10+
Code changes should be sent through [GitHub Pull Requests](/../../pulls). Before submitting the pull request, make sure that phpunit reports success
11+
by running:
12+
```sh
13+
./vendor/bin/phpunit
14+
```
15+
And there are not coding standard violations by running
16+
```sh
17+
./vendor/bin/phpcs
18+
```
19+
20+
## Builds
21+
Our [Travis build](https://travis-ci.org/traderinteractive/memoize-php) executes [PHPUnit](http://www.phpunit.de) and uses [Coveralls](https://coveralls.io/) to enforce code coverage.
22+
While the build does not strictly enforce 100% code coverage, it will not allow coverage to drop below its current percentage.
23+
[Scrutinizer](https://scrutinizer-ci.com/) is used to ensure code quality and enforce the [coding standard](http://www.php-fig.org/psr/psr-2/).
24+

.github/ISSUE_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Expected Behavior
2+
3+
## Actual Behavior
4+
5+
## Steps to reproduce the behavior
6+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Fixes # .
2+
3+
#### What does this PR do?
4+
5+
#### Checklist
6+
- [ ] Pull request contains a clear definition of changes
7+
- [ ] Tests (either unit, integration, or acceptance) written and passing
8+
- [ ] Relevant documentation produced and/or updated
9+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/coverage/
22
/vendor/
33
clover.xml
4+
composer.lock
5+
phpunit.xml

.scrutinizer.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
filter:
22
excluded_paths:
33
- 'vendor/*'
4-
- 'tests/*'
54
before_commands:
65
- 'composer install'
76
tools:
87
php_analyzer: true
98
php_mess_detector: true
109
php_code_sniffer:
1110
config:
12-
standard: PSR1
11+
standard: PSR2
1312
sensiolabs_security_checker: true
1413
php_loc:
1514
excluded_dirs:
1615
- vendor
17-
- tests
1816
php_pdepend: true
1917
php_sim: true
18+
build_failure_conditions:
19+
- 'issues.label("coding-style").new.exists'
20+
- 'elements.rating(< B).new.exists'
21+
- 'project.metric("scrutinizer.quality", < 9)'
22+
- 'issues.severity(>= MAJOR).new.exists'

.travis.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
language: php
22
php:
33
- 7.0
4-
- 5.6
5-
- hhvm
6-
install: composer install
7-
script: ./vendor/bin/phpunit --coverage-clover clover.xml
8-
after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi'
4+
- 7.1
5+
- 7.2
6+
- nightly
7+
env:
8+
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
9+
- PREFER_LOWEST=""
10+
matrix:
11+
fast_finish: true
12+
allow_failures:
13+
- php: nightly
14+
before_script:
15+
- composer update $PREFER_LOWEST
16+
script:
17+
- ./vendor/bin/phpunit --coverage-clover clover.xml
18+
after_success: ./vendor/bin/coveralls -v

CONTRIBUTING.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 Dominion Enterprises
3+
Copyright (c) 2017 Trader Interactive
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
# Memoize
22
A PHP library for memoizing repeated function calls.
33

4-
[![Build Status](http://img.shields.io/travis/dominionenterprises/memoize-php.svg?style=flat)](https://travis-ci.org/dominionenterprises/memoize-php)
5-
[![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/dominionenterprises/memoize-php.svg?style=flat)](https://scrutinizer-ci.com/g/dominionenterprises/memoize-php/)
6-
[![Code Coverage](http://img.shields.io/coveralls/dominionenterprises/memoize-php.svg?style=flat)](https://coveralls.io/r/dominionenterprises/memoize-php)
4+
[![Build Status](http://img.shields.io/travis/traderinteractive/memoize-php.svg?style=flat)](https://travis-ci.org/traderinteractive/memoize-php)
5+
[![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/traderinteractive/memoize-php.svg?style=flat)](https://scrutinizer-ci.com/g/traderinteractive/memoize-php/)
6+
[![Code Coverage](http://img.shields.io/coveralls/traderinteractive/memoize-php.svg?style=flat)](https://coveralls.io/r/traderinteractive/memoize-php)
77

8-
[![Latest Stable Version](http://img.shields.io/packagist/v/dominionenterprises/memoize.svg?style=flat)](https://packagist.org/packages/dominionenterprises/memoize)
9-
[![Total Downloads](http://img.shields.io/packagist/dt/dominionenterprises/memoize.svg?style=flat)](https://packagist.org/packages/dominionenterprises/memoize)
10-
[![License](http://img.shields.io/packagist/l/dominionenterprises/memoize.svg?style=flat)](https://packagist.org/packages/dominionenterprises/memoize)
8+
[![Latest Stable Version](http://img.shields.io/packagist/v/traderinteractive/memoize.svg?style=flat)](https://packagist.org/packages/traderinteractive/memoize)
9+
[![Total Downloads](http://img.shields.io/packagist/dt/traderinteractive/memoize.svg?style=flat)](https://packagist.org/packages/traderinteractive/memoize)
10+
[![License](http://img.shields.io/packagist/l/traderinteractive/memoize.svg?style=flat)](https://packagist.org/packages/traderinteractive/memoize)
1111

1212
## Requirements
13-
This library requires PHP 5.4, or newer.
13+
This library requires PHP 7.0, or newer.
1414

1515
## Installation
1616
This package uses [composer](https://getcomposer.org) so you can just add
17-
`dominionenterprises/memoize` as a dependency to your `composer.json` file.
17+
`traderinteractive/memoize` as a dependency to your `composer.json` file.
1818

1919
## Memoization
2020
[Memoization](http://en.wikipedia.org/wiki/Memoization) is a way of optimizing
2121
a function that is called repeatedly by caching the results of a function call.
2222

2323
## Memoization Providers
2424
This library includes several built-in providers for memoization. Each one
25-
implements the `\DominionEnterprises\Memoize\Memoize` interface:
25+
implements the `\TraderInteractive\Memoize\Memoize` interface:
2626
```php
2727
interface Memoize
2828
{
@@ -90,7 +90,7 @@ rather than only caching computation for the current process.
9090
#### Example
9191
```php
9292
$predis = new \Predis\Client($redisUrl);
93-
$memoize = new \DominionEnterprises\Memoize\Predis($predis);
93+
$memoize = new \TraderInteractive\Memoize\Predis($predis);
9494

9595
$compute = function() {
9696
// Perform some long operation that you want to memoize
@@ -106,7 +106,7 @@ moment and only keeps the results around as long as the memoizer is in memory.
106106

107107
#### Example
108108
```php
109-
$memoize = new \DominionEnterprises\Memoize\Memory();
109+
$memoize = new \TraderInteractive\Memoize\Memory();
110110

111111
$compute = function() {
112112
// Perform some long operation that you want to memoize
@@ -123,7 +123,7 @@ out for this one and everything will still work.
123123

124124
#### Example
125125
```php
126-
$memoize = new \DominionEnterprises\Memoize\Never();
126+
$memoize = new \TraderInteractive\Memoize\Never();
127127

128128
$compute = function() {
129129
// Perform some long operation that you want to memoize

build.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dominionenterprises/memoize",
2+
"name": "traderinteractive/memoize",
33
"description": "A library for memoizing repeated function calls.",
44
"keywords": ["memoization", "predis", "cache", "optimization"],
55
"authors": [
@@ -10,19 +10,22 @@
1010
}
1111
],
1212
"license": "MIT",
13+
"config": {
14+
"sort-packages": true
15+
},
1316
"require": {
14-
"php": "~5.6 || ~7.0"
17+
"php": "^7.0"
1518
},
1619
"require-dev": {
20+
"php-coveralls/php-coveralls": "^1.0",
21+
"phpunit/phpunit": "^6.0",
1722
"predis/predis": "~1.0",
18-
"phpunit/phpunit": "~5.0",
19-
"satooshi/php-coveralls": "~0.6.1",
20-
"squizlabs/php_codesniffer": "~1.5"
23+
"squizlabs/php_codesniffer": "^3.2"
2124
},
2225
"suggest": {
2326
"predis/predis": "Allows for Redis-based memoization."
2427
},
2528
"autoload": {
26-
"psr-4": { "DominionEnterprises\\Memoize\\": "src/" }
29+
"psr-4": { "TraderInteractive\\Memoize\\": "src/" }
2730
}
2831
}

0 commit comments

Comments
 (0)