Skip to content

Commit

Permalink
Add installation instructions and re-format readme (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman authored Jan 24, 2023
1 parent 31bed7f commit 5335edd
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<?php
$schemaBuilder = new SchemaBuilderV2(); // or SchemaBuilderV1

$groupSchema = $schemaBuilder->getGroup();
Expand All @@ -33,12 +41,13 @@ $serviceProviderConfigSchema = $schemaBuilder->getServiceProviderConfig();
$resourceTypeSchema = $schemaBuilder->getResourceType();
```

Or build your own custom schema
Or build your own custom schema:

```php
<?php
$schema = new Schema();
$schema->setName('CustomSchema);

$schema->setName('CustomSchema');

$schema->addAttribute(
AttributeBuilder::create('name', ScimConstants::ATTRIBUTE_TYPE_STRING, 'Name of the object')
->setMutability(false)
Expand All @@ -49,16 +58,14 @@ $schema->addAttribute(
And serialize the scim schema object

```php
<?php
$schema = (new SchemaBuilderV2())->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 */
Expand Down

0 comments on commit 5335edd

Please sign in to comment.