https://github.com/dczajkowski/colloquy
This repo contains @gtluszcz, @kerni08, @heartistizio and my project for Design Patterns classes at the AGH university
https://github.com/dczajkowski/colloquy
Last synced: 11 months ago
JSON representation
This repo contains @gtluszcz, @kerni08, @heartistizio and my project for Design Patterns classes at the AGH university
- Host: GitHub
- URL: https://github.com/dczajkowski/colloquy
- Owner: DCzajkowski
- License: mit
- Created: 2018-10-18T12:42:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-26T12:16:17.000Z (over 3 years ago)
- Last Synced: 2025-02-10T15:51:07.291Z (11 months ago)
- Language: PHP
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

A framework-agnostic package for managing persistent conversation contexts.
# Installation
```bash
composer install dczajkowski/colloquy
```
# Usage
## Using in auto-mode with annotations
**Identifier resolver declaration**
```php
user = new \App\Models\User;
}
private function step2()
{
$this->user->name = 'John';
}
/** @ColloquyEnd */
private function step3()
{
echo $this->user->name; // John
}
}
```
## Manual Use
```php
name = $name;
}
}
/** Starting a Conversation */
$wrapper = new Colloquy(new FileDriver('storage'));
$homeContext = $wrapper->context('Home');
$formContext = $wrapper->context('Form');
/** Primitive types */
$homeContext->add('Joe', 'name');
$homeContext->add('ilovecats', 'password');
$formContext->add('Jane', 'name');
$name = $homeContext->get('name'); // Joe
$homeContext->set('John', 'name');
$name = $homeContext->get('name'); // John
/** Objects */
$user = new User('Jack');
$homeContext->add($user, 'user');
var_dump($user); // User { name: "Jack" }
$user = $homeContext->get('user');
var_dump($user); // User { name: "Jack" }
/** Ending a Conversation */
$wrapper->end('Form');
$wrapper->end('Home');
```
# Contribution
Contributions are very welcome. If you want, just drop a PR with any feature you'd like to see.
# Authors
The library was made by [Dariusz Czajkowski](https://dczajkowski.com), Grzegorz Tłuszcz, Aleksander Kuźma, Karol Piwnicki.
# License
The Colloquy package is open-sourced software licensed under the MIT license.


