mirror of
https://github.com/cachethq/cachet.git
synced 2026-03-05 19:37:01 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e5e8b1545 | ||
|
|
7e556d5dba | ||
|
|
331e176fbc | ||
|
|
bde0abe472 | ||
|
|
f2bf2eff68 | ||
|
|
50ab96fc4f | ||
|
|
3cbee1302e |
@@ -10,6 +10,3 @@ insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{*.json,*.yml}]
|
||||
indent_size = 2
|
||||
|
||||
20
.env.example
20
.env.example
@@ -1,13 +1,10 @@
|
||||
APP_ENV=production
|
||||
APP_DEBUG=false
|
||||
APP_URL=http://localhost
|
||||
APP_TIMEZONE=UTC
|
||||
APP_KEY=
|
||||
DEBUGBAR_ENABLED=false
|
||||
APP_KEY=SomeRandomString
|
||||
|
||||
DB_DRIVER=mysql
|
||||
DB_HOST=localhost
|
||||
DB_UNIX_SOCKET=null
|
||||
DB_DATABASE=cachet
|
||||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=secret
|
||||
@@ -17,14 +14,11 @@ DB_PREFIX=null
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
CACHET_BEACON=true
|
||||
CACHET_EMOJI=false
|
||||
CACHET_AUTO_TWITTER=true
|
||||
|
||||
MAIL_DRIVER=log
|
||||
MAIL_HOST=null
|
||||
MAIL_PORT=null
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ADDRESS=null
|
||||
@@ -36,9 +30,3 @@ REDIS_DATABASE=null
|
||||
REDIS_PORT=null
|
||||
|
||||
GITHUB_TOKEN=null
|
||||
|
||||
NEXMO_KEY=null
|
||||
NEXMO_SECRET=null
|
||||
NEXMO_SMS_FROM=Cachet
|
||||
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
46
.github/CODE_OF_CONDUCT.md
vendored
46
.github/CODE_OF_CONDUCT.md
vendored
@@ -1,46 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at james@alt-three.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
94
.github/CONTRIBUTING.md
vendored
94
.github/CONTRIBUTING.md
vendored
@@ -1,94 +0,0 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
## Thank you
|
||||
|
||||
Firstly, thank you for taking an interest in Cachet and for reading this guide.
|
||||
|
||||
## Creating issues
|
||||
|
||||
We track feature requests and bug reports on the [issue tracker](https://github.com/cachethq/Cachet/issues). Please send support requests to our support email; [support@alt-three.com](mailto:support@alt-three.com?subject=Cachet%20Support).
|
||||
|
||||
**Always be respectful.** Organisation members reserve the right to lock topics if they feel necessary.
|
||||
|
||||
## Languages
|
||||
|
||||
This project accepts **English translations** only. Translations will be updated automatically through the [CrowdIn](https://translate.cachethq.io) integration.
|
||||
|
||||
Please submit alternative translations to the [Cachet CrowdIn](https://translate.cachethq.io) project. CrowdIn will automatically send a Pull Request with your updates in.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
Please try to follow existing coding standards. [StyleCI](https://styleci.io) will analyse and fix any discrepancies in coding standards.
|
||||
|
||||
## Introduction into Git and GitHub
|
||||
|
||||
If you are new to Git, GitHub and the whole open source software community, welcome! Here are some resources for getting started and understanding what it's all about.
|
||||
|
||||
- [Try Git](https://try.github.io/levels/1/challenges/1) by Code School
|
||||
- [GitHub Help](https://help.github.com)
|
||||
|
||||
If you're not fond of the command line, you can get one of GitHub's free GUI desktop apps:
|
||||
|
||||
- [GitHub for Mac](https://github.com/blog/1510-installing-git-from-github-for-mac)
|
||||
- [GitHub for Windows](https://github.com/blog/1127-github-for-windows)
|
||||
|
||||
If you're feeling adventurous, you can become a Git & GitHub master with the [Git Path on Code School](https://www.codeschool.com/paths/git).
|
||||
|
||||
## .editorconfig
|
||||
|
||||
You should also make use of the [.editorconfig](/.editorconfig) file found within the root of the repository. It'll make sure that your editor is setup with the same file settings.
|
||||
|
||||
## Ways to help:
|
||||
|
||||
Start by becoming familiar with Cachet. If you're already using Cachet, that's a great head start. If not, check out the latest [demo](https://dev.cachethq.io) and have a play. You can also download and install Cachet locally to familiarise yourself that way.
|
||||
|
||||
You don't have to be a developer to help improve Cachet, infact there are lots of ways that you can help us.
|
||||
|
||||
### Spread the word
|
||||
|
||||
There are a lot of people who don't know about Cachet or what a status page is and how important it can be. [Tweet about Cachet](https://twitter.com/CachetHQ). Write blog posts about your success (or failures, we're not perfect) with Cachet and share what you took away from it.
|
||||
|
||||
### Help with Documentation
|
||||
|
||||
Cachet is in use around the world. Cachet speaks multiple languages. Our documentation doesn't and can be hard to understand for non-English speaking people. Documentation should be easy to understand and we need your help to make this possible. Check out [CachetHQ/Docs](https://github.com/CachetHQ/Docs) to contribute to our documentation.
|
||||
|
||||
### As a non-developer/non-designer
|
||||
|
||||
We're always looking for new [translations](#translations).
|
||||
|
||||
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always appreciated.
|
||||
|
||||
### As a designer
|
||||
|
||||
As Cachet gains new features, the design and ideas that were once a perfect fit need updating and in some cases designing from scratch. This is where you come in! Fancy giving Cachet a lick of paint? Sweet!
|
||||
|
||||
You'll need to install Node.js with NPM or Yarn.
|
||||
|
||||
To get started you can do the following:
|
||||
|
||||
1. Install Node.js and our dev dependencies.
|
||||
2. Run `npm run dev`
|
||||
3. Make your changes to the SCSS files in `./resources/assets/sass/`
|
||||
|
||||
If you're making a lot of changes, you'll find that running `npm run watch` will make life easier for you!
|
||||
|
||||
When you're happy with your changes, please run `npm run prod` to minify the assets.
|
||||
|
||||
### As a developer
|
||||
|
||||
Built using [Laravel](https://laravel.com).
|
||||
|
||||
We use these extra dependencies to develop Cachet:
|
||||
|
||||
- Node.js
|
||||
- NPM or Yarn
|
||||
- Composer
|
||||
- Git
|
||||
|
||||
Once cloned to your local machine, you'll need some demo data! Run `php artisan cachet:seed` to get the demo installation ready for action.
|
||||
|
||||
### #YOLO JUST SUBMIT A PR
|
||||
|
||||
_A great idea taken from https://github.com/metabase/metabase/blob/master/docs/contributing.md#yolo-just-submit-a-pr._
|
||||
|
||||
> If you come up with something really cool, and want to share it with us, just submit a PR. If it hasn't gone through the above process, we probably won't merge it as is, but if it's compelling, we're more than willing to help you via code review, design review and generally OCD nitpicking so that it fits into the rest of our codebase.
|
||||
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
@@ -1,5 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github:
|
||||
- jbrooksuk
|
||||
- cachethq
|
||||
20
.github/ISSUE_TEMPLATE
vendored
Normal file
20
.github/ISSUE_TEMPLATE
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Before submitting your issue, please make sure that you've checked the checkboxes below.
|
||||
|
||||
- [ ] I am running the [latest release](https://github.com/CachetHQ/Cachet/releases/latest) version of Cachet.
|
||||
- [ ] I am running at least PHP 5.5.9. *You can check this by running `php -v`.*
|
||||
- [ ] I have ran `rm -rf bootstrap/cache/*`.
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
*Please describe what you're expecting to see happen.*
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
*Please describe what you're actually seeing happen.*
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
*If your issue requires any specific steps to reproduce, please outline them here.*
|
||||
|
||||
1. First step
|
||||
2. Second step
|
||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,12 +1,4 @@
|
||||
/node_modules
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/vendor
|
||||
/.idea
|
||||
/.vagrant
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
.env
|
||||
package-lock.json
|
||||
node_modules
|
||||
phpunit.xml
|
||||
vendor
|
||||
|
||||
44
.travis.yml
44
.travis.yml
@@ -1,38 +1,16 @@
|
||||
language: php
|
||||
dist: trusty
|
||||
|
||||
php:
|
||||
- 5.5.9
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- hhvm
|
||||
|
||||
sudo: false
|
||||
|
||||
branches:
|
||||
except:
|
||||
- l10n_2.3
|
||||
- l10n_2.4
|
||||
before_install: cp .env.example .env
|
||||
|
||||
before_install:
|
||||
- cp .env.example .env
|
||||
install: travis_retry composer install --no-interaction --no-scripts --prefer-source
|
||||
|
||||
install:
|
||||
- travis_retry composer install --no-interaction --no-suggest
|
||||
|
||||
jobs:
|
||||
include:
|
||||
# - stage: Security check
|
||||
# script:
|
||||
# - phpenv config-rm xdebug.ini || true
|
||||
# - wget https://get.sensiolabs.org/security-checker.phar
|
||||
# - php security-checker.phar security:check ./composer.lock
|
||||
# php: 7.1
|
||||
- stage: Unit tests
|
||||
script:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- vendor/bin/phpunit
|
||||
php: 7.1
|
||||
- stage: Unit tests
|
||||
script:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- vendor/bin/phpunit
|
||||
php: 7.2
|
||||
- stage: Unit tests
|
||||
script:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- vendor/bin/phpunit
|
||||
php: 7.3
|
||||
script: vendor/bin/phpunit
|
||||
|
||||
76
CONTRIBUTING.md
Normal file
76
CONTRIBUTING.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
## Creating issues
|
||||
|
||||
Feature requests and bug reports should be made by using the [issue tracker](https://github.com/cachethq/Cachet/issues). Support questions should be directed to our support email; [support@alt-three.com](mailto:support@alt-three.com?subject=Cachet Support).
|
||||
|
||||
**Always be respectful.** Organization members reserve the right to lock topics if they feel necessary.
|
||||
|
||||
## Languages
|
||||
|
||||
Any non-English translations must be made on the [Cachet CrowdIn](https://translate.cachethq.io) project. This makes syncing translations much easier.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
Please follow existing coding standards:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
namespace CachetHQ\Cachet\Controller;
|
||||
|
||||
use CachetHQ\Cachet\Bar;
|
||||
|
||||
class Foo extends Bar
|
||||
{
|
||||
public function baz()
|
||||
{
|
||||
if ($condition) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
- At least one newline separating `namespace`, `use`, `function` and `class` declarations.
|
||||
- Spaces around operators, loops, conditions and control blocks:
|
||||
```php
|
||||
<?php
|
||||
use \Exception;
|
||||
|
||||
if ($condition === (10 + 2)) {
|
||||
try {
|
||||
throw Exception("Something went wrong...");
|
||||
} catch (Exception $e) {
|
||||
// Do something here.
|
||||
}
|
||||
}
|
||||
```
|
||||
- Braces on a new line following: `namespace`, `use`, `function` and `class`.
|
||||
- PHP constants should be in lowercase; `true`, `false` and `null`.
|
||||
- Defined constants should always be in uppercase.
|
||||
- Never leave trailing spaces at the end of a line.
|
||||
- Files should end with one blank line.
|
||||
- Do not use `# Bash` style comments.
|
||||
- Always add or update Docblocs to functions.
|
||||
- We use [StyleCI](https://styleci.io) to automatically check code standards in Pull Requests. If your PR fails the CI check, then apply the supplied patch and re-push.
|
||||
|
||||
If you're still unsure, then take a look at existing code.
|
||||
|
||||
## Introduction into Git and GitHub
|
||||
|
||||
If you are new to Git, GitHub and the whole open source software community, welcome! Here are some resources for getting started and understanding what it's all about.
|
||||
|
||||
- [Try Git](https://try.github.io/levels/1/challenges/1) by Code School
|
||||
- [GitHub Help](https://help.github.com)
|
||||
|
||||
If you're not particularly fond of the command line, you can get one of GitHub's free GUI desktop apps:
|
||||
|
||||
- [GitHub for Mac](https://github.com/blog/1510-installing-git-from-github-for-mac)
|
||||
- [GitHub for Windows](https://github.com/blog/1127-github-for-windows)
|
||||
|
||||
If you're feeling adventurous, you can become a Git & GitHub master with the [Git Path on Code School](https://www.codeschool.com/paths/git).
|
||||
|
||||
## .editorconfig
|
||||
|
||||
You should also make use of the [.editorconfig](/.editorconfig) file found within the root of the repository. It'll make sure that your editor is setup with the same file settings.
|
||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2015-2019 Alt Three Services Limited.
|
||||
Copyright (c) 2015-2016 Alt Three Services Limited.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
110
README.md
110
README.md
@@ -1,56 +1,106 @@
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://cachethq.io/assets/cachet-logo-dark.svg">
|
||||
<img alt="Cachet Logo" src="https://cachethq.io/assets/cachet-logo-light.svg">
|
||||
</picture>
|
||||
</p>
|
||||
# Cachet
|
||||
|
||||
Cachet, the open-source status page system.
|
||||
[](https://styleci.io/repos/26730195/)
|
||||
[](https://travis-ci.org/CachetHQ/Cachet)
|
||||
[](LICENSE)
|
||||
[](http://translate.cachethq.io/project/cachet)
|
||||
[](https://packagist.org/packages/cachethq/cachet)
|
||||
|
||||
## Cachet 3.x Announcement
|
||||

|
||||
|
||||
We are shifting our attention and resources to Cachet 3.x and will no longer be supporting the 2.x version.
|
||||
|
||||
For more information on the Cachet rebuild and our plans for 3.x, you can read the announcement [here](https://github.com/CachetHQ/Cachet/discussions/4342).
|
||||
Cachet is a beautiful and powerful open source status page system.
|
||||
|
||||
## Features
|
||||
|
||||
- List your service components
|
||||
- Report incidents
|
||||
- Customise the look of your status page
|
||||
- List your services components
|
||||
- Log incidents
|
||||
- Apply custom CSS to the status page
|
||||
- Markdown support for incident messages
|
||||
- A powerful JSON API
|
||||
- JSON API
|
||||
- Translated into eleven languages
|
||||
- Metrics
|
||||
- Multi-lingual
|
||||
- Subscriber notifications via email
|
||||
- Two factor authentication
|
||||
- Cross-database support: MySQL, PostgreSQL and SQLite
|
||||
- Subscriber notifications via Email
|
||||
- Two factor authentication using Google Authenticator
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 7.1.3 – 7.3
|
||||
- HTTP server with PHP support (e.g.: Apache, Nginx, Caddy)
|
||||
- PHP 5.5.9+ or newer
|
||||
- Apache or Nginx server
|
||||
- [Composer](https://getcomposer.org)
|
||||
- A supported database: MySQL, PostgreSQL or SQLite
|
||||
|
||||
## I'm looking to contribute to this awesome project!
|
||||
|
||||
Sweet, we're always looking for contributions that improve Cachet! It's easy to get started and you don't even need to know how to write a single line of code!
|
||||
|
||||
### Contributing as a non-developer/non-designer
|
||||
|
||||
We're always looking for new [translations](#translations).
|
||||
|
||||
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always appreciated.
|
||||
|
||||
### Contributing as a designer
|
||||
|
||||
As Cachet gains new features, the design and ideas that were once a perfect fit need updating and in some cases designing from scratch. This is where you come in! Fancy giving Cachet a lick of paint? Sweet!
|
||||
|
||||
You'll need to install Node.js, Bower and Gulp.
|
||||
|
||||
To get started you can do the following:
|
||||
|
||||
1. Install Node.js and our dev dependencies.
|
||||
2. Make your changes to the SCSS files in `./resources/assets/sass/`
|
||||
3. Run `gulp`
|
||||
|
||||
If you're making a lot of changes, you'll find that running `gulp watch` will make life easier for you!
|
||||
|
||||
### Contributing as a developer
|
||||
|
||||
Built using [Laravel](https://laravel.com).
|
||||
|
||||
We use these extra dependencies to develop Cachet:
|
||||
|
||||
- Node.js
|
||||
- Gulp
|
||||
- Git
|
||||
|
||||
Once cloned to your local machine, you'll need some demo data! Run `php artisan cachet:seed` to get the demo installation ready for action.
|
||||
|
||||
## Installation, Upgrades and Documentation
|
||||
|
||||
You can find documentation at [https://docs.cachethq.io](https://docs.cachethq.io).
|
||||
Documentation is found at [https://docs.cachethq.io](https://docs.cachethq.io).
|
||||
|
||||
Here are some useful quick links:
|
||||
|
||||
- [Installing Cachet](https://docs.cachethq.io/installation/)
|
||||
- [Getting started with Docker](https://docs.cachethq.io/installation/docker)
|
||||
- [Installing Cachet](https://docs.cachethq.io/docs/installing-cachet)
|
||||
- [Getting started with Docker](https://docs.cachethq.io/docs/get-started-with-docker)
|
||||
|
||||
### Demo
|
||||
### Demo Account
|
||||
|
||||
To test out the demo, you can log in to the [Cachet dashboard](https://demo.cachethq.io/dashboard) with the following credentials:
|
||||
To test out the demo, you may login to the [Dashboard](https://demo.cachethq.io/dashboard) with the following:
|
||||
|
||||
- **Username:** `test` or `test@example.com`
|
||||
- **Username:** `test` or `test@test.com`
|
||||
- **Password:** `test123`
|
||||
|
||||
> **Note**
|
||||
> The demo will automatically reset every 30 minutes.
|
||||
The demo is reset every half hour.
|
||||
|
||||
### Release Notes
|
||||
|
||||
We list releases on the [Releases page](https://github.com/CachetHQ/Cachet/releases) of the [Cachet GitHub repository](https://github.com/CachetHQ/Cachet). On the Releases page, you can also find the release notes for each release.
|
||||
|
||||
## Translations
|
||||
|
||||
If you'd like to contribute translations, please check out our [CrowdIn project](https://crowdin.com/project/cachet).
|
||||
|
||||
> Thank you to our [translators](https://crowdin.com/project/cachet/activity_stream), who have allowed us to share Cachet with the world!
|
||||
|
||||
## Show your support
|
||||
|
||||
Cachet is a BSD-3-licensed open source project. If you'd like to support future development, check out the [Patreon campaign](https://patreon.com/jbrooksuk).
|
||||
|
||||
## Professional Installation Service
|
||||
|
||||
We offer a professional installation service. To find out more, email us at [support@alt-three.com](mailto:support@alt-three.com?Cachet Installation)
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to [support@cachethq.io](mailto:support@cachethq.io?Cachet%20Security%20Vulnerability). All security vulnerabilities are reviewed on a case-by-case basis.
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to us at support@alt-three.com. We handle all security vulnerabilities on a case-by-case basis.
|
||||
|
||||
17
SECURITY.md
17
SECURITY.md
@@ -1,17 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
**PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY, [SEE BELOW](#reporting-a-vulnerability).**
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 2.4 | :white_check_mark: |
|
||||
| < 2.4 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a security vulnerability within Cachet, please email James Brooks at james@cachethq.io. All security vulnerabilities will be promptly addressed.
|
||||
@@ -11,12 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Component;
|
||||
|
||||
/**
|
||||
* This is the create component command class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateComponentCommand
|
||||
final class AddComponentCommand
|
||||
{
|
||||
/**
|
||||
* The component name.
|
||||
@@ -67,20 +62,6 @@ final class CreateComponentCommand
|
||||
*/
|
||||
public $enabled;
|
||||
|
||||
/**
|
||||
* JSON meta data for the component.
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
public $meta;
|
||||
|
||||
/**
|
||||
* Tags string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $tags;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
@@ -88,32 +69,28 @@ final class CreateComponentCommand
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'description' => 'nullable|string',
|
||||
'status' => 'required|int|min:0|max:4',
|
||||
'link' => 'nullable|url',
|
||||
'order' => 'nullable|int',
|
||||
'group_id' => 'nullable|int',
|
||||
'enabled' => 'nullable|bool',
|
||||
'meta' => 'nullable|array',
|
||||
'tags' => 'nullable|string',
|
||||
'description' => 'string',
|
||||
'status' => 'int|min:1|max:4',
|
||||
'link' => 'url',
|
||||
'order' => 'int',
|
||||
'group_id' => 'int',
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new add component command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @param int $status
|
||||
* @param string $link
|
||||
* @param int $order
|
||||
* @param int $group_id
|
||||
* @param bool $enabled
|
||||
* @param array|null $meta
|
||||
* @param string|null $tags
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @param int $status
|
||||
* @param string $link
|
||||
* @param int $order
|
||||
* @param int $group_id
|
||||
* @param bool $enabled
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $description, $status, $link, $order, $group_id, $enabled, $meta, $tags = null)
|
||||
public function __construct($name, $description, $status, $link, $order, $group_id, $enabled)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
@@ -122,7 +99,5 @@ final class CreateComponentCommand
|
||||
$this->order = $order;
|
||||
$this->group_id = $group_id;
|
||||
$this->enabled = $enabled;
|
||||
$this->meta = $meta;
|
||||
$this->tags = $tags;
|
||||
}
|
||||
}
|
||||
@@ -25,72 +25,51 @@ final class UpdateComponentCommand
|
||||
/**
|
||||
* The component name.
|
||||
*
|
||||
* @var string|null
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The component description.
|
||||
*
|
||||
* @var string|null
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* The component status.
|
||||
*
|
||||
* @var int|null
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The component link.
|
||||
*
|
||||
* @var string|null
|
||||
* @var string
|
||||
*/
|
||||
public $link;
|
||||
|
||||
/**
|
||||
* The component order.
|
||||
*
|
||||
* @var int|null
|
||||
* @var int
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* The component group.
|
||||
*
|
||||
* @var int|null
|
||||
* @var int
|
||||
*/
|
||||
public $group_id;
|
||||
|
||||
/**
|
||||
* Is the component enabled?
|
||||
*
|
||||
* @var bool|null
|
||||
*/
|
||||
public $enabled;
|
||||
|
||||
/**
|
||||
* JSON meta data for the component.
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
public $meta;
|
||||
|
||||
/**
|
||||
* The tags.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $tags;
|
||||
|
||||
/**
|
||||
* If this is true, we won't notify subscribers of the change.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $silent;
|
||||
public $enabled;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
@@ -98,47 +77,38 @@ final class UpdateComponentCommand
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'nullable|string',
|
||||
'description' => 'nullable|string',
|
||||
'status' => 'nullable|int|min:0|max:4',
|
||||
'link' => 'nullable|url',
|
||||
'order' => 'nullable|int',
|
||||
'group_id' => 'nullable|int',
|
||||
'enabled' => 'nullable|bool',
|
||||
'meta' => 'nullable|array',
|
||||
'silent' => 'nullable|bool',
|
||||
'name' => 'string',
|
||||
'description' => 'string',
|
||||
'status' => 'int|min:1|max:4',
|
||||
'link' => 'url',
|
||||
'order' => 'int',
|
||||
'group_id' => 'int',
|
||||
'enabled' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update component command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
* @param string|null $name
|
||||
* @param string|null $description
|
||||
* @param int|null $status
|
||||
* @param string|null $link
|
||||
* @param int|null $order
|
||||
* @param int|null $group_id
|
||||
* @param bool|null $enabled
|
||||
* @param array|null $meta
|
||||
* @param string|null $tags
|
||||
* @param bool $silent
|
||||
* @param string $name
|
||||
* @param string $description
|
||||
* @param int $status
|
||||
* @param string $link
|
||||
* @param int $order
|
||||
* @param int $group_id
|
||||
* @param bool $enabled
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component, $name = null, $description = null, $status = null, $link = null, $order = null, $group_id = null, $enabled = null, $meta = null, $tags = null, $silent = null)
|
||||
public function __construct(Component $component, $name, $description, $status, $link, $order, $group_id, $enabled)
|
||||
{
|
||||
$this->component = $component;
|
||||
$this->name = $name;
|
||||
$this->description = $description;
|
||||
$this->status = $status;
|
||||
$this->status = (int) $status;
|
||||
$this->link = $link;
|
||||
$this->order = $order;
|
||||
$this->group_id = $group_id;
|
||||
$this->enabled = $enabled;
|
||||
$this->meta = $meta;
|
||||
$this->tags = $tags;
|
||||
$this->silent = $silent;
|
||||
$this->tags = $tags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
namespace CachetHQ\Cachet\Bus\Commands\ComponentGroup;
|
||||
|
||||
/**
|
||||
* This is the create component group command.
|
||||
* This is the add component group command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateComponentGroupCommand
|
||||
final class AddComponentGroupCommand
|
||||
{
|
||||
/**
|
||||
* The component group name.
|
||||
@@ -39,13 +39,6 @@ final class CreateComponentGroupCommand
|
||||
*/
|
||||
public $collapsed;
|
||||
|
||||
/**
|
||||
* Is the component visible to public?
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $visible;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
@@ -53,9 +46,8 @@ final class CreateComponentGroupCommand
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'order' => 'required|int',
|
||||
'collapsed' => 'required|int|between:0,4',
|
||||
'visible' => 'required|bool',
|
||||
'order' => 'int',
|
||||
'collapsed' => 'int|between:0,3',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -64,15 +56,13 @@ final class CreateComponentGroupCommand
|
||||
* @param string $name
|
||||
* @param int $order
|
||||
* @param int $collapsed
|
||||
* @param int $visible
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $order, $collapsed, $visible)
|
||||
public function __construct($name, $order, $collapsed)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->order = (int) $order;
|
||||
$this->collapsed = $collapsed;
|
||||
$this->visible = (int) $visible;
|
||||
}
|
||||
}
|
||||
@@ -48,23 +48,15 @@ final class UpdateComponentGroupCommand
|
||||
*/
|
||||
public $collapsed;
|
||||
|
||||
/**
|
||||
* Is the component visible to public?
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $visible;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'nullable|string',
|
||||
'order' => 'nullable|int',
|
||||
'collapsed' => 'nullable|int|between:0,4',
|
||||
'visible' => 'nullable|bool',
|
||||
'name' => 'string',
|
||||
'order' => 'int',
|
||||
'collapsed' => 'int|between:0,3',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -74,16 +66,14 @@ final class UpdateComponentGroupCommand
|
||||
* @param string $name
|
||||
* @param int $order
|
||||
* @param int $collapsed
|
||||
* @param int $visible
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group, $name, $order, $collapsed, $visible)
|
||||
public function __construct(ComponentGroup $group, $name, $order, $collapsed)
|
||||
{
|
||||
$this->group = $group;
|
||||
$this->name = $name;
|
||||
$this->order = (int) $order;
|
||||
$this->collapsed = $collapsed;
|
||||
$this->visible = (int) $visible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,13 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
/**
|
||||
* This is the create incident command.
|
||||
*
|
||||
* @author Joseph Cohen <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateIncidentCommand
|
||||
final class ReportIncidentCommand
|
||||
{
|
||||
/**
|
||||
* The incident name.
|
||||
@@ -69,18 +63,11 @@ final class CreateIncidentCommand
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* Whether to stick the incident on top.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $stickied;
|
||||
|
||||
/**
|
||||
* The date at which the incident occurred at.
|
||||
* The date at which the incident occurred.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $occurred_at;
|
||||
public $incident_date;
|
||||
|
||||
/**
|
||||
* A given incident template.
|
||||
@@ -96,13 +83,6 @@ final class CreateIncidentCommand
|
||||
*/
|
||||
public $template_vars;
|
||||
|
||||
/**
|
||||
* Meta key/value pairs.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $meta = [];
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
@@ -111,19 +91,17 @@ final class CreateIncidentCommand
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'status' => 'required|int|min:0|max:4',
|
||||
'message' => 'nullable|string',
|
||||
'visible' => 'nullable|bool',
|
||||
'component_id' => 'nullable|required_with:component_status|int',
|
||||
'component_status' => 'nullable|required_with:component_id|int|min:0|max:4',
|
||||
'notify' => 'nullable|bool',
|
||||
'stickied' => 'required|bool',
|
||||
'occurred_at' => 'nullable|string',
|
||||
'template' => 'nullable|string',
|
||||
'meta' => 'nullable|array',
|
||||
'message' => 'string',
|
||||
'visible' => 'bool',
|
||||
'component_id' => 'int|required_with:component_status',
|
||||
'component_status' => 'int|min:1|max:4|required_with:component_id',
|
||||
'notify' => 'bool',
|
||||
'incident_date' => 'string',
|
||||
'template' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new create incident command instance.
|
||||
* Create a new report incident command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $status
|
||||
@@ -132,15 +110,13 @@ final class CreateIncidentCommand
|
||||
* @param int $component_id
|
||||
* @param int $component_status
|
||||
* @param bool $notify
|
||||
* @param bool $stickied
|
||||
* @param string|null $occurred_at
|
||||
* @param string|null $incident_date
|
||||
* @param string|null $template
|
||||
* @param array $template_vars
|
||||
* @param array $meta
|
||||
* @param array|null $template_vars
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $stickied, $occurred_at, $template, array $template_vars = [], array $meta = [])
|
||||
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, array $template_vars = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->status = $status;
|
||||
@@ -149,10 +125,8 @@ final class CreateIncidentCommand
|
||||
$this->component_id = $component_id;
|
||||
$this->component_status = $component_status;
|
||||
$this->notify = $notify;
|
||||
$this->stickied = $stickied;
|
||||
$this->occurred_at = $occurred_at;
|
||||
$this->incident_date = $incident_date;
|
||||
$this->template = $template;
|
||||
$this->template_vars = $template_vars;
|
||||
$this->meta = $meta;
|
||||
}
|
||||
}
|
||||
73
app/Bus/Commands/Incident/ReportMaintenanceCommand.php
Normal file
73
app/Bus/Commands/Incident/ReportMaintenanceCommand.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
final class ReportMaintenanceCommand
|
||||
{
|
||||
/**
|
||||
* The maintenance name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The maintenance message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* Whether to notify about the maintenance or not.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* Timestamp of when the maintenance is due to start.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $timestamp;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'message' => 'string',
|
||||
'notify' => 'bool',
|
||||
'timestamp' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new report maintenance command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $message
|
||||
* @param bool $notify
|
||||
* @param string $timestamp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $message, $notify, $timestamp)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->message = $message;
|
||||
$this->notify = $notify;
|
||||
$this->timestamp = $timestamp;
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,6 @@ namespace CachetHQ\Cachet\Bus\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
/**
|
||||
* This is the update incident command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Joseph Cohem <joe@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
final class UpdateIncidentCommand
|
||||
{
|
||||
/**
|
||||
@@ -79,18 +72,11 @@ final class UpdateIncidentCommand
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* Whether to stick the incident on top.
|
||||
* The date that the incident occurred on.
|
||||
*
|
||||
* @var bool
|
||||
* @var string
|
||||
*/
|
||||
public $stickied;
|
||||
|
||||
/**
|
||||
* The timestamp that the incident occurred at.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $occurred_at;
|
||||
public $incident_date;
|
||||
|
||||
/**
|
||||
* A given incident template.
|
||||
@@ -106,30 +92,20 @@ final class UpdateIncidentCommand
|
||||
*/
|
||||
public $template_vars;
|
||||
|
||||
/**
|
||||
* Meta key/value pairs.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $meta = [];
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'nullable|string',
|
||||
'status' => 'nullable|int|min:0|max:4',
|
||||
'message' => 'nullable|string',
|
||||
'visible' => 'nullable|bool',
|
||||
'component_id' => 'nullable|int',
|
||||
'component_status' => 'nullable|int|min:0|max:4|required_with:component_id',
|
||||
'notify' => 'nullable|bool',
|
||||
'stickied' => 'nullable|bool',
|
||||
'occurred_at' => 'nullable|string',
|
||||
'template' => 'nullable|string',
|
||||
'meta' => 'nullable|array',
|
||||
'name' => 'string',
|
||||
'status' => 'int|min:0|max:4',
|
||||
'message' => 'string',
|
||||
'visible' => 'bool',
|
||||
'component_id' => 'int',
|
||||
'component_status' => 'int|min:1|max:4|required_with:component_id',
|
||||
'notify' => 'bool',
|
||||
'template' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -143,15 +119,13 @@ final class UpdateIncidentCommand
|
||||
* @param int $component_id
|
||||
* @param int $component_status
|
||||
* @param bool $notify
|
||||
* @param bool $stickied
|
||||
* @param string|null $occurred_at
|
||||
* @param string|null $incident_date
|
||||
* @param string|null $template
|
||||
* @param array $template_vars
|
||||
* @param array $meta
|
||||
* @param array|null $template_vars
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $stickied, $occurred_at, $template, array $template_vars = [], array $meta = [])
|
||||
public function __construct(Incident $incident, $name, $status, $message, $visible, $component_id, $component_status, $notify, $incident_date, $template, array $template_vars = null)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
$this->name = $name;
|
||||
@@ -161,10 +135,8 @@ final class UpdateIncidentCommand
|
||||
$this->component_id = $component_id;
|
||||
$this->component_status = $component_status;
|
||||
$this->notify = $notify;
|
||||
$this->stickied = $stickied;
|
||||
$this->occurred_at = $occurred_at;
|
||||
$this->incident_date = $incident_date;
|
||||
$this->template = $template;
|
||||
$this->template_vars = $template_vars;
|
||||
$this->meta = $meta;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the report incident update command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* The incident status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The incident message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
/**
|
||||
* The incident component.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $component_id;
|
||||
|
||||
/**
|
||||
* The component status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $component_status;
|
||||
/**
|
||||
* The user.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'incident' => 'required',
|
||||
'status' => 'required|int|min:1|max:4',
|
||||
'message' => 'required|string',
|
||||
'component_id' => 'nullable|required_with:component_status|int',
|
||||
'component_status' => 'nullable|required_with:component_id|int|min:0|max:4',
|
||||
'user' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new report incident update command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident, $status, $message, $component_id, $component_status, User $user)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
$this->status = $status;
|
||||
$this->message = $message;
|
||||
$this->component_id = $component_id;
|
||||
$this->component_status = $component_status;
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
|
||||
/**
|
||||
* This is the remove incident update command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class RemoveIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident update to remove.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $incidentUpdate;
|
||||
|
||||
/**
|
||||
* Create a new remove incident update command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $incidentUpdate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $incidentUpdate)
|
||||
{
|
||||
$this->incidentUpdate = $incidentUpdate;
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the update incident update command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UpdateIncidentUpdateCommand
|
||||
{
|
||||
/**
|
||||
* The incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* The incident status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The incident message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The user.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'status' => 'nullable|int|min:1|max:4',
|
||||
'message' => 'nullable|string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update incident update command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
* @param string $status
|
||||
* @param string $message
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(IncidentUpdate $update, $status, $message, User $user)
|
||||
{
|
||||
$this->update = $update;
|
||||
$this->status = $status;
|
||||
$this->message = $message;
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
/**
|
||||
* This is the create metric command class.
|
||||
*
|
||||
* @author Joseph Cohen <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateMetricCommand
|
||||
final class AddMetricCommand
|
||||
{
|
||||
/**
|
||||
* The metric name.
|
||||
@@ -89,13 +83,6 @@ final class CreateMetricCommand
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* The visibility of the metric.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $visible;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
@@ -104,15 +91,15 @@ final class CreateMetricCommand
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'suffix' => 'required|string',
|
||||
'description' => 'nullable|string',
|
||||
'default_value' => 'required|int',
|
||||
'calc_type' => 'required|int',
|
||||
'display_chart' => 'nullable|int',
|
||||
'places' => 'nullable|int|between:0,4',
|
||||
'default_view' => 'required|int|between:0,3',
|
||||
'threshold' => 'required|int',
|
||||
'order' => 'nullable|int',
|
||||
'visible' => 'required|int|between:0,2',
|
||||
'description' => 'string',
|
||||
'display_chart' => 'bool',
|
||||
'default_value' => 'int',
|
||||
'calc_type' => 'int',
|
||||
'display_chart' => 'int',
|
||||
'places' => 'int|between:0,4',
|
||||
'default_view' => 'int|between:0,3',
|
||||
'threshold' => 'numeric|between:0,10',
|
||||
'order' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -128,11 +115,10 @@ final class CreateMetricCommand
|
||||
* @param int $default_view
|
||||
* @param int $threshold
|
||||
* @param int $order
|
||||
* @param int $visible
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = 0, $visible = 1)
|
||||
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = 0)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->suffix = $suffix;
|
||||
@@ -144,6 +130,5 @@ final class CreateMetricCommand
|
||||
$this->default_view = $default_view;
|
||||
$this->threshold = $threshold;
|
||||
$this->order = $order;
|
||||
$this->visible = $visible;
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,7 @@ namespace CachetHQ\Cachet\Bus\Commands\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
/**
|
||||
* This is the create metric point command class.
|
||||
*
|
||||
* @author Joseph Cohen <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateMetricPointCommand
|
||||
final class AddMetricPointCommand
|
||||
{
|
||||
/**
|
||||
* The metric to add.
|
||||
@@ -38,7 +32,7 @@ final class CreateMetricPointCommand
|
||||
/**
|
||||
* The metric point created at.
|
||||
*
|
||||
* @var int
|
||||
* @var string
|
||||
*/
|
||||
public $created_at;
|
||||
|
||||
@@ -48,8 +42,8 @@ final class CreateMetricPointCommand
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'value' => 'required|numeric',
|
||||
'created_at' => 'nullable|int',
|
||||
'value' => 'numeric',
|
||||
'created_at' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -57,7 +51,7 @@ final class CreateMetricPointCommand
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
* @param int $value
|
||||
* @param int $created_at
|
||||
* @param string $created_at
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -92,30 +92,23 @@ final class UpdateMetricCommand
|
||||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* The visibility of the metric.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $visible;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'nullable|string',
|
||||
'suffix' => 'nullable|string',
|
||||
'description' => 'nullable|string',
|
||||
'default_value' => 'nullable|numeric',
|
||||
'calc_type' => 'nullable|int|in:0,1',
|
||||
'display_chart' => 'nullable|int',
|
||||
'places' => 'nullable|numeric|between:0,4',
|
||||
'default_view' => 'nullable|numeric|between:0,4',
|
||||
'threshold' => 'nullable|int',
|
||||
'order' => 'nullable|int',
|
||||
'visible' => 'nullable|int|between:0,2',
|
||||
'name' => 'string',
|
||||
'suffix' => 'string',
|
||||
'description' => 'string',
|
||||
'display_chart' => 'bool',
|
||||
'default_value' => 'numeric',
|
||||
'calc_type' => 'int|in:0,1',
|
||||
'display_chart' => 'int',
|
||||
'places' => 'numeric|between:0,4',
|
||||
'default_view' => 'numeric|between:0,4',
|
||||
'threshold' => 'numeric|between:0,10',
|
||||
'order' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -132,11 +125,10 @@ final class UpdateMetricCommand
|
||||
* @param int $default_view
|
||||
* @param int $threshold
|
||||
* @param int|null $order
|
||||
* @param int $visible
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null, $visible = null)
|
||||
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
$this->name = $name;
|
||||
@@ -149,6 +141,5 @@ final class UpdateMetricCommand
|
||||
$this->default_view = $default_view;
|
||||
$this->threshold = $threshold;
|
||||
$this->order = $order;
|
||||
$this->visible = $visible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ final class UpdateMetricPointCommand
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'value' => 'nullable|numeric',
|
||||
'created_at' => 'nullable|string',
|
||||
'value' => 'numeric',
|
||||
'created_at' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Schedule;
|
||||
|
||||
/**
|
||||
* This is the create schedule command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateScheduleCommand
|
||||
{
|
||||
/**
|
||||
* The schedule name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The schedule message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The schedule status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The schedule date.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $scheduled_at;
|
||||
|
||||
/**
|
||||
* The completed at date.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $completed_at;
|
||||
|
||||
/**
|
||||
* The components affected by the schedule.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $components;
|
||||
|
||||
/**
|
||||
* Whether to notify that the incident was reported.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|string',
|
||||
'message' => 'nullable|string',
|
||||
'status' => 'required|int|min:0|max:2',
|
||||
'scheduled_at' => 'required|string',
|
||||
'completed_at' => 'nullable|string',
|
||||
'components' => 'nullable|array',
|
||||
'notify' => 'nullable|bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new create schedule command instance.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $message
|
||||
* @param int $status
|
||||
* @param string $scheduled_at
|
||||
* @param string $completed_at
|
||||
* @param array $components
|
||||
* @param bool $notify
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($name, $message, $status, $scheduled_at, $completed_at, $components, $notify)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->message = $message;
|
||||
$this->status = $status;
|
||||
$this->scheduled_at = $scheduled_at;
|
||||
$this->completed_at = $completed_at;
|
||||
$this->components = $components;
|
||||
$this->notify = $notify;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
|
||||
/**
|
||||
* This is the delete schedule command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class DeleteScheduleCommand
|
||||
{
|
||||
/**
|
||||
* The schedule to delete.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Schedule
|
||||
*/
|
||||
public $schedule;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'schedule' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new delete schedule command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Schedule $schedule)
|
||||
{
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
|
||||
/**
|
||||
* This is the update schedule command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UpdateScheduleCommand
|
||||
{
|
||||
/**
|
||||
* The schedule to update.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Schedule
|
||||
*/
|
||||
public $schedule;
|
||||
|
||||
/**
|
||||
* The schedule name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* The schedule message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* The schedule status.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $status;
|
||||
|
||||
/**
|
||||
* The schedule date.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $scheduled_at;
|
||||
|
||||
/**
|
||||
* The completed at date.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $completed_at;
|
||||
|
||||
/**
|
||||
* The components affected by the schedule.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $components;
|
||||
|
||||
/**
|
||||
* The validation rules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'schedule' => 'required',
|
||||
'name' => 'nullable|string',
|
||||
'message' => 'nullable|string',
|
||||
'status' => 'nullable|int|min:0|max:2',
|
||||
'scheduled_at' => 'nullable|string',
|
||||
'completed_at' => 'nullable|string',
|
||||
'components' => 'nullable|array',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new update schedule command instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
* @param string $name
|
||||
* @param string $message
|
||||
* @param int $status
|
||||
* @param string $scheduled_at
|
||||
* @param string $completed_at
|
||||
* @param array $components
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Schedule $schedule, $name, $message, $status, $scheduled_at, $completed_at, array $components = [])
|
||||
{
|
||||
$this->schedule = $schedule;
|
||||
$this->name = $name;
|
||||
$this->message = $message;
|
||||
$this->status = $status;
|
||||
$this->scheduled_at = $scheduled_at;
|
||||
$this->completed_at = $completed_at;
|
||||
$this->components = $components;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\System\Config;
|
||||
|
||||
/**
|
||||
* This is the update config command class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UpdateConfigCommand
|
||||
{
|
||||
/**
|
||||
* This is the config key/values array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $values;
|
||||
|
||||
/**
|
||||
* Create a new update config command instance.
|
||||
*
|
||||
* @param array $values
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($values)
|
||||
{
|
||||
$this->values = $values;
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
/**
|
||||
* This is the create user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class CreateUserCommand
|
||||
final class AddTeamMemberCommand
|
||||
{
|
||||
/**
|
||||
* The user username.
|
||||
@@ -52,9 +47,9 @@ final class CreateUserCommand
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'username' => 'required|string',
|
||||
'password' => 'required|string',
|
||||
'level' => 'required|int',
|
||||
'name' => 'required|string',
|
||||
'password' => 'string',
|
||||
'level' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -11,12 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
/**
|
||||
* This is the invite user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class InviteUserCommand
|
||||
final class InviteTeamMemberCommand
|
||||
{
|
||||
/**
|
||||
* The invite emails.
|
||||
@@ -31,11 +26,11 @@ final class InviteUserCommand
|
||||
* @var string[]
|
||||
*/
|
||||
public $rules = [
|
||||
'emails.*' => 'required|email',
|
||||
'emails' => 'required|array|email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new invite user command instance.
|
||||
* Create a new invite team member command instance.
|
||||
*
|
||||
* @param string[] $emails
|
||||
*
|
||||
@@ -48,9 +48,9 @@ final class SignupUserCommand
|
||||
*/
|
||||
public $rules = [
|
||||
'username' => 'required|string',
|
||||
'password' => 'required|string',
|
||||
'password' => 'string',
|
||||
'email' => 'required|string|email',
|
||||
'level' => 'required|int',
|
||||
'level' => 'int',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events;
|
||||
|
||||
/**
|
||||
* This is the action interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ActionInterface
|
||||
{
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction();
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Beacon;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the beacon event interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface BeaconEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Beacon;
|
||||
|
||||
/**
|
||||
* This is the beacon failed to send event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class BeaconFailedToSendEvent implements BeaconEventInterface
|
||||
{
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Beacon failed to send.';
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Beacon;
|
||||
|
||||
/**
|
||||
* This is the beacon was sent event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class BeaconWasSentEvent implements BeaconEventInterface
|
||||
{
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Beacon was sent.';
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the component event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ComponentEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component status was changed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentStatusWasChangedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who changed the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was changed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* The original status of the component.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $original_status;
|
||||
|
||||
/**
|
||||
* The new status of the component.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $new_status;
|
||||
|
||||
/**
|
||||
* If silent, we won't notify.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $silent;
|
||||
|
||||
/**
|
||||
* Create a new component was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
* @param int $original_status
|
||||
* @param int $new_status
|
||||
* @param bool $silent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Component $component, $original_status, $new_status, $silent)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
$this->original_status = $original_status;
|
||||
$this->new_status = $new_status;
|
||||
$this->silent = $silent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component status was changed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
36
app/Bus/Events/Component/ComponentWasAddedEvent.php
Normal file
36
app/Bus/Events/Component/ComponentWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
|
||||
final class ComponentWasAddedEvent implements ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The component that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->component = $component;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentWasCreatedEvent implements ActionInterface, ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Component
|
||||
*/
|
||||
public $component;
|
||||
|
||||
/**
|
||||
* Create a new component was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Component $component)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,24 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component was removed event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentWasRemovedEvent implements ActionInterface, ComponentEventInterface
|
||||
final class ComponentWasRemovedEvent implements ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was removed.
|
||||
*
|
||||
@@ -39,37 +25,12 @@ final class ComponentWasRemovedEvent implements ActionInterface, ComponentEventI
|
||||
/**
|
||||
* Create a new component was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Component $component)
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,25 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component was updated event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
final class ComponentWasUpdatedEvent implements ActionInterface, ComponentEventInterface
|
||||
final class ComponentWasUpdatedEvent implements ComponentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the component.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component that was updated.
|
||||
*
|
||||
@@ -40,37 +25,12 @@ final class ComponentWasUpdatedEvent implements ActionInterface, ComponentEventI
|
||||
/**
|
||||
* Create a new component was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Component $component
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Component $component)
|
||||
public function __construct(Component $component)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the component group event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ComponentGroupEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
|
||||
final class ComponentGroupWasAddedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The component group that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the component group was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ComponentGroupWasCreatedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component group that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\ComponentGroup
|
||||
*/
|
||||
public $group;
|
||||
|
||||
/**
|
||||
* Create a new component group was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $group
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, ComponentGroup $group)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component Group was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentGroupWasRemovedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
final class ComponentGroupWasRemovedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component group that was removed.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class ComponentGroupWasRemovedEvent implements ActionInterface, ComponentG
|
||||
/**
|
||||
* Create a new component group was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, ComponentGroup $group)
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component Group was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\ComponentGroup;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class ComponentGroupWasUpdatedEvent implements ActionInterface, ComponentGroupEventInterface
|
||||
final class ComponentGroupWasUpdatedEvent implements ComponentGroupEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the component group.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The component group that was updated.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class ComponentGroupWasUpdatedEvent implements ActionInterface, ComponentG
|
||||
/**
|
||||
* Create a new component group was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\ComponentGroup $group
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, ComponentGroup $group)
|
||||
public function __construct(ComponentGroup $group)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->group = $group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Component Group was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events;
|
||||
|
||||
/**
|
||||
* This is the event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the incident event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface IncidentEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasCreatedEvent implements ActionInterface, IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who reported the event.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Whether to notify that the incident was reported.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* Create a new incident has reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
* @param bool $notify
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Incident $incident, $notify = false)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->incident = $incident;
|
||||
$this->notify = $notify;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Incident was reported.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasRemovedEvent implements ActionInterface, IncidentEventInterface
|
||||
final class IncidentWasRemovedEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the event.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident that has been removed.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class IncidentWasRemovedEvent implements ActionInterface, IncidentEventInt
|
||||
/**
|
||||
* Create a new incident was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Incident $incident)
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->incident = $incident;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Incident was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
36
app/Bus/Events/Incident/IncidentWasReportedEvent.php
Normal file
36
app/Bus/Events/Incident/IncidentWasReportedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
final class IncidentWasReportedEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new incident has reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class IncidentWasUpdatedEvent implements ActionInterface, IncidentEventInterface
|
||||
final class IncidentWasUpdatedEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the event.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident that has been updated.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class IncidentWasUpdatedEvent implements ActionInterface, IncidentEventInt
|
||||
/**
|
||||
* Create a new incident has updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Incident $incident)
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->incident = $incident;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Incident was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
36
app/Bus/Events/Incident/MaintenanceWasScheduledEvent.php
Normal file
36
app/Bus/Events/Incident/MaintenanceWasScheduledEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
final class MaintenanceWasScheduledEvent implements IncidentEventInterface
|
||||
{
|
||||
/**
|
||||
* The incident that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Incident
|
||||
*/
|
||||
public $incident;
|
||||
|
||||
/**
|
||||
* Create a new maintenance has scheduled event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Incident $incident
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Incident $incident)
|
||||
{
|
||||
$this->incident = $incident;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the incident update event interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface IncidentUpdateEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident update was removed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasRemovedEvent implements ActionInterface, IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident update that has been removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* Create a new incident update was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, IncidentUpdate $update)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->update = $update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Incident Update was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident update was reported event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasReportedEvent implements ActionInterface, IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who reported the incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident update that has been reported.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* Create a new incident update was reported event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, IncidentUpdate $update)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->update = $update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Incident Update was reported.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\IncidentUpdate;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\IncidentUpdate;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the incident update was updated event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class IncidentUpdateWasUpdatedEvent implements ActionInterface, IncidentUpdateEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the incident update.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The incident update that has been updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\IncidentUpdate
|
||||
*/
|
||||
public $update;
|
||||
|
||||
/**
|
||||
* Create a new incident update was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\IncidentUpdate $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, IncidentUpdate $update)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->update = $update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Incident Update was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\Invite;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the invite event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface InviteEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -31,14 +31,4 @@ final class InviteWasClaimedEvent implements InviteEventInterface
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Invite was claimed.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the metric event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface MetricEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
36
app/Bus/Events/Metric/MetricPointWasAddedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricPointWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
final class MetricPointWasAddedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric point that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new metric point was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the metric point was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class MetricPointWasCreatedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric point that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\MetricPoint
|
||||
*/
|
||||
public $metricPoint;
|
||||
|
||||
/**
|
||||
* Create a new metric point was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, MetricPoint $metricPoint)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Metric Point was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricPointWasRemovedEvent implements ActionInterface, MetricEventInterface
|
||||
final class MetricPointWasRemovedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric point that was removed.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class MetricPointWasRemovedEvent implements ActionInterface, MetricEventIn
|
||||
/**
|
||||
* Create a new metric point was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $memtricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, MetricPoint $metricPoint)
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Metric Point was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricPointWasUpdatedEvent implements ActionInterface, MetricEventInterface
|
||||
final class MetricPointWasUpdatedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who updated the metric point.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric point that was updated.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class MetricPointWasUpdatedEvent implements ActionInterface, MetricEventIn
|
||||
/**
|
||||
* Create a new metric point was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\MetricPoint $metricPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, MetricPoint $metricPoint)
|
||||
public function __construct(MetricPoint $metricPoint)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metricPoint = $metricPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Metric Point was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
36
app/Bus/Events/Metric/MetricWasAddedEvent.php
Normal file
36
app/Bus/Events/Metric/MetricWasAddedEvent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
|
||||
final class MetricWasAddedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The metric that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->metric = $metric;
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the metric was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class MetricWasCreatedEvent implements ActionInterface, MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who added the metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric that was added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Metric
|
||||
*/
|
||||
public $metric;
|
||||
|
||||
/**
|
||||
* Create a new metric was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Metric $metric)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metric = $metric;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Metric was added.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricWasRemovedEvent implements ActionInterface, MetricEventInterface
|
||||
final class MetricWasRemovedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who removed the metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric that was removed.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class MetricWasRemovedEvent implements ActionInterface, MetricEventInterfa
|
||||
/**
|
||||
* Create a new metric was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Metric $metric)
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metric = $metric;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Metric was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,10 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class MetricWasUpdatedEvent implements ActionInterface, MetricEventInterface
|
||||
final class MetricWasUpdatedEvent implements MetricEventInterface
|
||||
{
|
||||
/**
|
||||
* The user who update the metric.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The metric that was updated.
|
||||
*
|
||||
@@ -34,37 +25,12 @@ final class MetricWasUpdatedEvent implements ActionInterface, MetricEventInterfa
|
||||
/**
|
||||
* Create a new metric was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Metric $metric
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Metric $metric)
|
||||
public function __construct(Metric $metric)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->metric = $metric;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Metric was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the schedule event interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ScheduleEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the schedule was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ScheduleWasCreatedEvent implements ActionInterface, ScheduleEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that created the schedule.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The schedule that has been created.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Schedule
|
||||
*/
|
||||
public $schedule;
|
||||
|
||||
/**
|
||||
* Whether to notify that the incident was reported.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $notify;
|
||||
|
||||
/**
|
||||
* Create a new schedule was created event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
* @param bool notify
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Schedule $schedule, $notify = false)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->schedule = $schedule;
|
||||
$this->notify = $notify;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Schedule was created.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the schedule was removed event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ScheduleWasRemovedEvent implements ActionInterface, ScheduleEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that removed the schedule.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The schedule that has been removed.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Schedule
|
||||
*/
|
||||
public $schedule;
|
||||
|
||||
/**
|
||||
* Create a new schedule was removed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Schedule $schedule)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Schedule was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\Schedule;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the schedule was updated event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class ScheduleWasUpdatedEvent implements ActionInterface, ScheduleEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that created the schedule.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The schedule that has been updated.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Schedule
|
||||
*/
|
||||
public $schedule;
|
||||
|
||||
/**
|
||||
* Create a new schedule was updated event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Schedule $schedule)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->schedule = $schedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Schedule was updated.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\Subscriber;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the subscriber event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface SubscriberEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -33,14 +33,4 @@ final class SubscriberHasSubscribedEvent implements SubscriberEventInterface
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Subscriber has subscribed.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,14 +33,4 @@ final class SubscriberHasUnsubscribedEvent implements SubscriberEventInterface
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Subscriber has unsubscribed.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,14 +38,4 @@ final class SubscriberHasUpdatedSubscriptionsEvent implements SubscriberEventInt
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Subscriber has updated subscription.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,14 +33,4 @@ final class SubscriberHasVerifiedEvent implements SubscriberEventInterface
|
||||
{
|
||||
$this->subscriber = $subscriber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'Subscriber has verified.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\System;
|
||||
|
||||
/**
|
||||
* This is the system checked for updates event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class SystemCheckedForUpdatesEvent implements SystemEventInterface
|
||||
{
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'System checked for updated.';
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\System;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the system event interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface SystemEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\System;
|
||||
|
||||
/**
|
||||
* This is the system was installed event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class SystemWasInstalledEvent implements SystemEventInterface
|
||||
{
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'System was installed.';
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\System;
|
||||
|
||||
/**
|
||||
* This is the system was reset event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class SystemWasResetEvent implements SystemEventInterface
|
||||
{
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'System was reset.';
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\System;
|
||||
|
||||
/**
|
||||
* This is the system was updated event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class SystemWasUpdatedEvent implements SystemEventInterface
|
||||
{
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'System was updated.';
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user accepted invite event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserAcceptedInviteEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that accepted the invite.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* The invite that the user accepted.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
public $invite;
|
||||
|
||||
/**
|
||||
* Create a new user accepted invite event class.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
* @param \CachetHQ\Cachet\Models\Invite $invite
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user, Invite $invite)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->invite = $invite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User accepted invite.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user disabled two auth event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserDisabledTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that disabled two auth.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user disabled two auth event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User disabled two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user enabled two auth event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserEnabledTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that enabled two auth.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user enabled two auth event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User enabled two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,6 @@ namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\EventInterface;
|
||||
|
||||
/**
|
||||
* This is the user event interface.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface UserEventInterface extends EventInterface
|
||||
{
|
||||
//
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user failed two auth event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserFailedTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that failed two auth.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user failed two auth event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User failed two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user logged in event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserLoggedInEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that logged in.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user logged in event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User logged in.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user logged out event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserLoggedOutEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that logged out.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user logged out event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User logged out.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user passed two auth event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserPassedTwoAuthEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that passed two auth.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user passed two auth event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User passed two-factor authentication.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user regenerated api token event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserRegeneratedApiTokenEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that regenerated their api token.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user regenerated api token event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User regenerated api token.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -9,26 +9,21 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the welcome user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class WelcomeUserCommand
|
||||
final class UserWasAddedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user.
|
||||
* The user that has been added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new welcome user command instance.
|
||||
* Create a new user was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user was created event class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserWasCreatedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user was added event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User was created.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,17 +13,10 @@ namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
/**
|
||||
* This is the user was invited event class.
|
||||
*
|
||||
* @author Joseph Cohen <joe@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserWasInvitedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The invite that has been created.
|
||||
* The invite that has been added.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\Invite
|
||||
*/
|
||||
@@ -40,14 +33,4 @@ final class UserWasInvitedEvent implements UserEventInterface
|
||||
{
|
||||
$this->invite = $invite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User was invited.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
final class UserWasRemovedEvent implements ActionInterface, UserEventInterface
|
||||
final class UserWasRemovedEvent implements UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user that has been removed.
|
||||
@@ -34,27 +33,4 @@ final class UserWasRemovedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User was removed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\ActionInterface;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user was welcomed event.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class UserWasWelcomedEvent implements ActionInterface, UserEventInterface
|
||||
{
|
||||
/**
|
||||
* The user.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new user was welcomed event instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Models\User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return 'User was welcomed.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event action.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAction()
|
||||
{
|
||||
return [
|
||||
'user' => $this->user,
|
||||
'description' => (string) $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Exceptions\Component;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Exceptions\ExceptionInterface;
|
||||
|
||||
/**
|
||||
* This is the component exception interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface ComponentExceptionInterface extends ExceptionInterface
|
||||
{
|
||||
//
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user