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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Merging develop to master in preparation for 2.6.0.
  • Loading branch information
weierophinney committed Feb 3, 2016
2 parents a55e992 + 5c9c972 commit 50c354f
Show file tree
Hide file tree
Showing 21 changed files with 618 additions and 407 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
.*.sw*
.*.un~
nbproject
doc/html/
tmp/
zf-mkdoc-theme/

clover.xml
composer.lock
Expand Down
34 changes: 32 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,44 @@ branches:
cache:
directories:
- $HOME/.composer/cache
- $HOME/.local
- zf-mkdoc-theme

env:
global:
- SITE_URL: https://zendframework.github.io/zend-tag
- GH_USER_NAME: "Matthew Weier O'Phinney"
- GH_USER_EMAIL: [email protected]
- GH_REF: github.com/zendframework/zend-tag.git
- secure: "S3bpXlpY3uBhHXbfvInuHEfcD62cQsKgA0KWzOMhrEsyUvlUYceGUAEpX4ll9ZR9MR0rDKNPYFOlAOFX32P9gomK9laRdbWfy6CV0Qb/uPjPuq/8dx6fvTiNrGSt00Qs+fQikOs12v+P3IGwX8wuJLd30zjhuSRA8leQzF1gsbfUhSkTy6P+FkuqvCdw1uFflBje/88bWvv9s+vfB094LSN0iSmF3QU1RquGCStcwXC7nUuwKceTwjJ6HmXbvMT2cq2Gn4EQG+1ytKZICxXQ8NM+tWFhNPPRO0EMIu6EFi5825zeT/9AhbxhGJnnwfDU6hvbmcqdJnLO5LTBAzXg5XDUw/LSvSQp/4toSfpmuyVtBlnUFUsMjjS31K5kwegbtjHjuLOr7rKTGZbqAvYzAHFOnFDqSjwQhEgD43+ah8b58qzmtXN/iCH/rDS1XQ+BR1XrUJpQy308/Vqb0uVnSFAj/HH/BlIKFscDMxQhbZy9j6rJgvltIC3OCCDsor34mZC0lb0mK+OW9bL+FFySSkvLO5FI0idHn5K6wevT82x9fAA7sAoAJvmxKeAYqXZY360DLVfGsvXhxKUIeU1q59Rrxzix5i8MCiokb2tjFQfd0G2FxcaHehnnBu0GxAGSEu0ClJIXQzxp3Q9jNHHG2Ntm90E9nt55Fh2Z138W0qQ="

matrix:
fast_finish: true
include:
- php: 5.5
env:
- EXECUTE_CS_CHECK=true
- php: 5.5
env:
- SERVICE_MANAGER_VERSION='^2.7.5'
- php: 5.6
env:
- EXECUTE_TEST_COVERALLS=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 5.6
env:
- SERVICE_MANAGER_VERSION='^2.7.5'
- php: 7
- php: hhvm
allow_failures:
- php: 7
env:
- SERVICE_MANAGER_VERSION='^2.7.5'
- php: hhvm
- php: hhvm
env:
- SERVICE_MANAGER_VERSION='^2.7.5'
allow_failures:
- php: hhvm

notifications:
irc: "irc.freenode.org#zftalk.dev"
Expand All @@ -33,6 +57,8 @@ before_install:
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- composer self-update
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
- if [[ $SERVICE_MANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi
- if [[ $SERVICE_MANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi

install:
- travis_retry composer install --no-interaction --ignore-platform-reqs
Expand All @@ -41,6 +67,10 @@ script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi

after_script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls ; fi
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.6.0 - 2016-02-03

### Added

- [#11](https://github.com/zendframework/zend-tag/pull/11) adds documentation
and publishes it to https://zendframework.github.io/zend-tag/

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#3](https://github.com/zendframework/zend-tag/pull/3) and
[#10](https://github.com/zendframework/zend-tag/pull/10) update the component
to be forward-compatible with zend-servicemanager v3.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ taggable item in conjunction with `Zend\Tag`.


- File issues at https://github.com/zendframework/zend-tag/issues
- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-tag
- Documentation is at https://zendframework.github.io/zend-tag/
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
}
},
"require": {
"php": ">=5.5",
"zendframework/zend-escaper": "~2.5",
"zendframework/zend-stdlib": "~2.5"
"php": "^5.5 || ^7.0",
"zendframework/zend-escaper": "^2.5",
"zendframework/zend-stdlib": "^3.0"
},
"require-dev": {
"zendframework/zend-config": "~2.5",
"zendframework/zend-servicemanager": "~2.5",
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/PHPUnit": "~4.0"
},
Expand Down
10 changes: 10 additions & 0 deletions doc/book/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="container">
<div class="jumbotron">
<h1>zend-tag</h1>

<p>Manipulate and weight taggable items, and create tag clouds.</p>

<pre><code class="language-bash">$ composer require zendframework/zend-tag</code></pre>
</div>
</div>

1 change: 1 addition & 0 deletions doc/book/index.md
48 changes: 48 additions & 0 deletions doc/book/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Introduction and Quick Start

zend-tag provides the ability to work with taggable items. At its foundation, it
provides two classes to work with tags, `Zend\Tag\Item` and `Zend\Tag\ItemList`.
Additionally, it comes with the interface `Zend\Tag\TaggableInterface`, which
allows you to use any of your models as a taggable item in conjunction with the
component.

`Zend\Tag\Item` provides the essential functionality required to work with all
other functionality within the component. A taggable item always consists of a
title and a relative weight (e.g. number of occurrences). It also stores
parameters which are used by the different sub-components.

`Zend\Tag\ItemList` exists to group multiple items together as an array
iterator, and provides additional functionality to calculate absolute weight
values based on the given relative weights of each item in it.

## Quick Start

This example illustrates how to create a list of tags and spread absolute weight
values over them.

```php
// Create the item list
$list = new Zend\Tag\ItemList();

// Assign tags to it
$list[] = new Zend\Tag\Item(['title' => 'Code', 'weight' => 50]);
$list[] = new Zend\Tag\Item(['title' => 'Zend Framework', 'weight' => 1]);
$list[] = new Zend\Tag\Item(['title' => 'PHP', 'weight' => 5]);

// Spread absolute values on the items
$list->spreadWeightValues([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

// Output the items with their absolute values
foreach ($list as $item) {
printf("%s: %d\n", $item->getTitle(), $item->getParam('weightValue'));
}
```

This will output the three items "Code", "Zend Framework", and "PHP", with the
absolute values 10, 1 and 2:

```
Code: 10
Zend Framework: 1
PHP: 2
```
Loading

0 comments on commit 50c354f

Please sign in to comment.