Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Aug 10, 2018
0 parents commit 40c929e
Show file tree
Hide file tree
Showing 19 changed files with 861 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Model

View-model and model tools for Nette Framework.

## Content

- [Collections](#collections)
- [Values](#values)

## Collections

### LazyCollection

Initializes data only when required.

```php
use Contributte\Model\ViewModel\Collections\LazyCollection;

$items = LazyCollection::fromCallback(callback $datasource);

foreach($items as $item) { // Datasource callback is called on first access

}
```

## Values

### Email

```php
use Contributte\Model\Values\Email;

$email = new Email('foo@example.com'); // Validate email format
$value = $email->get(); // Get value
$equal = $email->equal(new Email('foo@example.com')); // Compare values of objects
```
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = tab
tab_width = 4

[*.md]
indent_style = space
indent_size = 4

[{composer.json,package.json,.travis.yml}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Not archived
.docs export-ignore
tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
LICENSE export-ignore
README.md export-ignore
phpstan.neon export-ignore
ruleset.xml
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# IDE
/.idea

# Composer
/vendor
/composer.lock

# Tests
/temp/
/tests/*.log
/tests/tmp
/tests/coverage.html
/coverage.xml
65 changes: 65 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
language: php

php:
- 7.1
- 7.2

before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0

install:
# Composer
- travis_retry composer install --no-progress --prefer-dist

script:
# Nette/Tester
- composer run-script tester

jobs:
include:
- env: title="Lowest Dependencies 7.1"
php: 7.1
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester

- env: title="Lowest Dependencies 7.2"
php: 7.2
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester

- stage: Quality Assurance
php: 7.2
script:
- composer run-script qa

- stage: Test Coverage
php: 7.2
script:
- composer run-script coverage
after_script:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar
- php php-coveralls.phar --verbose --config tests/.coveralls.yml

- stage: Phpstan
php: 7.2
script:
- composer run-script phpstan-install
- composer run-script phpstan

allow_failures:
- stage: Test Coverage

after_failure:
# Print *.actual content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done

sudo: false

cache:
directories:
- $HOME/.composer/cache
Loading

0 comments on commit 40c929e

Please sign in to comment.