Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[JsonPath] Add the component #59655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"symfony/http-foundation": "self.version",
"symfony/http-kernel": "self.version",
"symfony/intl": "self.version",
"symfony/json-path": "self.version",
"symfony/json-streamer": "self.version",
"symfony/ldap": "self.version",
"symfony/lock": "self.version",
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/JsonPath/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.git* export-ignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Symfony/Component/JsonPath/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor/
composer.lock
phpunit.xml
7 changes: 7 additions & 0 deletions src/Symfony/Component/JsonPath/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CHANGELOG
=========

7.3
---

* Add the component as experimental
21 changes: 21 additions & 0 deletions src/Symfony/Component/JsonPath/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\JsonPath\Exception;

/**
* @author Alexandre Daubois <[email protected]>
*
* @experimental
*/
interface ExceptionInterface extends \Throwable
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\JsonPath\Exception;

/**
* @author Alexandre Daubois <[email protected]>
*
* @experimental
*/
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\JsonPath\Exception;

/**
* @author Alexandre Daubois <[email protected]>
*
* @experimental
*/
class InvalidJsonPathException extends \LogicException implements ExceptionInterface
{
public function __construct(string $message, ?int $position = null)
{
parent::__construct(\sprintf('JSONPath syntax error%s: %s', $position ? ' at position '.$position : '', $message));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\JsonPath\Exception;

/**
* Thrown when a string passed as an input is not a valid JSON string, e.g. in {@see JsonCrawler}.
*
* @author Alexandre Daubois <[email protected]>
*
* @experimental
*/
class InvalidJsonStringInputException extends InvalidArgumentException
{
public function __construct(string $message, ?\Throwable $previous = null)
{
parent::__construct(\sprintf('Invalid JSON input: %s.', $message), previous: $previous);
}
}
25 changes: 25 additions & 0 deletions src/Symfony/Component/JsonPath/Exception/JsonCrawlerException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\JsonPath\Exception;

/**
* @author Alexandre Daubois <[email protected]>
*
* @experimental
*/
class JsonCrawlerException extends \RuntimeException implements ExceptionInterface
{
public function __construct(string $path, string $message, ?\Throwable $previous = null)
{
parent::__construct(\sprintf('Error while crawling JSON with JSON path "%s": %s.', $path, $message), previous: $previous);
}
}
Loading
Loading