Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves issue #6 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"php": "^7.0",
"rapidwebltd/rw-file-cache": "^1.2",
"divineomega/do-file-cache": "^2.0",
"divineomega/is_offensive": "^1.0",
"davechild/textstatistics": "^1.0",
"doctrine/inflector": "^1.2"
Expand Down
8 changes: 4 additions & 4 deletions src/Word.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace DivineOmega\WordInfo;

use DaveChild\TextStatistics\Syllables;
use rapidweb\RWFileCache\RWFileCache;
use DivineOmega\DOFileCache\DOFileCache;

class Word
{
/** @var string|null */
private $word;

/** @var RWFileCache|null */
/** @var DOFileCache|null */
private $cache;

/**
Expand Down Expand Up @@ -43,7 +43,7 @@ public function __toString()
*/
private function setupCache()
{
$this->cache = new RWFileCache();
$this->cache = new DOFileCache();
$this->cache->changeConfig(['cacheDirectory' => '/tmp/php-word-info-cache/']);
}

Expand Down Expand Up @@ -164,7 +164,7 @@ public function portmanteaus()

foreach ($responseItems as $responseItem) {
$responseItemPortmanteaus = array_map(function ($portmanteauString) {
return new Word($portmanteauString);
return new self($portmanteauString);
}, explode(',', $responseItem->combined));

$portmanteaus = array_merge($portmanteaus, $responseItemPortmanteaus);
Expand Down