Composer > meritoo/common-library package > use latest version

This commit is contained in:
Meritoo
2018-09-06 23:35:08 +02:00
parent 525391083a
commit 2c89bbe5f5
8 changed files with 18 additions and 12 deletions

View File

@@ -12,7 +12,7 @@
"require": { "require": {
"php": ">=5.6", "php": ">=5.6",
"fguillot/json-rpc": "^1.2", "fguillot/json-rpc": "^1.2",
"meritoo/common-library": "~0.0.1" "meritoo/common-library": "^0.1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7", "phpunit/phpunit": "^5.7",

View File

@@ -18,7 +18,7 @@ abstract class BaseParticipantsCollection extends Collection
*/ */
public function add($element, $index = null) public function add($element, $index = null)
{ {
throw new DisabledMethodException(__METHOD__, 'addParticipant'); throw DisabledMethodException::create(__METHOD__, 'addParticipant');
} }
/** /**
@@ -26,7 +26,7 @@ abstract class BaseParticipantsCollection extends Collection
*/ */
public function addMultiple($elements, $useIndexes = false) public function addMultiple($elements, $useIndexes = false)
{ {
throw new DisabledMethodException(__METHOD__, 'addParticipants'); throw DisabledMethodException::create(__METHOD__, 'addParticipants');
} }
/** /**
@@ -34,7 +34,7 @@ abstract class BaseParticipantsCollection extends Collection
*/ */
public function has($element) public function has($element)
{ {
throw new DisabledMethodException(__METHOD__, 'hasParticipantsOfSurvey'); throw DisabledMethodException::create(__METHOD__, 'hasParticipantsOfSurvey');
} }
/** /**

View File

@@ -20,10 +20,16 @@ use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
class UnknownMethodException extends UnknownTypeException class UnknownMethodException extends UnknownTypeException
{ {
/** /**
* {@inheritdoc} * Creates exception
*
* @param string $unknownMethod Name of unknown method used while talking to the LimeSurvey's API
* @return UnknownMethodException
*/ */
public function __construct($unknownType) public static function createException($unknownMethod)
{ {
parent::__construct($unknownType, new MethodType(), 'name of method used while talking to the LimeSurvey\'s API'); /* @var UnknownMethodException $exception */
$exception = parent::create($unknownMethod, new MethodType(), 'name of method used while talking to the LimeSurvey\'s API');
return $exception;
} }
} }

View File

@@ -25,7 +25,7 @@ class SurveysSummaries extends Collection
*/ */
public function add($element, $index = null) public function add($element, $index = null)
{ {
throw new DisabledMethodException(__METHOD__, 'addSurveySummary'); throw DisabledMethodException::create(__METHOD__, 'addSurveySummary');
} }
/** /**
@@ -33,7 +33,7 @@ class SurveysSummaries extends Collection
*/ */
public function addMultiple($elements, $useIndexes = false) public function addMultiple($elements, $useIndexes = false)
{ {
throw new DisabledMethodException(__METHOD__, 'addSurveysSummaries'); throw DisabledMethodException::create(__METHOD__, 'addSurveysSummaries');
} }
/** /**
@@ -41,7 +41,7 @@ class SurveysSummaries extends Collection
*/ */
public function has($element) public function has($element)
{ {
throw new DisabledMethodException(__METHOD__, 'hasSurveySummary'); throw DisabledMethodException::create(__METHOD__, 'hasSurveySummary');
} }
/** /**

View File

@@ -24,7 +24,7 @@ class UnknownMethodExceptionTest extends BaseTestCase
{ {
public function testConstructorVisibilityAndArguments() public function testConstructorVisibilityAndArguments()
{ {
static::assertConstructorVisibilityAndArguments(UnknownMethodException::class, OopVisibilityType::IS_PUBLIC, 1, 1); static::assertConstructorVisibilityAndArguments(UnknownMethodException::class, OopVisibilityType::IS_PUBLIC, 3);
} }
/** /**
@@ -35,7 +35,7 @@ class UnknownMethodExceptionTest extends BaseTestCase
*/ */
public function testConstructorMessage($unknownType, $expectedMessage) public function testConstructorMessage($unknownType, $expectedMessage)
{ {
$exception = new UnknownMethodException($unknownType); $exception = UnknownMethodException::createException($unknownType);
static::assertEquals($expectedMessage, $exception->getMessage()); static::assertEquals($expectedMessage, $exception->getMessage());
} }

0
tests/Resources/var/cache/.gitkeep vendored Normal file
View File

View File

View File