Skip to content

Commit

Permalink
Merge 8be56aa into bcc3a65
Browse files Browse the repository at this point in the history
  • Loading branch information
aaemnnosttv committed Aug 12, 2016
2 parents bcc3a65 + 8be56aa commit 01d8038
Show file tree
Hide file tree
Showing 35 changed files with 1,208 additions and 498 deletions.
56 changes: 35 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
language: php

php:
- 5.5
- 5.6
- 7.0
- hhvm
matrix:
include:
- php: 5.5
env: WP_VERSION=latest

notifications:
email:
on_success: never
on_failure: change
- php: 5.6
env: WP_VERSION=4.5.3
- php: 5.6
env: WP_VERSION=latest
- php: 5.6
env: WP_VERSION=trunk

env:
- WP_VERSION=latest WP_MULTISITE=0
- php: 7.0
env: WP_VERSION=latest

before_script:
- php: hhvm
env: WP_VERSION=latest

before_install:
- composer self-update --stable
- composer validate --strict
- composer install
- bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION

script:
install: composer install

before_script:
- bash tests/bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_success:
- travis_retry php vendor/bin/coveralls -v
script: vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_success: travis_retry php vendor/bin/coveralls -v

before_deploy:
- bash build/bin/build-docs.sh
before_deploy: bash build/bin/build-docs.sh

deploy:
provider: s3
Expand All @@ -40,5 +44,15 @@ deploy:
skip_cleanup: true
local_dir: ../silk-api-docs
on:
branch: master
php: 5.6
all_branches: true
condition: $WP_VERSION = latest

cache:
directories:
- vendor

notifications:
email:
on_success: never
on_failure: change
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Release Notes

## v0.11.0 (2016-??-??)

### Added
- `User\Model`
- `User\QueryBuilder`
- `url` methods on `Post\Model` & `Term\Model`
- `Model::make()` named constructor
- `objectAliases` property, allowing for `$model->aliasName == $model->object->targetProperty`
- Shorthand property names, Eg: `$postModel->{name} == $postModel->object->post_{name}`

### Changed
- `Hook` callbacks now automatically return the first argument passed if nothing is returned.
- `ObjectMeta` now has a fluent `set(key, value)` method.
- Deprecated `Post\Model::fromWpPost()` and `Term\Model::fromWpTerm()` (use `::make()` instead)
- Simplified internals of `Model::save()`, `::delete()` and `::refresh()`

## v0.10.1 (2016-07-22)

### Fixed
Expand Down
11 changes: 0 additions & 11 deletions src/Contracts/Executable.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/Database/Action.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Database/NullAction.php

This file was deleted.

16 changes: 12 additions & 4 deletions src/Event/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,17 @@ public function remove()
*/
public function mediateCallback($given = null)
{
if (! $this->shouldInvoke(func_get_args())) {
$arguments = func_get_args();

if (! $this->shouldInvoke($arguments)) {
return $given;
}

if (is_null($returned = $this->invokeCallback($arguments))) {
return $given;
}

return $this->invokeCallback(func_get_args());
return $returned;
}

/**
Expand Down Expand Up @@ -164,11 +170,13 @@ public function shouldInvoke(array $arguments)
*/
protected function invokeCallback($arguments)
{
$arguments = array_slice($arguments, 0, $this->callbackParamCount ?: null);
$returned = $this->callback->callArray(
array_slice($arguments, 0, $this->callbackParamCount ?: null)
);

$this->iterations++;

return $this->callback->callArray($arguments);
return $returned;
}

/**
Expand Down
15 changes: 15 additions & 0 deletions src/Meta/ObjectMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ public function get($key)
return new Meta($this->type, $this->id, $key);
}

/**
* Set the value for the given key.
*
* @param string $key Meta key
* @param mixed $value New meta value
*
* @return $this
*/
public function set($key, $value)
{
$this->get($key)->set($value);

return $this;
}

/**
* Get all meta for the object as a Collection.
*
Expand Down
32 changes: 0 additions & 32 deletions src/Post/Action/Action.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Post/Action/PostDeleter.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Post/Action/PostLoader.php

This file was deleted.

24 changes: 0 additions & 24 deletions src/Post/Action/PostSaver.php

This file was deleted.

0 comments on commit 01d8038

Please sign in to comment.