From 5335eddb5f31d82366323403c4d7d8efe1cf8854 Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Tue, 24 Jan 2023 15:40:47 -0500 Subject: [PATCH] Add installation instructions and re-format readme (#5) --- README.md | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index beaf1cf..a9dcd46 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,21 @@ SCIM schema PHP library with support for both v1 and v2. [![License](https://img.shields.io/packagist/l/tmilos/scim-schema.svg)](https://packagist.org/packages/tmilos/scim-schema) [![Packagist Version](https://img.shields.io/packagist/v/tmilos/scim-schema.svg?style=flat-square)](https://packagist.org/packages/tmilos/scim-schema) +# Install -# Schema +Install Scim Schema using composer: -Build default schema +```bash +composer require tmilos/scim-schema +``` + +# Usage + +### Schema + +Build default schema: ```php -getGroup(); @@ -33,12 +41,13 @@ $serviceProviderConfigSchema = $schemaBuilder->getServiceProviderConfig(); $resourceTypeSchema = $schemaBuilder->getResourceType(); ``` -Or build your own custom schema +Or build your own custom schema: ```php -setName('CustomSchema); + +$schema->setName('CustomSchema'); + $schema->addAttribute( AttributeBuilder::create('name', ScimConstants::ATTRIBUTE_TYPE_STRING, 'Name of the object') ->setMutability(false) @@ -49,16 +58,14 @@ $schema->addAttribute( And serialize the scim schema object ```php -getUser(); + $schema->serializeObject(); ``` +### Schema validation - -# Schema validation - -An object can be validated against a schema +An object can be validated against a schema: ```php /** @var array $object */