{"id":21189034,"url":"https://github.com/sackrin/fission","last_synced_at":"2025-03-14T20:41:59.213Z","repository":{"id":62539109,"uuid":"122849900","full_name":"sackrin/fission","owner":"sackrin","description":"Fission aims to provide an easy to understand set of concepts and tools for handling the creation and manipulation of nested array data which can be built into any framework. These tools include object schema building, value sanitization, value validation, value manipulation and, most importantly, role and scope based property access control.","archived":false,"fork":false,"pushed_at":"2018-04-07T08:32:02.000Z","size":179,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T13:23:26.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sackrin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-25T15:43:41.000Z","updated_at":"2019-02-18T02:24:49.000Z","dependencies_parsed_at":"2022-11-02T16:16:02.384Z","dependency_job_id":null,"html_url":"https://github.com/sackrin/fission","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sackrin%2Ffission","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sackrin%2Ffission/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sackrin%2Ffission/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sackrin%2Ffission/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sackrin","download_url":"https://codeload.github.com/sackrin/fission/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243646524,"owners_count":20324582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T18:49:36.474Z","updated_at":"2025-03-14T20:41:59.187Z","avatar_url":"https://github.com/sackrin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fission PHP Object Schema\n\nA simple to use and extendable php object schema library\n\n\u003cp\u003e\n\u003ca href=\"https://packagist.org/packages/sackrin/fission\"\u003e\u003cimg src=\"https://poser.pugx.org/sackrin/fission/v/stable.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/sackrin/fission\"\u003e\u003cimg src=\"https://poser.pugx.org/sackrin/fission/license.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://travis-ci.org/sackrin/fission.svg?branch=master\" alt=\"Build Status\"\u003e\n\u003c/p\u003e\n\nAdd to your project using composer\n\n## Installation\n\nVia composer:\n\n``\ncomposer require sackrin/fission\n``\n\n## Example Simple Usage\n\n```php\n// Create a new Atom instance\n// This will hold the object schema\n$atom = Atom::create('person');\n\n// Create some fields to be added to the schema\n// These are called nucleus and describe schema properties\n$nuclei = [\n    Nucleus::create('first_name')\n        -\u003etype(Type::string())\n        -\u003elabel('First Name')\n        -\u003epolicies([\n            Deny::for(\"*\")-\u003escope(\"*\"),\n            Allow::for([\"administrator\",\"owner\"])-\u003escope([\"r\",\"w\"]),\n            Allow::for(\"user\")-\u003escope([\"r\"])\n        ])\n        -\u003esanitizers([\n            GUMPSanitizer::using(\"trim|sanitize_string\")\n        ])\n        -\u003evalidators([\n            GUMPValidator::against(\"required|min_len,5\")\n        ])\n];\n\n// Inject the nucleus instances into the atom\n// The collective of nucleus is nuclei (just fyi)\n$atom-\u003enuclei($nuclei);\n\n// The reactor instance is used to react the atom schema with the nuclei against data\n// This is where you will get a hydrated object tree of data\n$reactor = Reactor::using($atom)\n    -\u003eroles(['user'])\n    -\u003escope(['w','r']);\n\n// Reactors will output a tree of isotopes using the with method\n// Isotopes are the hydrated form of a nucleus instance and contain values\n// Sanitization, Validation and Policy rules are applied to isotopes\n// Press is a util class used to combine and supply data to the reactor instance\n// You can just use a standard array if you like\n$isotopes = $reactor-\u003ewith(Press::values([\n    'first_name' =\u003e ' John '\n]));\n\n// Pass the isotope through the validator\n$validator = Validator::validate($isotopes);\n\n// Check if the validator has detected any errors\nif ($validator-\u003ehasErrors()) {\n    echo \"Oh No, Failed Validation!\";\n    $errors = $validator-\u003eerrors();\n    var_dump($errors);\n} // Otherwise if the validator passed \nelse {\n    // Using the Values walker you can scrape the data from the isotope tree\n    // This will output a simple array tree representing the processed data\n    $values = Values::gather($isotopes)-\u003eall();\n    echo \"Everything Validated!\";\n    $values = Values::gather($isotopes)-\u003eall();\n    var_dump($values);\n}\n\n```\n\n## More Examples\n\nRefer to the [examples](examples/) folder for how to use fission","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsackrin%2Ffission","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsackrin%2Ffission","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsackrin%2Ffission/lists"}