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

Commit

Permalink
Merge 7b2a1e5 into 78e07b2
Browse files Browse the repository at this point in the history
  • Loading branch information
dakorpar committed Apr 14, 2018
2 parents 78e07b2 + 7b2a1e5 commit 1782997
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 183 deletions.
29 changes: 8 additions & 21 deletions .travis.yml
Expand Up @@ -7,36 +7,24 @@ cache:
- $HOME/.composer/cache

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2

env:
matrix:
- NETTE=nette-2.4-dev
- NETTE=nette-2.4
- NETTE=nette-2.3

matrix:
include:
- php: 5.6
env: NETTE=nette-2.3 COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable"
- php: 7.0
- php: 7.1
env: NETTE=nette-2.4 COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.2
env: NETTE=nette-2.4 COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
exclude:
- php: 5.4
env: NETTE=nette-2.4-dev
- php: 5.4
env: NETTE=nette-2.4
- php: 5.5
env: NETTE=nette-2.4-dev
- php: 5.5
env: NETTE=nette-2.4
allow_failures:
- php: 7.0
- php: 7.1
env: NETTE=nette-2.4 COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"
- php: 7.2
env: NETTE=nette-2.4 COVERAGE="--coverage ./coverage.xml --coverage-src ./src" TESTER_RUNTIME="phpdbg"

before_install:
- travis_retry composer self-update
- wget -O /tmp/composer-nette https://raw.githubusercontent.com/Kdyby/TesterExtras/master/bin/composer-nette.php
Expand All @@ -45,7 +33,6 @@ before_install:
install:
- travis_retry composer update --no-interaction --prefer-dist $COMPOSER_EXTRA_ARGS
- travis_retry composer create-project --no-interaction jakub-onderka/php-parallel-lint /tmp/php-parallel-lint
- travis_retry composer create-project --no-interaction kdyby/code-checker /tmp/code-checker
- travis_retry wget -O /tmp/coveralls.phar https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar

script:
Expand Down
46 changes: 21 additions & 25 deletions composer.json
Expand Up @@ -17,34 +17,30 @@
"issues": "https://github.com/Kdyby/ElasticSearch/issues"
},
"require": {
"nette/di": "~2.3@dev",
"tracy/tracy": "~2.3@dev",
"nette/utils": "~2.3@dev",
"nette/di": "~2.4",
"tracy/tracy": "~2.4",
"nette/utils": "~2.4",

"ruflin/elastica": "~2.1|~3.0"
"ruflin/elastica": "~6.0"
},
"require-dev": {
"nette/application": "~2.3@dev",
"nette/bootstrap": "~2.3@dev",
"nette/caching": "~2.3@dev",
"nette/component-model": "~2.2@dev",
"nette/database": "~2.3@dev",
"nette/deprecated": "~2.3@dev",
"nette/di": "~2.3@dev",
"nette/finder": "~2.3@dev",
"nette/forms": "~2.3@dev",
"nette/http": "~2.3@dev",
"nette/mail": "~2.3@dev",
"nette/neon": "~2.3@dev",
"nette/php-generator": "~2.3@dev",
"nette/reflection": "~2.3@dev",
"nette/robot-loader": "~2.3@dev",
"nette/safe-stream": "~2.3@dev",
"nette/security": "~2.3@dev",
"nette/tokenizer": "~2.2@dev",
"latte/latte": "~2.3@dev",
"tracy/tracy": "~2.3@dev",
"nette/utils": "~2.3@dev",
"nette/application": "~2.4",
"nette/bootstrap": "~2.4",
"nette/caching": "~2.4",
"nette/component-model": "~2.4",
"nette/database": "~2.4",
"nette/finder": "~2.4",
"nette/forms": "~2.4",
"nette/http": "~2.4",
"nette/mail": "~2.4",
"nette/neon": "~2.4",
"nette/php-generator": "~2.6",
"nette/reflection": "~2.4",
"nette/robot-loader": "~2.4",
"nette/safe-stream": "~2.3",
"nette/security": "~2.4",
"nette/tokenizer": "~2.3",
"latte/latte": "~2.4",

"nette/tester": "~1.7"
},
Expand Down
142 changes: 6 additions & 136 deletions src/Kdyby/ElasticSearch/Client.php
Expand Up @@ -24,25 +24,27 @@
class Client extends Elastica\Client
{

use Nette\SmartObject;

public $onSuccess = [];
public $onError = [];



/**
* @param string $path
* @param string $method
* @param array $data
* @param array $query
* @throws \Exception
* @param string $contentType
* @return Elastica\Response
* @throws \Exception
*/
public function request($path, $method = Request::GET, $data = [], array $query = [])
public function request($path, $method = Request::GET, $data = [], array $query = [], $contentType = Request::DEFAULT_CONTENT_TYPE)
{
$begin = microtime(TRUE);

try {
$response = parent::request($path, $method, $data, $query);
$response = parent::request($path, $method, $data, $query, $contentType);
$this->onSuccess($this, $this->_lastRequest, $response, microtime(TRUE) - $begin);

return $response;
Expand All @@ -63,136 +65,4 @@ protected function _log($context)

parent::_log($context);
}

/*************************** Nette\Object ***************************/



/**
* Access to reflection.
*
* @return \Nette\Reflection\ClassType
*/
public static function getReflection()
{
return new Nette\Reflection\ClassType(get_called_class());
}



/**
* Call to undefined method.
*
* @param string $name
* @param array $args
*
* @throws \Nette\MemberAccessException
* @return mixed
*/
public function __call($name, $args)
{
return ObjectMixin::call($this, $name, $args);
}



/**
* Call to undefined static method.
*
* @param string $name
* @param array $args
*
* @throws \Nette\MemberAccessException
* @return mixed
*/
public static function __callStatic($name, $args)
{
return ObjectMixin::callStatic(get_called_class(), $name, $args);
}



/**
* Adding method to class.
*
* @param $name
* @param null $callback
*
* @throws \Nette\MemberAccessException
* @return callable|null
*/
public static function extensionMethod($name, $callback = NULL)
{
if (strpos($name, '::') === FALSE) {
$class = get_called_class();
} else {
list($class, $name) = explode('::', $name);
}
if ($callback === NULL) {
return ObjectMixin::getExtensionMethod($class, $name);
} else {
ObjectMixin::setExtensionMethod($class, $name, $callback);
}
}



/**
* Returns property value. Do not call directly.
*
* @param string $name
*
* @throws \Nette\MemberAccessException
* @return mixed
*/
public function &__get($name)
{
return ObjectMixin::get($this, $name);
}



/**
* Sets value of a property. Do not call directly.
*
* @param string $name
* @param mixed $value
*
* @throws \Nette\MemberAccessException
* @return void
*/
public function __set($name, $value)
{
ObjectMixin::set($this, $name, $value);
}



/**
* Is property defined?
*
* @param string $name
*
* @return bool
*/
public function __isset($name)
{
return ObjectMixin::has($this, $name);
}



/**
* Access to undeclared property.
*
* @param string $name
*
* @throws \Nette\MemberAccessException
* @return void
*/
public function __unset($name)
{
ObjectMixin::remove($this, $name);
}

}
4 changes: 3 additions & 1 deletion src/Kdyby/ElasticSearch/Diagnostics/Panel.php
Expand Up @@ -25,9 +25,11 @@
/**
* @author Filip Procházka <filip@prochazka.su>
*/
class Panel extends Nette\Object implements IBarPanel
class Panel implements IBarPanel
{

use Nette\SmartObject;

/**
* @var float
*/
Expand Down

0 comments on commit 1782997

Please sign in to comment.