Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Feb 7, 2023
2 parents fd2293e + eeecf2c commit 8968e0b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 92 deletions.
184 changes: 92 additions & 92 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,94 +1,94 @@
{
"name": "knuckleswtf/scribe",
"license": "MIT",
"description": "Generate API documentation for humans from your Laravel codebase.✍",
"keywords": [
"API",
"documentation",
"laravel",
"dingo"
],
"homepage": "http://github.com/knuckleswtf/scribe",
"authors": [
{
"name": "Shalvah"
}
],
"require": {
"php": ">=8.0",
"ext-fileinfo": "*",
"ext-json": "*",
"ext-pdo": "*",
"erusev/parsedown": "1.7.4",
"fakerphp/faker": "^1.9.1",
"illuminate/console": "^8.0|^9.0",
"illuminate/routing": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"league/flysystem": "^1.1.4|^2.1.1|^3.0",
"mpociot/reflection-docblock": "^1.0.1",
"nikic/php-parser": "^4.10",
"nunomaduro/collision": "^5.10|^6.0",
"ramsey/uuid": "^4.2.2",
"shalvah/clara": "^3.1.0",
"shalvah/upgrader": "^0.3.0",
"spatie/data-transfer-object": "^2.6|^3.0",
"symfony/var-exporter": "^5.4|^6.0",
"symfony/yaml": "^5.4|^6.0"
},
"require-dev": {
"brianium/paratest": "^6.0",
"dms/phpunit-arraysubset-asserts": "^0.2.0",
"laravel/legacy-factories": "^1.3.0",
"laravel/lumen-framework": "^8.0|^9.0",
"league/fractal": "^0.19.0",
"nikic/fast-route": "^1.3",
"orchestra/testbench": "^6.0|^7.0",
"pestphp/pest": "^1.21",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0|^10.0",
"symfony/css-selector": "^5.4|^6.0",
"symfony/dom-crawler": "^5.4|^6.0"
},
"autoload": {
"psr-4": {
"Knuckles\\Scribe\\": "src/",
"Knuckles\\Camel\\": "camel/"
}
},
"autoload-dev": {
"psr-4": {
"Knuckles\\Scribe\\Tests\\": "tests/"
}
},
"scripts": {
"lint": "phpstan analyse -c ./phpstan.neon src camel --memory-limit 1G",
"test": "pest --stop-on-failure --exclude-group dingo --coverage --colors",
"test-ci": "pest --exclude-group dingo --coverage --min=80",
"test-parallel": "paratest -p16 --stop-on-failure --exclude-group dingo",
"test-parallel-ci": "paratest -p16 --exclude-group dingo"
},
"extra": {
"laravel": {
"providers": [
"Knuckles\\Scribe\\ScribeServiceProvider"
]
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"process-timeout": 600,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"replace": {
"mpociot/laravel-apidoc-generator": "*"
},
"funding": [
{
"type": "patreon",
"url": "https://patreon.com/shalvah"
}
]
"name": "knuckleswtf/scribe",
"license": "MIT",
"description": "Generate API documentation for humans from your Laravel codebase.✍",
"keywords": [
"API",
"documentation",
"laravel",
"dingo"
],
"homepage": "http://github.com/knuckleswtf/scribe",
"authors": [
{
"name": "Shalvah"
}
],
"require": {
"php": ">=8.0",
"ext-fileinfo": "*",
"ext-json": "*",
"ext-pdo": "*",
"erusev/parsedown": "1.7.4",
"fakerphp/faker": "^1.9.1",
"illuminate/console": "^8.0|^9.0|^10.0",
"illuminate/routing": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0",
"league/flysystem": "^1.1.4|^2.1.1|^3.0",
"mpociot/reflection-docblock": "^1.0.1",
"nikic/php-parser": "^4.10",
"nunomaduro/collision": "^5.10|^6.0",
"ramsey/uuid": "^4.2.2",
"shalvah/clara": "^3.1.0",
"shalvah/upgrader": "^0.3.0",
"spatie/data-transfer-object": "^2.6|^3.0",
"symfony/var-exporter": "^5.4|^6.0",
"symfony/yaml": "^5.4|^6.0"
},
"require-dev": {
"brianium/paratest": "^6.0",
"dms/phpunit-arraysubset-asserts": "^0.4",
"laravel/legacy-factories": "^1.3.0",
"laravel/lumen-framework": "^8.0|^9.0",
"league/fractal": "^0.20",
"nikic/fast-route": "^1.3",
"orchestra/testbench": "^6.0|^7.0|^8.0",
"pestphp/pest": "^1.21",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0|^10.0",
"symfony/css-selector": "^5.4|^6.0",
"symfony/dom-crawler": "^5.4|^6.0"
},
"autoload": {
"psr-4": {
"Knuckles\\Scribe\\": "src/",
"Knuckles\\Camel\\": "camel/"
}
},
"autoload-dev": {
"psr-4": {
"Knuckles\\Scribe\\Tests\\": "tests/"
}
},
"scripts": {
"lint": "phpstan analyse -c ./phpstan.neon src camel --memory-limit 1G",
"test": "pest --stop-on-failure --exclude-group dingo --coverage --colors",
"test-ci": "pest --exclude-group dingo --coverage --min=80",
"test-parallel": "paratest -p16 --stop-on-failure --exclude-group dingo",
"test-parallel-ci": "paratest -p16 --exclude-group dingo"
},
"extra": {
"laravel": {
"providers": [
"Knuckles\\Scribe\\ScribeServiceProvider"
]
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"process-timeout": 600,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"replace": {
"mpociot/laravel-apidoc-generator": "*"
},
"funding": [
{
"type": "patreon",
"url": "https://patreon.com/shalvah"
}
]
}
4 changes: 4 additions & 0 deletions src/Extracting/ParsesValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ protected function addMissingParentFields(array $parameters): array
$parentPath = substr($parentPath, 0, -2);
$normalisedParentPath = str_replace('.*.', '[].', $parentPath);

if (!empty($results[$normalisedParentPath])) {
break;
}

$type = 'object[]';
$example = [[]];
} else {
Expand Down
13 changes: 13 additions & 0 deletions tests/Unit/ValidationRuleParsingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,19 @@ public static function supportedRules()
];
}
}

/** @test */
public function child_does_not_overwrite_parent_status()
{
$ruleset = [
'array_param' => 'array|required',
'array_param.*' => 'array|required',
'array_param.*.an_item' => 'string|required',
];
$results = $this->strategy->parse($ruleset);
$this->assertCount(2, $results);
$this->assertEquals(true, $results['array_param']['required']);
}
}

class DummyValidationRule implements \Illuminate\Contracts\Validation\Rule
Expand Down

0 comments on commit 8968e0b

Please sign in to comment.