Skip to content

cleanup, refactoring, splitted validators, tweaks - #3

Merged
justinrainbow merged 3 commits into
jsonrainbow:masterfrom
digitalkaoz:refactoring
Jan 3, 2012
Merged

cleanup, refactoring, splitted validators, tweaks#3
justinrainbow merged 3 commits into
jsonrainbow:masterfrom
digitalkaoz:refactoring

Conversation

@digitalkaoz

Copy link
Copy Markdown
Contributor

hey justin,

i refactored the whole library so its done in a cleaner way.
the main refactoring was the split of validators into separate smaller classes
they all use a common interface
all tests are still passing

Comment thread src/JsonSchema/Validator/Validator.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

return !$this->getErrors();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yap, fixed

@igorw

igorw commented Jan 2, 2012

Copy link
Copy Markdown
Contributor

It's a bit confusing to have JsonSchema\Validator and JsonSchema\Validator\Validator (I'm surprised this doesn't cause conflicts). I think it would make more sense to rename the latter to Constraint (or something else) everywhere.

@digitalkaoz

Copy link
Copy Markdown
Contributor Author

yeah i didnt found a better name, what about BaseValidator?

@digitalkaoz

Copy link
Copy Markdown
Contributor Author

renamed it to Constraint

@igorw

igorw commented Jan 2, 2012

Copy link
Copy Markdown
Contributor

👍

@justinrainbow

Copy link
Copy Markdown
Collaborator

Thanks @digitalkaoz - these changes look great

justinrainbow added a commit that referenced this pull request Jan 3, 2012
cleanup, refactoring, splitted validators, tweaks
@justinrainbow
justinrainbow merged commit 05ff6d8 into jsonrainbow:master Jan 3, 2012
@igorw

igorw commented Jan 3, 2012

Copy link
Copy Markdown
Contributor

You guys are fast! Great stuff! :)

Now we can add JSON-schema validation to composer!

erayd added a commit to erayd/json-schema that referenced this pull request Oct 5, 2017
DannyvdSluijs pushed a commit that referenced this pull request Jul 3, 2026
Trying to run composer in a PHP build without ext-filter fails with:

    Error: Call to undefined function JsonSchema\Uri\filter_var()
    Fatal error: Uncaught Error: Call to undefined function JsonSchema\Uri\filter_var() in phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php:84
    Stack trace:
    #0 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(100): JsonSchema\Uri\UriResolver->resolve('*redacted*...', 'internal://prov...')
    #1 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(76): JsonSchema\SchemaStorage->expandRefs(Object(stdClass), 'internal://prov...')
    #2 phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(67): JsonSchema\SchemaStorage->addSchema('internal://prov...', Object(stdClass))
    #3 phar:///*redacted*/bin/composer/src/Composer/Json/JsonFile.php(258): JsonSchema\Validator->validate(Object(stdClass), Object(stdClass))
    #4 phar:///*redacted*/bin/composer/src/Composer/Json/JsonFile.php(214): Composer\Json\JsonFile::validateJsonSchema('./composer.json', Object(stdClass), 1, '*redacted*...')
    #5 phar:///*redacted*/bin/composer/src/Composer/Factory.php(313): Composer\Json\JsonFile->validateSchema(1)
    #6 phar:///*redacted*/bin/composer/src/Composer/Factory.php(631): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), './composer.json', true, '*redacted*...', true, false)
    #7 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(629): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, true, false)
    #8 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(538): Composer\Console\Application->getComposer(false, true)
    #9 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(485): Composer\Console\Application->hintCommonErrors(Object(Error), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #10 phar:///*redacted*/bin/composer/vendor/symfony/console/Application.php(171): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #11 phar:///*redacted*/bin/composer/src/Composer/Console/Application.php(141): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #12 phar:///*redacted*/bin/composer/bin/composer(112): Composer\Console\Application->run()
    #13 /*redacted*/bin/composer(29): require('*redacted*...')
    #14 {main}
      thrown in phar:///*redacted*/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php on line 84
    Error: Process completed with exit code 255.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants