@@ -224,6 +224,9 @@ |
||
| 224 | 224 | return DatapackageValidator::validate($this->descriptor(), $this->basePath); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | + /** |
|
| 228 | + * @param string $profile |
|
| 229 | + */ |
|
| 227 | 230 | protected static function handlesProfile($profile) |
| 228 | 231 | { |
| 229 | 232 | return false; |
@@ -228,9 +228,9 @@ discard block |
||
| 228 | 228 | * allows extending classes to add custom sources |
| 229 | 229 | * used by unit tests to add a mock http source. |
| 230 | 230 | * |
| 231 | - * @param $source |
|
| 231 | + * @param string $source |
|
| 232 | 232 | * |
| 233 | - * @return mixed |
|
| 233 | + * @return string |
|
| 234 | 234 | */ |
| 235 | 235 | protected static function normalizeHttpSource($source) |
| 236 | 236 | { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | /** |
| 241 | 241 | * allows extending classes to add custom sources |
| 242 | 242 | * used by unit tests to add a mock http source. |
| 243 | - * @param $source |
|
| 243 | + * @param string $source |
|
| 244 | 244 | * @return bool |
| 245 | 245 | */ |
| 246 | 246 | protected static function isHttpSource($source) |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * - normalized basePath. |
| 256 | 256 | * |
| 257 | 257 | * @param $source |
| 258 | - * @param $basePath |
|
| 258 | + * @param null|string $basePath |
|
| 259 | 259 | * |
| 260 | 260 | * @return object |
| 261 | 261 | * |
@@ -330,16 +330,25 @@ discard block |
||
| 330 | 330 | return (object) ['descriptor' => $descriptor, 'basePath' => $basePath]; |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | + /** |
|
| 334 | + * @param string $source |
|
| 335 | + */ |
|
| 333 | 336 | protected static function isHttpZipSource($source) |
| 334 | 337 | { |
| 335 | 338 | return strtolower(substr($source, -4)) == '.zip'; |
| 336 | 339 | } |
| 337 | 340 | |
| 341 | + /** |
|
| 342 | + * @param string $source |
|
| 343 | + */ |
|
| 338 | 344 | protected static function isFileZipSource($source) |
| 339 | 345 | { |
| 340 | 346 | return strtolower(substr($source, -4)) == '.zip'; |
| 341 | 347 | } |
| 342 | 348 | |
| 349 | + /** |
|
| 350 | + * @param string $source |
|
| 351 | + */ |
|
| 343 | 352 | protected static function loadHttpZipSource($source) |
| 344 | 353 | { |
| 345 | 354 | print_r('calling loadHttpZipSource'); |
@@ -352,6 +361,9 @@ discard block |
||
| 352 | 361 | return self::loadFileZipSource($tempfile); |
| 353 | 362 | } |
| 354 | 363 | |
| 364 | + /** |
|
| 365 | + * @param string $source |
|
| 366 | + */ |
|
| 355 | 367 | protected static function loadFileZipSource($source) |
| 356 | 368 | { |
| 357 | 369 | $zip = new ZipArchive(); |
@@ -251,6 +251,9 @@ |
||
| 251 | 251 | |
| 252 | 252 | abstract protected function getInlineDataStream($data); |
| 253 | 253 | |
| 254 | + /** |
|
| 255 | + * @param string $profile |
|
| 256 | + */ |
|
| 254 | 257 | protected static function handlesProfile($profile) |
| 255 | 258 | { |
| 256 | 259 | return false; |
@@ -44,6 +44,9 @@ discard block |
||
| 44 | 44 | return $this->descriptor->profile; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | + /** |
|
| 48 | + * @param boolean|string $filename |
|
| 49 | + */ |
|
| 47 | 50 | protected function convertValidationSchemaFilenameToUrl($filename) |
| 48 | 51 | { |
| 49 | 52 | $filename = realpath($filename); |
@@ -124,6 +127,9 @@ discard block |
||
| 124 | 127 | $this->validateSchemaUrl($this->getValidationSchemaUrl()); |
| 125 | 128 | } |
| 126 | 129 | |
| 130 | + /** |
|
| 131 | + * @param string $url |
|
| 132 | + */ |
|
| 127 | 133 | protected function validateSchemaUrl($url) |
| 128 | 134 | { |
| 129 | 135 | $validator = new \JsonSchema\Validator(); |
@@ -143,7 +149,7 @@ discard block |
||
| 143 | 149 | * Add an error to the validator object - errors are aggregated and returned by validate function. |
| 144 | 150 | * |
| 145 | 151 | * @param int $code |
| 146 | - * @param null|mixed $extraDetails |
|
| 152 | + * @param string $extraDetails |
|
| 147 | 153 | */ |
| 148 | 154 | protected function addError($code, $extraDetails = null) |
| 149 | 155 | { |