Skip to content

Commit

Permalink
Updated changelog + PSR2 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bfanger committed May 12, 2017
1 parent 0a828d4 commit 2f2482f
Show file tree
Hide file tree
Showing 21 changed files with 8 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## 2.0.10
- Fix errors when parsing php7 anonymous class #380
- Fix errors when parsing php7 anonymous class #380, #390
- Added support for linked files and directories #393
- Added support for $ref in deserialize() #369
- Misc documentation tweaks.
Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/AbstractAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function validate($parents = [], $skip = [])
$keyField = $nested[1];
foreach ($this->$property as $key => $item) {
if (is_array($item) && is_numeric($key) === false) {
Logger::notice($this->identity() . '->' . $property . ' is set to an object, use nested @' . str_replace('Swagger\\Annotations\\', 'SWG\\', $annotationClass) . ' annotation(s) in ' . $this->_context);
Logger::notice($this->identity() . '->' . $property . ' is an object literal, use nested @' . str_replace('Swagger\\Annotations\\', 'SWG\\', $annotationClass) . '() annotation(s) in ' . $this->_context);
$keys[$key] = $item;
} elseif (empty($item->$keyField)) {
Logger::notice($item->identity() . ' is missing key-field: "' . $keyField . '" in ' . $item->_context);
Expand Down
6 changes: 3 additions & 3 deletions src/Processors/HandleReferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private function mapReferences()

if (!isset($item->ref)) {
$this->head_references[$import_name][] = &$data;
} else if ($this->checkSyntax($item->ref)) {
} elseif ($this->checkSyntax($item->ref)) {
$params = explode("/", $item->ref);

$this->loadParent($data, strtolower($params[1]), $params[2]);
Expand Down Expand Up @@ -261,10 +261,10 @@ private function iterateQueue(&$queue, $current_key)
}
$this->importSchema($value, $response->schema);
}
} else if ($key != "response") {
} elseif ($key != "response") {
if (is_array($value)) {
$response->$key = array_merge($response->$key?: [], $parent_response->$key);
} else if (!isset($response->$key) && $key != $current_key) {
} elseif (!isset($response->$key) && $key != $current_key) {
$response->$key = $parent_response->$key;
}
}
Expand Down
1 change: 0 additions & 1 deletion tests/AbstractAnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class AbstractAnnotationTest extends SwaggerTestCase
{

public function testVendorFields()
{
$annotations = $this->parseComment('@SWG\Get(x={"internal-id": 123})');
Expand Down
1 change: 0 additions & 1 deletion tests/AnalyserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class AnalyserTest extends SwaggerTestCase
{

public function testParseContents()
{
$annotations = $this->parseComment('@SWG\Parameter(description="This is my parameter")');
Expand Down
1 change: 0 additions & 1 deletion tests/AnalysisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class AnalysisTest extends SwaggerTestCase
{

public function testRegisterProcessor()
{
$counter = 0;
Expand Down
1 change: 0 additions & 1 deletion tests/AugmentDefinitionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class AugmentDefinitionsTest extends SwaggerTestCase
{

public function testAugmentDefinitions()
{
$analyser = new StaticAnalyser();
Expand Down
1 change: 0 additions & 1 deletion tests/AugmentOperationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class AugmentOperationTest extends SwaggerTestCase
{

public function testAugmentOperation()
{
$analyser = new StaticAnalyser();
Expand Down
1 change: 0 additions & 1 deletion tests/AugmentParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class AugmentParameterTest extends SwaggerTestCase
{

public function testAugmentParameter()
{
$swagger = \Swagger\scan(__DIR__ . '/Fixtures/UsingRefs.php');
Expand Down
1 change: 0 additions & 1 deletion tests/AugmentPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class AugmentPropertiesTest extends SwaggerTestCase
{

public function testAugmentProperties()
{
$analyser = new StaticAnalyser();
Expand Down
1 change: 0 additions & 1 deletion tests/BuildPathsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

class BuildPathsTest extends SwaggerTestCase
{

public function testMergePathsWithSamePath()
{
$swagger = new Swagger([]);
Expand Down
1 change: 0 additions & 1 deletion tests/CleanUnmergedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class CleanUnmergedTest extends SwaggerTestCase
{

public function testCleanUnmergedProcessor()
{
$comment = <<<END
Expand Down
1 change: 0 additions & 1 deletion tests/CommandlineInterfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class CommandlineInterfaceTest extends SwaggerTestCase
{

protected function setUp()
{
if (defined('HHVM_VERSION')) {
Expand Down
1 change: 0 additions & 1 deletion tests/ContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class ContextTest extends SwaggerTestCase
{

public function testDetect()
{
$context = Context::detect();
Expand Down
9 changes: 3 additions & 6 deletions tests/Fixtures/php7.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace SwaggerFixures;

$o = new class
{
$o = new class {
public function foo()
{
}
};

$o = new class extends stdClass
{
$o = new class extends stdClass {
};

$o = new class implements foo
{
$o = new class implements foo {
};
1 change: 0 additions & 1 deletion tests/InheritPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

class InheritPropertiesTest extends SwaggerTestCase
{

public function testInheritProperties()
{
$analyser = new StaticAnalyser();
Expand Down
1 change: 0 additions & 1 deletion tests/ItemsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class ItemsTest extends SwaggerTestCase
{

public function testTypeArray()
{
$annotations = $this->parseComment('@SWG\Items(type="array")');
Expand Down
1 change: 0 additions & 1 deletion tests/MergeIntoSwaggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class MergeIntoSwaggerTest extends SwaggerTestCase
{

public function testProcessor()
{
$swagger = new Swagger([]);
Expand Down
1 change: 0 additions & 1 deletion tests/NestedPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class NestedPropertyTest extends SwaggerTestCase
{

public function testNestedProperties()
{
$analyser = new StaticAnalyser();
Expand Down
1 change: 0 additions & 1 deletion tests/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class ResponseTest extends SwaggerTestCase
{

public function testMisspelledDefault()
{
$annotations = $this->parseComment('@SWG\Get(@SWG\Response(response="Default", description="description"))');
Expand Down
1 change: 0 additions & 1 deletion tests/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class UtilTest extends SwaggerTestCase
{

public function testExclude()
{
$swagger = \Swagger\scan(__DIR__ . '/Fixtures', ['exclude' => ['Customer.php', 'UsingRefs.php', 'UsingPhpDoc.php', 'GrandAncestor.php']]);
Expand Down

0 comments on commit 2f2482f

Please sign in to comment.