orisai / data-sources
Load and save data from and to various data formats
Installs: 22 878
Dependents: 4
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: 7.4 - 8.3
- nette/utils: ^3.0.0|^4.0.0
- orisai/exceptions: ^1.1.0
- orisai/utils: ^1.0.0
- symfony/polyfill-php80: ^1.20.0
Requires (Dev)
- ext-json: *
- brianium/paratest: ^6.3.0
- composer/semver: ^3.3
- infection/infection: ^0.26.0|^0.27.0|^0.28.0|^0.29.0
- nette/neon: ^3.3.3
- orisai/coding-standard: ^3.0.0
- phpstan/extension-installer: ^1.0.0
- phpstan/phpstan: ^1.0.0
- phpstan/phpstan-deprecation-rules: ^1.0.0
- phpstan/phpstan-nette: ^1.0.0
- phpstan/phpstan-phpunit: ^1.0.0
- phpstan/phpstan-strict-rules: ^1.0.0
- phpunit/phpunit: ^9.5.0
- staabm/annotate-pull-request-from-checkstyle: ^1.7.0
- symfony/yaml: ^5.2.9|^6.0.0|^7.0.0
README
Data Sources
Load and save data from and to various data formats
📄 Check out our documentation.
💸 If you like Orisai, please make a donation. Thank you!
use Orisai\DataSources\DataSource; use Orisai\DataSources\Exception\EncodingFailure; use Orisai\DataSources\Exception\NotSupportedType; try { $dataSource->encode('data', 'application/json' /* or just 'json' */); // json-encoded string } catch (NotSupportedType $exception) { // Requested type is not supported $exception->getRequestedType(); // 'application/json' $exception->getSupportedTypes(); // content types or file extensions, depending on what was requested } catch (EncodingFailure $exception) { // Encoding failed }