Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e2914b4

Browse filesBrowse files
committed
Merge pull request symfony#70 from stof/validate_package_consistency
Add a consistency validation for the composer reference
2 parents 1eed792 + 790df5e commit e2914b4
Copy full SHA for e2914b4

File tree

4 files changed

+12
-4
lines changed
Filter options

4 files changed

+12
-4
lines changed
File renamed without changes.

‎validator.php

Copy file name to clipboardExpand all lines: validator.php
+11-3Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
continue;
4040
}
4141

42-
$path = str_replace(__DIR__.'/', '', $file->getPathname());
42+
$path = str_replace(__DIR__.DIRECTORY_SEPARATOR, '', $file->getPathname());
4343

4444
if ('yaml' !== $file->getExtension()) {
4545
$messages[$path][] = 'The file extension should be ".yaml".';
@@ -63,8 +63,16 @@
6363
}
6464
}
6565

66-
if (isset($data['reference']) && 0 !== strpos($data['reference'], 'composer://')) {
67-
$messages[$path][] = 'Reference must start with "composer://"';
66+
if (isset($data['reference'])) {
67+
if (0 !== strpos($data['reference'], 'composer://')) {
68+
$messages[$path][] = 'Reference must start with "composer://"';
69+
} else {
70+
$composerPackage = substr($data['reference'], 11);
71+
72+
if (str_replace(DIRECTORY_SEPARATOR, '/', dirname($path)) !== $composerPackage) {
73+
$messages[$path][] = 'Reference composer package must match the folder name';
74+
}
75+
}
6876
}
6977

7078
if (!isset($data['branches'])) {

‎zendframework/zend-validator/ZF2015-03.yaml

Copy file name to clipboardExpand all lines: zendframework/zend-validator/ZF2015-03.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ branches:
55
2.3.x:
66
time: 2015-03-12 13:58:47
77
versions: [>=2.3.0,<2.3.6]
8-
reference: composer://zendframework/validator
8+
reference: composer://zendframework/zend-validator

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.