Skip to content

Commit

Permalink
0.10.11 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
romeOz committed Jul 10, 2015
1 parent 75750e9 commit fb45223
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
],
"require": {
"php": ">=5.4.0",
"romeoz/rock-base" : "*@dev",
"romeoz/rock-helpers" : "*@dev"
"romeoz/rock-base" : "0.10.*",
"romeoz/rock-helpers" : "0.11.*"
},
"require-dev": {
"phpunit/phpunit": "~4.7.0"
Expand Down
13 changes: 6 additions & 7 deletions src/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use rock\base\ObjectInterface;
use rock\base\ObjectTrait;
use rock\helpers\Instance;
use rock\helpers\StringHelper;
use rock\validate\locale\Locale;
use rock\validate\rules\Alnum;
Expand Down Expand Up @@ -397,7 +396,7 @@ public function __call($name, $arguments)

public static function __callStatic($name, $arguments)
{
return call_user_func_array([static::getInstance(static::className()), $name], $arguments);
return call_user_func_array([static::getInstance(), $name], $arguments);
}

/**
Expand Down Expand Up @@ -515,14 +514,14 @@ protected function getInstanceRule($name, array $arguments)
* Returns instance.
*
* If exists {@see \rock\di\Container} that uses it.
*
* @param string|array $config the configuration. It can be either a string representing the class name
* or an array representing the object configuration.
* @return static
*/
protected static function getInstance($config)
protected static function getInstance()
{
return Instance::ensure($config, static::className());
if (class_exists('\rock\di\Container')) {
return \rock\di\Container::load(static::className());
}
return new static();
}

protected function defaultRules()
Expand Down

0 comments on commit fb45223

Please sign in to comment.