Don't use anonymous functions

Added some missing doc
This commit is contained in:
Pierre Rudloff 2017-10-02 20:29:09 +02:00
parent 70fe4cb95d
commit b0c4963ac8
2 changed files with 16 additions and 4 deletions

View File

@ -88,6 +88,11 @@ class Locale
return strtolower($this->region); return strtolower($this->region);
} }
/**
* Get country information from locale.
*
* @return \Rinvex\Country\Country
*/
public function getCountry() public function getCountry()
{ {
return country($this->getIso3166()); return country($this->getIso3166());

View File

@ -64,6 +64,15 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
$this->assertNull($this->middleware->testLocale([])); $this->assertNull($this->middleware->testLocale([]));
} }
/**
* Mock function that does nothing.
*
* @return void
*/
public function nothing()
{
}
/** /**
* Test the __invoke() function. * Test the __invoke() function.
* *
@ -75,8 +84,7 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
$this->middleware->__invoke( $this->middleware->__invoke(
$request->withHeader('Accept-Language', 'fr-FR'), $request->withHeader('Accept-Language', 'fr-FR'),
new Response(), new Response(),
function () { [$this, 'nothing']
}
); );
} }
@ -91,8 +99,7 @@ class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase
$this->middleware->__invoke( $this->middleware->__invoke(
$request->withoutHeader('Accept-Language'), $request->withoutHeader('Accept-Language'),
new Response(), new Response(),
function () { [$this, 'nothing']
}
); );
} }