Skip to content

Commit

Permalink
Fixed creation issues with schema types
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed May 9, 2015
1 parent ba71e55 commit bd17977
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/Swagger2/Schema/ByteSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class ByteSchema extends StringSchema
{
/**
* @param string $format
* @return $this
*/
public static function create()
public static function create($format = "byte")
{
return new self();
return new self($format);
}

public function __construct()
Expand Down
5 changes: 3 additions & 2 deletions src/Swagger2/Schema/DateSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class DateSchema extends StringSchema
{
/**
* @param string $format
* @return $this
*/
public static function create()
public static function create($format = "date")
{
return new self();
return new self($format);
}

public function __construct()
Expand Down
5 changes: 3 additions & 2 deletions src/Swagger2/Schema/DateTimeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class DateTimeSchema extends StringSchema
{
/**
* @param string $format
* @return $this
*/
public static function create()
public static function create($format = "date-time")
{
return new self();
return new self($format);
}

public function __construct()
Expand Down
5 changes: 3 additions & 2 deletions src/Swagger2/Schema/DoubleSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class DoubleSchema extends NumberSchema
{
/**
* @param string $format
* @return $this
*/
public static function create()
public static function create($format = "double")
{
return new self();
return new self($format);
}

public function __construct()
Expand Down
5 changes: 3 additions & 2 deletions src/Swagger2/Schema/FloatSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class FloatSchema extends NumberSchema
{
/**
* @param string $format
* @return $this
*/
public static function create()
public static function create($format = "float")
{
return new self();
return new self($format);
}

public function __construct()
Expand Down
5 changes: 3 additions & 2 deletions src/Swagger2/Schema/LongSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
class LongSchema extends IntegerSchema
{
/**
* @param string $format
* @return $this
*/
public static function create()
public static function create($format = "int64")
{
return new self();
return new self($format);
}

public function __construct()
Expand Down
1 change: 0 additions & 1 deletion src/Swagger2/Schema/StringSchema.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace WoohooLabs\SpecGenerator\Swagger2\Schema;


class StringSchema extends AbstractExtendedSchema
{
use StringSchemaTrait;
Expand Down

0 comments on commit bd17977

Please sign in to comment.