createForExpectedConfigurationStringValue() public static method

public static createForExpectedConfigurationStringValue ( $value ) : InvalidArgumentException
return InvalidArgumentException
コード例 #1
0
 public function testTestCreateForExpectedConfigurationStringValue()
 {
     $exception = InvalidArgumentExceptionFactory::createForExpectedConfigurationStringValue(10);
     $this->assertEquals('Expected a string value but got "integer" instead.', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
コード例 #2
0
ファイル: Configuration.php プロジェクト: nelmio/alice
 private function createStringValidatorClosure() : \Closure
 {
     return function ($value) {
         if (is_string($value)) {
             return $value;
         }
         throw InvalidArgumentExceptionFactory::createForExpectedConfigurationStringValue($value);
     };
 }